Compare commits
16 Commits
e0f46beaab
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
5eaefccdb7
|
|||
|
a68788913b
|
|||
|
b9523c0d4d
|
|||
|
|
e72c6168ef | ||
|
|
990300c269 | ||
|
0cbaf1c165
|
|||
|
e103078eab
|
|||
|
|
e7e44fdee3 | ||
|
d564c2350f
|
|||
|
fa0ef34f30
|
|||
|
0b20e0db1b
|
|||
|
b0f9564c21
|
|||
|
4950895bce
|
|||
|
|
fa2b71d357 | ||
|
|
0d86b57569 | ||
|
|
b1c879defd |
7
KOMPOSE.md
Normal file
7
KOMPOSE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Enables Docker Compose on Kubernetes
|
||||
|
||||
```shell
|
||||
curl -L https://github.com/kubernetes/kompose/releases/download/v1.15.0/kompose-linux-amd64 -o kompose
|
||||
chmod +x kompose
|
||||
sudo mv ./kompose /usr/local/bin/kompose
|
||||
```
|
||||
5
NGINX_ING.md
Normal file
5
NGINX_ING.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Nginx Ingress Controller
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.0/deploy/static/provider/baremetal/deploy.yaml
|
||||
```
|
||||
@@ -187,6 +187,10 @@ sudo kubeadm join ip-api-server:6443 --token $TOKEN --discovery-token-ca-cert-ha
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml
|
||||
```
|
||||
For Kube 1.17+
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
||||
```
|
||||
|
||||
#### Cluster Network with Calico
|
||||
```shell
|
||||
@@ -195,7 +199,7 @@ kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
|
||||
|
||||
#### Kubernetes Dashboard
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.3.1/aio/deploy/recommended.yaml
|
||||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
|
||||
```
|
||||
- Proxy for kubernetes dashboard
|
||||
```shell
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: default
|
||||
name: drone
|
||||
labels:
|
||||
app.kubernetes.io/name: drone
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: drone
|
||||
@@ -15,14 +16,14 @@ spec:
|
||||
app.kubernetes.io/name: drone
|
||||
spec:
|
||||
containers:
|
||||
- name: runner
|
||||
image: drone/drone-runner-kube:latest
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: DRONE_RPC_HOST
|
||||
value: dci.osa.cubetiqs.com
|
||||
- name: DRONE_RPC_PROTO
|
||||
value: https
|
||||
- name: DRONE_RPC_SECRET
|
||||
value: super-duper-secret
|
||||
- name: runner
|
||||
image: drone/drone-runner-kube:latest
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
env:
|
||||
- name: DRONE_RPC_HOST
|
||||
value: dci.cubetiqs.com
|
||||
- name: DRONE_RPC_PROTO
|
||||
value: https
|
||||
- name: DRONE_RPC_SECRET
|
||||
value: 1a6c2d8b6fac4bf9351e5149c39e7fc4
|
||||
|
||||
@@ -4,25 +4,25 @@ metadata:
|
||||
namespace: default
|
||||
name: drone
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- pods/log
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- delete
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- pods/log
|
||||
verbs:
|
||||
- get
|
||||
- create
|
||||
- delete
|
||||
- list
|
||||
- watch
|
||||
- update
|
||||
|
||||
---
|
||||
kind: RoleBinding
|
||||
@@ -31,10 +31,10 @@ metadata:
|
||||
name: drone
|
||||
namespace: default
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: default
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: drone
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
|
||||
11
k8s/cert-test.yaml
Normal file
11
k8s/cert-test.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: mp-dev.lb-app.cubetiqdns.net
|
||||
spec:
|
||||
secretName: mp-dev.lb-app.cubetiqdns.net
|
||||
dnsNames:
|
||||
- mp-dev.lb-app.cubetiqdns.net
|
||||
issuerRef:
|
||||
name: letsencrypt-staging
|
||||
kind: ClusterIssuer
|
||||
17
k8s/cm-clusterissuer.yaml
Normal file
17
k8s/cm-clusterissuer.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt-production
|
||||
spec:
|
||||
acme:
|
||||
# Remember to update this if you use this manifest to obtain real certificates :)
|
||||
email: sombochea100@gmail.com
|
||||
#server: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||
# To use the production environment, use the following line instead:
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
privateKeySecretRef:
|
||||
name: issuer-letsencrypt-production
|
||||
solvers:
|
||||
- http01:
|
||||
ingress:
|
||||
class: traefik
|
||||
16
metallb/bgpconfig.yaml
Normal file
16
metallb/bgpconfig.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
namespace: metallb-system
|
||||
name: config
|
||||
data:
|
||||
config: |
|
||||
peers:
|
||||
- peer-address: 192.168.0.225
|
||||
peer-asn: 65432
|
||||
my-asn: 65433
|
||||
address-pools:
|
||||
- name: default
|
||||
protocol: bgp
|
||||
addresses:
|
||||
- 10.25.0.10-10.25.3.250
|
||||
42
metallb/nginx-test.yaml
Normal file
42
metallb/nginx-test.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-nginx
|
||||
namespace: default
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
run: test-nginx
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
run: test-nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: test-nginx
|
||||
image: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: test-nginx
|
||||
namespace: default
|
||||
labels:
|
||||
run: test-nginx
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
selector:
|
||||
run: test-nginx
|
||||
15
mysql/mysql-cluster.yaml
Normal file
15
mysql/mysql-cluster.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: mysql
|
||||
---
|
||||
apiVersion: mysql.oracle.com/v2alpha1
|
||||
kind: InnoDBCluster
|
||||
metadata:
|
||||
name: mysql-cluster
|
||||
namespace: mysql
|
||||
spec:
|
||||
secretName: mysql-secret
|
||||
instances: 3
|
||||
router:
|
||||
instances: 1
|
||||
6
portainer.md
Normal file
6
portainer.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Install Portainer
|
||||
```shell
|
||||
helm install --create-namespace -n portainer portainer portainer/portainer \
|
||||
--set service.type=LoadBalancer \
|
||||
--set tls.force=true
|
||||
```
|
||||
1
rbac/.gitignore
vendored
Normal file
1
rbac/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
developer-user.yaml
|
||||
74
rbac/README.md
Normal file
74
rbac/README.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# Create RBAC for specific namespace
|
||||
|
||||
- Apply RBAC for specific namespace
|
||||
|
||||
```shell
|
||||
k apply -f access.yaml
|
||||
```
|
||||
|
||||
- Get Details of RBAC
|
||||
|
||||
```shell
|
||||
k describe sa developer -n developer-dev
|
||||
```
|
||||
|
||||
- Get Token from RBAC
|
||||
|
||||
```shell
|
||||
k get secret developer-token-l4r67 -n developer-dev -o "jsonpath={.data.token}" | base64 -d
|
||||
```
|
||||
|
||||
- Get Certificate from RBAC
|
||||
|
||||
```shell
|
||||
k get secret developer-token-l4r67 -n developer-dev -o "jsonpath={.data['ca\.crt']}"
|
||||
```
|
||||
|
||||
- Create kube config file
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
preferences: {}
|
||||
cluster:
|
||||
certificate-authority-data: PLACE CERTIFICATE HERE
|
||||
server: https://YOUR_KUBERNETES_API_ENDPOINT
|
||||
name: developer-cluster
|
||||
|
||||
users:
|
||||
- name: developer
|
||||
user:
|
||||
as-user-extra: {}
|
||||
client-key-data: PLACE CERTIFICATE HERE
|
||||
token: PLACE USER TOKEN HERE
|
||||
|
||||
contexts:
|
||||
- context:
|
||||
cluster: kubernetes
|
||||
namespace: developer-dev
|
||||
user: developer
|
||||
name: developer-dev
|
||||
|
||||
current-context: developer-dev
|
||||
clusters:
|
||||
- cluster:
|
||||
certificate-authority-data: PLACE CERTIFICATE HERE
|
||||
server: https://YOUR_KUBERNETES_API_ENDPOINT
|
||||
name: developer-cluster
|
||||
|
||||
users:
|
||||
- name: developer
|
||||
user:
|
||||
as-user-extra: {}
|
||||
client-key-data: PLACE CERTIFICATE HERE
|
||||
token: PLACE USER TOKEN HERE
|
||||
|
||||
contexts:
|
||||
- context:
|
||||
cluster: kubernetes
|
||||
namespace: developer-dev
|
||||
user: developer
|
||||
name: developer-dev
|
||||
|
||||
current-context: developer-dev
|
||||
```
|
||||
43
rbac/access.yaml
Normal file
43
rbac/access.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
labels:
|
||||
app: developer-dev
|
||||
name: developer-dev
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: developer
|
||||
namespace: developer-dev
|
||||
|
||||
---
|
||||
kind: Role
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: developer-full-access
|
||||
namespace: developer-dev
|
||||
rules:
|
||||
- apiGroups: ["", "extensions", "apps"]
|
||||
resources: ["*"]
|
||||
verbs: ["*"]
|
||||
- apiGroups: ["batch"]
|
||||
resources:
|
||||
- jobs
|
||||
- cronjobs
|
||||
verbs: ["*"]
|
||||
|
||||
---
|
||||
kind: RoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: developer-view
|
||||
namespace: developer-dev
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: developer
|
||||
namespace: developer-dev
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: developer-full-access
|
||||
4
sc-provider/local-path.md
Normal file
4
sc-provider/local-path.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# Install Local Path
|
||||
```shell
|
||||
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
|
||||
```
|
||||
20
traefik/README.md
Normal file
20
traefik/README.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Traefik Installation
|
||||
```shell
|
||||
kubectl create ns traefik-v2
|
||||
|
||||
helm install --namespace=traefik-v2 \
|
||||
--set="additionalArguments={--log.level=DEBUG}" \
|
||||
traefik traefik/traefik
|
||||
```
|
||||
|
||||
OR
|
||||
|
||||
```shell
|
||||
helm upgrade --install traefik traefik/traefik --create-namespace -n traefik \
|
||||
--set "ports.websecure.tls.enabled=true" \
|
||||
--set "providers.kubernetesIngress.publishedService.enabled=true"
|
||||
```
|
||||
|
||||
```shell
|
||||
kubectl port-forward $(kubectl get pods --namespace traefik-v2 --selector "app.kubernetes.io/name=traefik" --output=name) --namespace traefik-v2 9000:9000
|
||||
```
|
||||
14
traefik/dashboard.yaml
Normal file
14
traefik/dashboard.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
namespace: traefik-v2
|
||||
name: dashboard
|
||||
spec:
|
||||
entryPoints:
|
||||
- web
|
||||
routes:
|
||||
- match: Host(`traefik.ct.host`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
|
||||
kind: Rule
|
||||
services:
|
||||
- name: api@internal
|
||||
kind: TraefikService
|
||||
Reference in New Issue
Block a user