Skip to content

Commit e66d185

Browse files
updates to deploy and secret yaml
1 parent 1dd2779 commit e66d185

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

kubernetes/deployments/deployment.yaml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ metadata:
66
app: example-app
77
annotations:
88
spec:
9+
selector:
10+
matchLabels:
11+
app: example-app
912
replicas: 2
13+
strategy:
14+
type: RollingUpdate
15+
rollingUpdate:
16+
maxSurge: 1
17+
maxUnavailable: 0
1018
template:
1119
metadata:
1220
labels:
@@ -31,10 +39,15 @@ spec:
3139
limits:
3240
memory: "256Mi"
3341
cpu: "500m"
34-
volumeMouts:
35-
- name: config-volume
36-
mountPath: /configs/
37-
volumes:
38-
- name: config-volume
39-
configMap:
40-
name: example-config #name of our configmap object
42+
volumeMounts:
43+
- name: secret-volume
44+
mountPath: /secrets/
45+
- name: config-volume
46+
mountPath: /configs/
47+
volumes:
48+
- name: secret-volume
49+
secret:
50+
secretName: mysecret
51+
- name: config-volume
52+
configMap:
53+
name: example-config #name of our configmap object

kubernetes/secrets/secret.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: mysecret
5+
type: Opaque
6+
stringData:
7+
secret.json: |-
8+
{
9+
"api_key" : "somesecretgoeshere"
10+
}
11+
12+
#kubectl create secret generic mysecret --from-file .\golang\secrets\secret.json

0 commit comments

Comments
 (0)