Skip to content

Instantly share code, notes, and snippets.

@viveksonar
Created May 25, 2020 11:19
Show Gist options
  • Save viveksonar/3be396a72d24b600967c2398b011514c to your computer and use it in GitHub Desktop.
Save viveksonar/3be396a72d24b600967c2398b011514c to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: mysql
spec:
replicas: 1
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-volumeclaim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment