From e66d1854444a3272f9ccec1b650f116547449e89 Mon Sep 17 00:00:00 2001 From: marcel-dempers Date: Sun, 15 Sep 2019 13:09:45 +1000 Subject: [PATCH] updates to deploy and secret yaml --- kubernetes/deployments/deployment.yaml | 27 +++++++++++++++++++------- kubernetes/secrets/secret.yaml | 12 ++++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 kubernetes/secrets/secret.yaml diff --git a/kubernetes/deployments/deployment.yaml b/kubernetes/deployments/deployment.yaml index e1aac4f16..adfc3ca1a 100644 --- a/kubernetes/deployments/deployment.yaml +++ b/kubernetes/deployments/deployment.yaml @@ -6,7 +6,15 @@ metadata: app: example-app annotations: spec: + selector: + matchLabels: + app: example-app replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 template: metadata: labels: @@ -31,10 +39,15 @@ spec: limits: memory: "256Mi" cpu: "500m" - volumeMouts: - - name: config-volume - mountPath: /configs/ - volumes: - - name: config-volume - configMap: - name: example-config #name of our configmap object + volumeMounts: + - name: secret-volume + mountPath: /secrets/ + - name: config-volume + mountPath: /configs/ + volumes: + - name: secret-volume + secret: + secretName: mysecret + - name: config-volume + configMap: + name: example-config #name of our configmap object \ No newline at end of file diff --git a/kubernetes/secrets/secret.yaml b/kubernetes/secrets/secret.yaml new file mode 100644 index 000000000..568a25147 --- /dev/null +++ b/kubernetes/secrets/secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +metadata: + name: mysecret +type: Opaque +stringData: + secret.json: |- + { + "api_key" : "somesecretgoeshere" + } + +#kubectl create secret generic mysecret --from-file .\golang\secrets\secret.json \ No newline at end of file