Created
May 14, 2020 08:15
-
-
Save ualmtorres/2766e2d7227ea906dabbb5ab35c20045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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