forked from kubernetes-sigs/application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.yaml
193 lines (193 loc) · 4.92 KB
/
example.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: "wordpress-01"
labels:
app.kubernetes.io/name: "wordpress-01"
spec:
type: "wordpress"
selector:
matchLabels:
app.kubernetes.io/name: "wordpress-01"
componentKinds:
- group: core
kind: Service
- group: apps
kind: StatefulSet
version: "4.9.4"
description: "WordPress is open source software you can use to create a beautiful website, blog, or app."
icons:
- src: "https://s.w.org/style/images/about/WordPress-logotype-wmark.png"
type: "image/png"
size: "1000x1000"
- src: "https://s.w.org/style/images/about/WordPress-logotype-standard.png"
type: "image/png"
size: "2000x680"
maintainers:
- name: Kenneth Owens
email: [email protected]
owners:
- name: Kenneth Owens
email: [email protected]
keywords:
- "cms"
- "blog"
- "wordpress"
links:
- description: About
url: "https://wordpress.org/"
- description: Web Server Dashboard
url: "https://metrics/internal/wordpress-01/web-app"
- description: Mysql Dashboard
url: "https://metrics/internal/wordpress-01/mysql"
---
apiVersion: v1
kind: Service
metadata:
name: wordpress-mysql-hsvc
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "mysql-hsvc"
app.kubernetes.io/tier: "backend"
spec:
ports:
- port: 3306
selector:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "mysql-rdbms"
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: wordpress-mysql
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "mysql-rdbms"
app.kubernetes.io/tier: "backend"
spec:
selector:
matchLabels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "mysql-rdbms"
app.kubernetes.io/tier: "backend"
replicas: 1
serviceName: wordpress-mysql-hsvc
template:
metadata:
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "mysql-rdbms"
app.kubernetes.io/tier: "backend"
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumeClaimTemplates:
- metadata:
name: mysql-persistent-storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 250Gi
---
apiVersion: v1
kind: Service
metadata:
name: wordpress-webserver-svc
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "wordpress-svc"
app.kubernetes.io/tier: "frontend"
spec:
ports:
- port: 80
selector:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "wordpress-webserver"
type: LoadBalancer
---
apiVersion: v1
kind: Service
metadata:
name: wordpress-webserver-hsvc
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "wordpress-hsvc"
app.kubernetes.io/tier: "frontend"
spec:
ports:
- port: 3306
selector:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "wordpress-webserver"
clusterIP: None
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: wordpress-webserver
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "wordpress-webserver"
app.kubernetes.io/tier: "frontend"
annotations:
kubernetes.io/application: wordpress
spec:
replicas: 1
serviceName: wordpress-webserver-hsvc
selector:
matchLabels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/component: "wordpress-webserver"
template:
metadata:
labels:
app.kubernetes.io/name: "wordpress-01"
app.kubernetes.io/version: "3"
app.kubernetes.io/component: "wordpress-webserver"
app.kubernetes.io/tier: "frontend"
spec:
containers:
- image: wordpress:4.8-apache
name: wordpress
env:
- name: WORDPRESS_DB_HOST
value: wordpress-mysql-hsvc
- name: WORDPRESS_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-pass
key: password
ports:
- containerPort: 80
name: wordpress
volumeMounts:
- name: wordpress-persistent-storage
mountPath: /var/www/html
volumeClaimTemplates:
- metadata:
name: wordpress-persistent-storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 250Gi