Skip to content

Instantly share code, notes, and snippets.

@alex-moreno
Created April 28, 2020 09:42
Show Gist options
  • Save alex-moreno/73962c3dd538fdcb754950286005cb81 to your computer and use it in GitHub Desktop.
Save alex-moreno/73962c3dd538fdcb754950286005cb81 to your computer and use it in GitHub Desktop.
Deploying your DDEV containers in digitalocean
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: webserver-storage
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: do-block-storage
apiVersion: v1
kind: Service
metadata:
name: ddev-load-balancer
spec:
type: LoadBalancer
selector:
# Will deliver external traffic to the pod holding each of our containers
app: ddev
ports:
- protocol: TCP
port: 80
targetPort: 80
name: http
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: ddev-wb
spec:
selector:
matchLabels:
app: ddev
replicas: 1 # tells deployment to run 1 pods matching the template
template:
metadata:
labels:
app: ddev
spec:
containers:
- name: ddev
image: drud/ddev-webserver:v1.5.0
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/var/www/html/"
name: wb-volume
subPath: "web"
# We'll need some things in the root folder, like vendor folder.
- mountPath: "/var/www/"
name: wb-volume
volumes:
- name: wb-volume
persistentVolumeClaim:
claimName: webserver-storage
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