Skip to content

Instantly share code, notes, and snippets.

@laurivosandi
Last active September 8, 2023 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurivosandi/0a03a89d112bb9e8c9913d1a3a13e144 to your computer and use it in GitHub Desktop.
Save laurivosandi/0a03a89d112bb9e8c9913d1a3a13e144 to your computer and use it in GitHub Desktop.
Deploy cert-manager, MetalLB, MariaDB, CloudNativePG, Prometheus operators
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: operator-deployment
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: operator-deployment
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: operator-deployment
namespace: kube-system
---
apiVersion: batch/v1
kind: Job
metadata:
name: codemowers-deploy-cloudnative-pg-cloudnative-pg
namespace: kube-system
spec:
template:
spec:
containers:
- command:
- bash
- -c
- curl -L -o m0.yaml https://github.com/cloudnative-pg/cloudnative-pg/releases/download/v1.20.2/cnpg-1.20.2.yaml;
kubectl apply --namespace cnpg-system -f m0.yaml
image: alpine/k8s:1.27.3
imagePullPolicy: IfNotPresent
name: codemowers-deploy-cloudnative-pg-cloudnative-pg
volumeMounts:
- mountPath: /tmp
name: tmp
workingDir: /tmp
restartPolicy: OnFailure
serviceAccountName: operator-deployment
volumes:
- emptyDir:
medium: Memory
sizeLimit: 10Mi
name: tmp
---
apiVersion: batch/v1
kind: Job
metadata:
name: codemowers-deploy-jetstack-cert-manager
namespace: kube-system
spec:
template:
spec:
containers:
- command:
- bash
- -c
- curl -L -o m0.yaml https://github.com/cert-manager/cert-manager/releases/download/v1.12.3/cert-manager.yaml;
kubectl apply -f m0.yaml
image: alpine/k8s:1.27.3
imagePullPolicy: IfNotPresent
name: codemowers-deploy-jetstack-cert-manager
volumeMounts:
- mountPath: /tmp
name: tmp
workingDir: /tmp
restartPolicy: OnFailure
serviceAccountName: operator-deployment
volumes:
- emptyDir:
medium: Memory
sizeLimit: 10Mi
name: tmp
---
apiVersion: batch/v1
kind: Job
metadata:
name: codemowers-deploy-mariadb-operator-mariadb-operator
namespace: kube-system
spec:
template:
spec:
containers:
- command:
- bash
- -c
- 'kubectl create namespace mariadb-operator; curl -L -o m0.yaml https://github.com/mariadb-operator/mariadb-operator/releases/download/v0.0.19/manifests.yaml;
sed -i -e ''s/mariadb-operator-webhook.default.svc/mariadb-operator-webhook.mariadb-operator.svc/g''
-e ''s/default\/mariadb-operator-webhook-cert/mariadb-operator\/mariadb-operator-webhook-cert/g''
-e ''s/namespace: default/namespace: mariadb-operator/g'' m0.yaml; kubectl
apply --namespace mariadb-operator --server-side -f m0.yaml'
image: alpine/k8s:1.27.3
imagePullPolicy: IfNotPresent
name: codemowers-deploy-mariadb-operator-mariadb-operator
volumeMounts:
- mountPath: /tmp
name: tmp
workingDir: /tmp
restartPolicy: OnFailure
serviceAccountName: operator-deployment
volumes:
- emptyDir:
medium: Memory
sizeLimit: 10Mi
name: tmp
---
apiVersion: batch/v1
kind: Job
metadata:
name: codemowers-deploy-metallb-metallb-operator
namespace: kube-system
spec:
template:
spec:
containers:
- command:
- bash
- -c
- curl -L -o m0.yaml https://raw.githubusercontent.com/metallb/metallb-operator/v0.13.11/bin/metallb-operator.yaml;
kubectl apply --namespace metallb-system -f m0.yaml
image: alpine/k8s:1.27.3
imagePullPolicy: IfNotPresent
name: codemowers-deploy-metallb-metallb-operator
volumeMounts:
- mountPath: /tmp
name: tmp
workingDir: /tmp
restartPolicy: OnFailure
serviceAccountName: operator-deployment
volumes:
- emptyDir:
medium: Memory
sizeLimit: 10Mi
name: tmp
---
apiVersion: batch/v1
kind: Job
metadata:
name: codemowers-deploy-prometheus-operator-prometheus-operator
namespace: kube-system
spec:
template:
spec:
containers:
- command:
- bash
- -c
- 'kubectl create namespace prometheus-operator; curl -L -o m0.yaml https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.67.1/bundle.yaml;
sed -i -e ''s/namespace: default/namespace: prometheus-operator/g'' m0.yaml;
kubectl apply --namespace prometheus-operator --server-side -f m0.yaml'
image: alpine/k8s:1.27.3
imagePullPolicy: IfNotPresent
name: codemowers-deploy-prometheus-operator-prometheus-operator
volumeMounts:
- mountPath: /tmp
name: tmp
workingDir: /tmp
restartPolicy: OnFailure
serviceAccountName: operator-deployment
volumes:
- emptyDir:
medium: Memory
sizeLimit: 10Mi
name: tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment