forked from markramach/ansible-kubernetes-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes-app-wordpress.yml
62 lines (61 loc) · 1.62 KB
/
kubernetes-app-wordpress.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
- hosts: master
tasks:
- name: Create Wordpress Replication Controller.
kubernetes:
endpoint: "{{ apiserver_endpoint }}"
state: present
model:
apiVersion: v1
kind: ReplicationController
metadata:
name: "wordpress-rc"
namespace: default
spec:
replicas: 1
imagePullPolicy: IfNotPresent
selector:
app: "wordpress"
template:
metadata:
labels:
app: "wordpress"
spec:
containers:
- name: "mariadb"
image: mariadb:5
env:
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
- name: "wordpress"
image: wordpress
env:
- name: WORDPRESS_DB_HOST
value: 127.0.0.1
- name: WORDPRESS_DB_PASSWORD
value: password
ports:
- containerPort: 80
restartPolicy: Always
- name: Create Wordpress Service
kubernetes:
endpoint: "{{ apiserver_endpoint }}"
state: present
model:
apiVersion: v1
kind: Service
metadata:
name: "wordpress-svc"
namespace: default
labels:
app: "wordpress"
spec:
type: NodePort
ports:
- port: 8080
targetPort: 80
protocol: TCP
nodePort: 30080
selector:
app: "wordpress"