Skip to content

Instantly share code, notes, and snippets.

@aisrael
Last active May 22, 2019 08:14
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 aisrael/2e498bd1a6a6a3c3276547d719d9a6d8 to your computer and use it in GitHub Desktop.
Save aisrael/2e498bd1a6a6a3c3276547d719d9a6d8 to your computer and use it in GitHub Desktop.
wordpress Kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wordpress-deployment
spec:
replicas: 2
selector:
matchLabels:
app: wordpress
template:
metadata:
labels:
app: wordpress
spec:
containers:
- name: wordpress
image: wordpress:5.2.0-php7.1
env:
- name: WORDPRESS_DB_HOST
value: mariadb
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mariadb-secrets
key: mysql-root-password
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: wordpress
spec:
type: NodePort
ports:
- port: 80 # the port that this service will serve on
targetPort: 80 # should match containerPort
nodePort: 30080
selector:
app: wordpress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment