Skip to content

Instantly share code, notes, and snippets.

@tuxerrante
Last active April 24, 2022 10:34
Show Gist options
  • Save tuxerrante/8dcc7c4867e8792a55a996c4c269ea17 to your computer and use it in GitHub Desktop.
Save tuxerrante/8dcc7c4867e8792a55a996c4c269ea17 to your computer and use it in GitHub Desktop.
# kubectl create secret -n prod generic prod-db --from-literal=db-user=root --from-literal=db-psw=paswrd --from-literal=db-host=prod-db --from-literal=app-color=red
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "2"
labels:
name: prod-web
name: prod-web
namespace: prod
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
name: prod-web
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
name: prod-web
name: dev-web
spec:
containers:
- env:
- name: DB_Host
valueFrom:
secretKeyRef:
key: db-host
name: prod-db
- name: DB_User
valueFrom:
secretKeyRef:
key: db-user
name: prod-db
- name: DB_Password
valueFrom:
secretKeyRef:
key: db-psw
name: prod-db
- name: APP_COLOR
valueFrom:
secretKeyRef:
key: app-color
name: prod-db
image: mmumshad/simple-webapp-mysql
imagePullPolicy: Always
name: webapp-mysql
ports:
- containerPort: 8080
protocol: TCP
resources: {}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
readOnlyRootFilesystem: true
runAsUser: 10001
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment