From 1cf7e94f43c0418deded1afbfa32d32020cecdbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 26 Dec 2018 02:08:33 +0100 Subject: [PATCH] removed Kubernetes manifests as Helm chart will be ready soon - just wait for #35c3 ;-) --- kubernetes/00_namespace.yaml | 4 - kubernetes/10_pvc.yaml | 55 --------- kubernetes/30_configmap_nginx.yaml | 59 ---------- kubernetes/40_deployment_zammad.yaml | 112 ------------------- kubernetes/42_deployment_memcached.yaml | 34 ------ kubernetes/43_deployment_postgesql.yaml | 40 ------- kubernetes/50_statefulset_elasticsearch.yaml | 53 --------- kubernetes/60_cronjob_backup.yaml | 23 ---- kubernetes/80_svc.yaml | 71 ------------ kubernetes/90_ingress.yaml | 26 ----- kubernetes/Readme.md | 43 ------- 11 files changed, 520 deletions(-) delete mode 100644 kubernetes/00_namespace.yaml delete mode 100644 kubernetes/10_pvc.yaml delete mode 100644 kubernetes/30_configmap_nginx.yaml delete mode 100644 kubernetes/40_deployment_zammad.yaml delete mode 100644 kubernetes/42_deployment_memcached.yaml delete mode 100644 kubernetes/43_deployment_postgesql.yaml delete mode 100644 kubernetes/50_statefulset_elasticsearch.yaml delete mode 100644 kubernetes/60_cronjob_backup.yaml delete mode 100644 kubernetes/80_svc.yaml delete mode 100644 kubernetes/90_ingress.yaml delete mode 100644 kubernetes/Readme.md diff --git a/kubernetes/00_namespace.yaml b/kubernetes/00_namespace.yaml deleted file mode 100644 index dfe25d6..0000000 --- a/kubernetes/00_namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: zammad \ No newline at end of file diff --git a/kubernetes/10_pvc.yaml b/kubernetes/10_pvc.yaml deleted file mode 100644 index 6f28253..0000000 --- a/kubernetes/10_pvc.yaml +++ /dev/null @@ -1,55 +0,0 @@ ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: zammad - namespace: zammad -spec: - storageClassName: standard - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10G - ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: zammad-backup - namespace: zammad -spec: - storageClassName: standard - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10G - ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: zammad-elasticsearch - namespace: zammad -spec: - storageClassName: standard - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10G - ---- -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: zammad-postgresql - namespace: zammad -spec: - storageClassName: standard - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10G diff --git a/kubernetes/30_configmap_nginx.yaml b/kubernetes/30_configmap_nginx.yaml deleted file mode 100644 index 0712910..0000000 --- a/kubernetes/30_configmap_nginx.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: nginx-configmap - namespace: zammad -data: - config: |- - # - # kubernetes nginx config for zammad - # - - server_tokens off; - - upstream zammad-railsserver { - server localhost:3000; - } - - upstream zammad-websocket { - server localhost:6042; - } - - server { - listen 80; - - server_name _; - - root /opt/zammad/public; - - access_log /dev/stdout; - error_log /dev/stderr; - - client_max_body_size 50M; - - location ~ ^/(assets/|robots.txt|humans.txt|favicon.ico) { - expires max; - } - - location /ws { - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "Upgrade"; - proxy_set_header CLIENT_IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 86400; - proxy_pass http://zammad-websocket; - } - - location / { - proxy_set_header Host $http_host; - proxy_set_header CLIENT_IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_read_timeout 180; - proxy_pass http://zammad-railsserver; - - gzip on; - gzip_types text/plain text/xml text/css image/svg+xml application/javascript application/x-javascript application/json application/xml; - gzip_proxied any; - } - } diff --git a/kubernetes/40_deployment_zammad.yaml b/kubernetes/40_deployment_zammad.yaml deleted file mode 100644 index 9d07b3d..0000000 --- a/kubernetes/40_deployment_zammad.yaml +++ /dev/null @@ -1,112 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: zammad - namespace: zammad -spec: - replicas: 1 - revisionHistoryLimit: 1 - template: - metadata: - labels: - app: zammad - component: services - spec: - terminationGracePeriodSeconds: 10 - volumes: - - name: zammad - persistentVolumeClaim: - claimName: zammad - - name: nginx-configmap - configMap: - name: nginx-configmap - items: - - key: config - path: default - - initContainers: - - name: zammad-init - image: zammad/zammad-docker-compose:zammad - args: [ "zammad-init" ] - imagePullPolicy: Always - volumeMounts: - - name: zammad - mountPath: /opt/zammad - - containers: - - name: zammad-nginx - image: zammad/zammad-docker-compose:zammad - args: [ "zammad-nginx" ] - ports: - - containerPort: 80 - name: nginx - imagePullPolicy: Always - volumeMounts: - - name: zammad - mountPath: /opt/zammad - - name: nginx-configmap - mountPath: /etc/nginx/sites-enabled - readinessProbe: - httpGet: - path: / - port: 80 - initialDelaySeconds: 60 - periodSeconds: 10 - livenessProbe: - httpGet: - path: / - port: 80 - initialDelaySeconds: 60 - periodSeconds: 10 - - - name: zammad-railsserver - image: zammad/zammad-docker-compose:zammad - args: ["zammad-railsserver"] - imagePullPolicy: Always - ports: - - name: railsserver - containerPort: 3000 - volumeMounts: - - name: zammad - mountPath: /opt/zammad - readinessProbe: - httpGet: - path: / - port: 3000 - initialDelaySeconds: 90 - periodSeconds: 10 - livenessProbe: - httpGet: - path: / - port: 3000 - initialDelaySeconds: 90 - periodSeconds: 10 - - - name: zammad-scheduler - image: zammad/zammad-docker-compose:zammad - args: [ "zammad-scheduler" ] - imagePullPolicy: Always - volumeMounts: - - name: zammad - mountPath: /opt/zammad - - - name: zammad-websocket - image: zammad/zammad-docker-compose:zammad - args: [ "zammad-websocket" ] - imagePullPolicy: Always - ports: - - name: websocket - containerPort: 6042 - volumeMounts: - - name: zammad - mountPath: /opt/zammad - readinessProbe: - tcpSocket: - port: 6042 - initialDelaySeconds: 60 - periodSeconds: 10 - livenessProbe: - tcpSocket: - port: 6042 - initialDelaySeconds: 60 - periodSeconds: 10 diff --git a/kubernetes/42_deployment_memcached.yaml b/kubernetes/42_deployment_memcached.yaml deleted file mode 100644 index 5e9593e..0000000 --- a/kubernetes/42_deployment_memcached.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: zammad-memcached - namespace: zammad -spec: - replicas: 1 - revisionHistoryLimit: 1 - template: - metadata: - labels: - app: memcached - component: cache - spec: - terminationGracePeriodSeconds: 10 - - containers: - - name: zammad-memcached - image: zammad/zammad-docker-compose:zammad-memcached - args: [ "zammad-memcached" ] - ports: - - containerPort: 11211 - name: memcached - imagePullPolicy: Always - readinessProbe: - tcpSocket: - port: 11211 - initialDelaySeconds: 20 - periodSeconds: 10 - livenessProbe: - tcpSocket: - port: 11211 - initialDelaySeconds: 10 - periodSeconds: 10 diff --git a/kubernetes/43_deployment_postgesql.yaml b/kubernetes/43_deployment_postgesql.yaml deleted file mode 100644 index f76c3f4..0000000 --- a/kubernetes/43_deployment_postgesql.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: apps/v1beta1 -kind: Deployment -metadata: - name: zammad-postgresql - namespace: zammad -spec: - replicas: 1 - revisionHistoryLimit: 1 - template: - metadata: - labels: - component: database - app: postgresql - spec: - terminationGracePeriodSeconds: 10 - volumes: - - name: zammad-postgresql - persistentVolumeClaim: - claimName: zammad-postgresql - - containers: - - name: zammad-postgresql - image: zammad/zammad-docker-compose:zammad-postgresql - ports: - - name: postgresql - containerPort: 5432 - imagePullPolicy: Always - volumeMounts: - - name: zammad-postgresql - mountPath: /var/lib/postgresql - readinessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 60 - periodSeconds: 10 - livenessProbe: - tcpSocket: - port: 5432 - initialDelaySeconds: 60 - periodSeconds: 10 diff --git a/kubernetes/50_statefulset_elasticsearch.yaml b/kubernetes/50_statefulset_elasticsearch.yaml deleted file mode 100644 index 3fa85c9..0000000 --- a/kubernetes/50_statefulset_elasticsearch.yaml +++ /dev/null @@ -1,53 +0,0 @@ -apiVersion: apps/v1beta1 -kind: StatefulSet -metadata: - name: zammad-elasticsearch - namespace: zammad - labels: - app: elasticsearch - component: searchindex -spec: - serviceName: zammad-elasticsearch - replicas: 1 - template: - metadata: - labels: - component: searchindex - app: elasticsearch - spec: - terminationGracePeriodSeconds: 10 - volumes: - - name: zammad-elasticsearch - persistentVolumeClaim: - claimName: zammad-elasticsearch - initContainers: - - name: prepare-container - image: busybox - command: [ "sh", "-c", "sysctl -w vm.max_map_count=262144; chown -R 1000:1000 /usr/share/elasticsearch"] - securityContext: - privileged: true - volumeMounts: - - mountPath: /usr/share/elasticsearch/data - name: zammad-elasticsearch - containers: - - name: zammad-elasticsearch - image: zammad/zammad-docker-compose:zammad-elasticsearch - ports: - - containerPort: 9200 - name: elasticsearch - imagePullPolicy: Always - volumeMounts: - - mountPath: /usr/share/elasticsearch/data - name: zammad-elasticsearch - readinessProbe: - httpGet: - path: /_cluster/health?local=true - port: 9200 - initialDelaySeconds: 60 - periodSeconds: 10 - livenessProbe: - httpGet: - path: /_cluster/health?local=true - port: 9200 - initialDelaySeconds: 60 - periodSeconds: 10 diff --git a/kubernetes/60_cronjob_backup.yaml b/kubernetes/60_cronjob_backup.yaml deleted file mode 100644 index 6bbbf09..0000000 --- a/kubernetes/60_cronjob_backup.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: batch/v1beta1 -kind: CronJob -metadata: - name: backup - namespace: zammad -spec: - schedule: "0 0 * * *" - jobTemplate: - spec: - template: - spec: - restartPolicy: OnFailure - volumes: - - name: zammad-backup - persistentVolumeClaim: - claimName: zammad-backup - containers: - - name: zammad-backup - image: zammad/zammad-docker-compose:zammad-postgresql - args: [ "zammad-backup-db" ] - volumeMounts: - - name: zammad-backup - mountPath: /var/tmp/zammad diff --git a/kubernetes/80_svc.yaml b/kubernetes/80_svc.yaml deleted file mode 100644 index c408bd4..0000000 --- a/kubernetes/80_svc.yaml +++ /dev/null @@ -1,71 +0,0 @@ ---- -kind: Service -apiVersion: v1 -metadata: - name: zammad - namespace: zammad - labels: - app: zammad - component: services -spec: - ports: - - name: nginx - port: 80 - selector: - app: zammad - component: services - type: NodePort - ---- -kind: Service -apiVersion: v1 -metadata: - name: zammad-elasticsearch - namespace: zammad - labels: - app: elasticsearch - component: searchindex -spec: - ports: - - name: elasticsearch - port: 9200 - selector: - app: elasticsearch - component: searchindex - type: NodePort - ---- -kind: Service -apiVersion: v1 -metadata: - name: zammad-memcached - namespace: zammad - labels: - app: memcached - component: cache -spec: - ports: - - name: memcached - port: 11211 - selector: - app: memcached - component: cache - type: NodePort - ---- -kind: Service -apiVersion: v1 -metadata: - name: zammad-postgresql - namespace: zammad - labels: - app: postgresql - component: database -spec: - ports: - - name: postgresql - port: 5432 - selector: - app: postgresql - component: database - type: NodePort diff --git a/kubernetes/90_ingress.yaml b/kubernetes/90_ingress.yaml deleted file mode 100644 index 9dfd60b..0000000 --- a/kubernetes/90_ingress.yaml +++ /dev/null @@ -1,26 +0,0 @@ -kind: Ingress -apiVersion: extensions/v1beta1 -metadata: - name: zammad.example.com - namespace: zammad - labels: - app: zammad - component: services - host: zammad.example.com - annotations: - ingress.kubernetes.io/ssl-redirect: 'true' - kubernetes.io/tls-acme: 'true' - ingress.kubernetes.io/proxy-body-size: 50m -spec: - tls: - - hosts: - - zammad.example.com - secretName: zammad-example-com-tls - rules: - - host: zammad.example.com - http: - paths: - - path: / - backend: - serviceName: zammad - servicePort: 80 diff --git a/kubernetes/Readme.md b/kubernetes/Readme.md deleted file mode 100644 index 5d30de7..0000000 --- a/kubernetes/Readme.md +++ /dev/null @@ -1,43 +0,0 @@ -# Zammad kubernetes example deployment - -This is a proof of concept of a Kubernetes deployment, which should be considered -beta and not ready for production. - -## Prerequisites - -- Kubernetes 1.8.x Cluster with at least 1 worker node, 2 CPUs and 6 GB of RAM -- Change the ingress to your needs - - -## Deploy Zammad - -### Install on Minikube - -* Install kubectl - * https://kubernetes.io/docs/tasks/tools/install-kubectl/ -* Install Minkube - * https://github.com/kubernetes/minikube -* minikube start --memory=6144 --cpus=2 -* minikube addons enable ingress -* echo "$(minikube ip) zammad.example.com" | sudo tee -a /etc/hosts -* kubectl apply -f . -* minikube dashboard - * switch to namespace "zammad" - * open "Overview" and wait until all pods are green -* access zammad on: - * http://zammad.example.com - - -### Install on Google Kubernetes Engine -* connect to cluster via gcloud command -* kubectl proxy -* kubectl apply -f . -* open dashboard in browser - * http://127.0.0.1:8001/ui -* if everything is green add backends / ingress rules to create external endpoint - - -## If you want to help to improve the Kuberntes deployments here are some todos: -* add cpu & mem limits -* add rolling upgrade strategy to deployments -* add RBAC