Skip to content

Instantly share code, notes, and snippets.

@ualmtorres
Created May 14, 2020 08:15
Show Gist options
  • Save ualmtorres/2766e2d7227ea906dabbb5ab35c20045 to your computer and use it in GitHub Desktop.
Save ualmtorres/2766e2d7227ea906dabbb5ab35c20045 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
namespace: demo
spec:
selector:
matchLabels:
app: mysql
template:
metadata:
labels:
app: mysql
spec:
containers:
- name: mysql
image: mysql:5.7
env:
# Use secret in real usage
- name: MYSQL_ROOT_PASSWORD
value: secret
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: workdir
mountPath: /docker-entrypoint-initdb.d
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 250m
memory: 256Mi
initContainers:
- name: install
image: busybox
command:
- wget
- "-O"
- "/work-dir/init.sql"
- https://gist.githubusercontent.com/ualmtorres/eb328b653fcc5964f976b22c320dc10f/raw/448b00c44d7102d66077a393dad555585862f923/init.sql
volumeMounts:
- name: workdir
mountPath: "/work-dir"
dnsPolicy: Default
volumes:
- name: workdir
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment