Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: site1-disk
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: site1-deployment
labels:
app: site1
spec:
replicas: 1
selector:
matchLabels:
app: site1
template:
metadata:
labels:
app: site1
spec:
containers:
- name: app1
image: wordpress:5.2
ports:
- containerPort: 80
volumeMounts:
- mountPath: "/var/www/wp-content"
name: wpcontent
env:
- name: WORDPRESS_DB_HOST
value: db1-service
- name: WORDPRESS_DB_USER
value: root
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: db1-secrets
key: SITE1_USER_PASSWORD
volumes:
- name: wpcontent
persistentVolumeClaim:
claimName: site1-disk
---
apiVersion: v1
kind: Service
metadata:
name: site1-service
spec:
type: LoadBalancer
selector:
app: site1
ports:
- protocol: TCP
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment