Skip to content

Instantly share code, notes, and snippets.

@alex-moreno
Created April 28, 2020 09:52
Show Gist options
  • Save alex-moreno/b7db170f26e1a11c947bbeee84839c0f to your computer and use it in GitHub Desktop.
Save alex-moreno/b7db170f26e1a11c947bbeee84839c0f to your computer and use it in GitHub Desktop.
pod-mariadb.yaml
apiVersion: v1
kind: Service
metadata:
name: mysqlservice
spec:
ports:
- port: 3306
selector:
app: ddevdb
clusterIP: None
---
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: ddevdb
spec:
selector:
matchLabels:
app: ddevdb
# tells deployment to run 1 pods matching the template
replicas: 1
template:
metadata:
labels:
app: ddevdb
spec:
containers:
- name: ddevdb
image: mariadb:10.4
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- mountPath: "/var/lib/mysql"
name: db-storage
env:
- name: MYSQL_ROOT_PASSWORD
value: root
- name: MYSQL_DATABASE
value: drupal
volumes:
- name: db-storage
persistentVolumeClaim:
claimName: db-storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: adminer
labels:
app: adminer
spec:
selector:
matchLabels:
app: adminer
template:
metadata:
labels:
app: adminer
spec:
containers:
- name: adminer
image: adminer:4.7.0
ports:
- containerPort: 8080
env:
- name: ADMINER_DESIGN
value: "pappu687"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment