Skip to content

Instantly share code, notes, and snippets.

@serainville
Last active May 22, 2019 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save serainville/eb263099307e2f49d3ec20ce60c5dd25 to your computer and use it in GitHub Desktop.
Save serainville/eb263099307e2f49d3ec20ce60c5dd25 to your computer and use it in GitHub Desktop.
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