From ee758ca723c22cec5608281e166086612bacd54c Mon Sep 17 00:00:00 2001 From: Mya Date: Sat, 2 Jul 2022 16:05:51 +0000 Subject: [PATCH] Update 'Deployment' --- Deployment.md | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Deployment.md diff --git a/Deployment.md b/Deployment.md new file mode 100644 index 0000000..593bde2 --- /dev/null +++ b/Deployment.md @@ -0,0 +1,96 @@ +`pages` is written with the [12factor](https://12factor.net) principals. It attempts to use a reasonable set of defaults and should be easy to configure across Docker, Kubernetes, and Nomad. + +## Docker + +TBD + +## Kubernetes + +**Create a secret** + +```shell +kubectl create secret generic pages-secret \ + --from-literal "PAGES_GIT_BRANCH=gh-pages" \ + --from-literal "PAGES_GIT_URL=https://github.com/mjpitz/mjpitz.git" +``` + +**Chart.yaml** + +```yaml +apiVersion: v2 +type: application +name: pages +version: 0.0.0 +appVersion: 0.0.0 +dependencies: + - name: 12factor + repository: https://mjpitz.com + version: 22.5.0 +``` + +**values.yaml** + +```yaml +12factor: + nameOverride: pages + + image: + repository: img.pitz.tech/mya/pages + tag: latest + + deployment: + replicaCount: 2 + + application: + envFrom: + - secretRef: + name: pages-secret + ports: + - name: http + containerPort: 8080 + protocol: TCP + - name: debug + containerPort: 8081 + protocol: TCP + + networking: + service: + ports: + - name: http + targetPort: http + protocol: TCP + port: 8080 + - name: debug + targetPort: debug + protocol: TCP + port: 8081 + + ingress: + enabled: true + annotations: + # certificate + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: "letsencrypt-prod" + # controller + kubernetes.io/ingress.class: nginx + nginx.ingress.kubernetes.io/enable-cors: "true" + nginx.ingress.kubernetes.io/ssl-redirect: "true" + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive,Upgrade" + nginx.ingress.kubernetes.io/configuration-snippet: | + proxy_set_header Upgrade "websocket"; + hosts: + - host: example.com + paths: + - path: / + pathType: Prefix + tls: + - secretName: example-tls + hosts: + - example.com +``` + +## Nomad + +TBD \ No newline at end of file