Created
August 10, 2018 12:21
-
-
Save RahulMahale/48ece8eb5f6c0c82816871d39fa6d929 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: mysql | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: mysql | |
template: | |
metadata: | |
labels: | |
app: mysql | |
spec: | |
containers: | |
- name: mysql | |
image: mysql:latest | |
imagePullPolicy: IfNotPresent # if exists, will not pull new image | |
env: | |
- name: MYSQL_ROOT_PASSWORD | |
value: "mysql" | |
ports: | |
- containerPort: 3306 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mysql | |
spec: | |
selector: | |
app: mysql | |
ports: | |
- name: http | |
port: 3306 | |
protocol: TCP | |
targetPort: 3306 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: wordpress | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: wordpress | |
template: | |
metadata: | |
labels: | |
app: wordpress | |
spec: | |
containers: | |
- name: wordpress | |
image: wordpress:latest | |
imagePullPolicy: IfNotPresent # if exists, will not pull new image | |
env: | |
- name: WORDPRESS_DB_HOST | |
value: "mysql:3306" | |
- name: WORDPRESS_DB_USER | |
value: "root" | |
- name: WORDPRESS_DB_PASSWORD | |
value: "mysql" | |
ports: | |
- containerPort: 80 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: wordpress | |
spec: | |
selector: | |
app: wordpress | |
ports: | |
- name: http | |
port: 80 | |
protocol: TCP | |
targetPort: 80 | |
type: NodePort | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment