File tree 8 files changed +317
-0
lines changed
8 files changed +317
-0
lines changed Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : ConfigMap
3
+ metadata :
4
+ name : myconfigmap
5
+ data :
6
+ db_server : " db.example.com"
7
+ database : " mydatabase"
8
+ site.settings : |
9
+ color=blue
10
+ padding:25px
11
+ ---
12
+ apiVersion : v1
13
+ kind : Pod
14
+ metadata :
15
+ name : configmappod
16
+ spec :
17
+ containers :
18
+ - name : configmapcontainer
19
+ image : nginx
20
+ env :
21
+ - name : DB_SERVER
22
+ valueFrom :
23
+ configMapKeyRef :
24
+ name : myconfigmap
25
+ key : db_server
26
+ - name : DATABASE
27
+ valueFrom :
28
+ configMapKeyRef :
29
+ name : myconfigmap
30
+ key : database
31
+ volumeMounts :
32
+ - name : config-vol
33
+ mountPath : " /config"
34
+ readOnly : true
35
+ volumes :
36
+ - name : config-vol
37
+ configMap :
38
+ name : myconfigmap
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : DaemonSet
3
+ metadata :
4
+ name : logdaemonset
5
+ labels :
6
+ app : fluentd-logging
7
+ spec :
8
+ selector :
9
+ matchLabels :
10
+ name : fluentd-elasticsearch
11
+ template :
12
+ metadata :
13
+ labels :
14
+ name : fluentd-elasticsearch
15
+ spec :
16
+ tolerations :
17
+ # this toleration is to have the daemonset runnable on master nodes
18
+ # remove it if your masters can't run pods
19
+ - key : node-role.kubernetes.io/master
20
+ effect : NoSchedule
21
+ containers :
22
+ - name : fluentd-elasticsearch
23
+ image : quay.io/fluentd_elasticsearch/fluentd:v2.5.2
24
+ resources :
25
+ limits :
26
+ memory : 200Mi
27
+ requests :
28
+ cpu : 100m
29
+ memory : 200Mi
30
+ volumeMounts :
31
+ - name : varlog
32
+ mountPath : /var/log
33
+ - name : varlibdockercontainers
34
+ mountPath : /var/lib/docker/containers
35
+ readOnly : true
36
+ terminationGracePeriodSeconds : 30
37
+ volumes :
38
+ - name : varlog
39
+ hostPath :
40
+ path : /var/log
41
+ - name : varlibdockercontainers
42
+ hostPath :
43
+ path : /var/lib/docker/containers
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : firstdeployment
5
+ labels :
6
+ team : development
7
+ spec :
8
+ replicas : 3
9
+ selector :
10
+ matchLabels :
11
+ app : frontend
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : frontend
16
+ spec :
17
+ containers :
18
+ - name : nginx
19
+ image : nginx:latest
20
+ ports :
21
+ - containerPort : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : rcdeployment
5
+ labels :
6
+ team : development
7
+ spec :
8
+ replicas : 5
9
+ selector :
10
+ matchLabels :
11
+ app : recreate
12
+ strategy :
13
+ type : Recreate
14
+ template :
15
+ metadata :
16
+ labels :
17
+ app : recreate
18
+ spec :
19
+ containers :
20
+ - name : nginx
21
+ image : nginx
22
+ ports :
23
+ - containerPort : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : rolldeployment
5
+ labels :
6
+ team : development
7
+ spec :
8
+ replicas : 10
9
+ selector :
10
+ matchLabels :
11
+ app : rolling
12
+ strategy :
13
+ type : RollingUpdate
14
+ rollingUpdate :
15
+ maxUnavailable : 2
16
+ maxSurge : 2
17
+ template :
18
+ metadata :
19
+ labels :
20
+ app : rolling
21
+ spec :
22
+ containers :
23
+ - name : nginx
24
+ image : nginx
25
+ ports :
26
+ - containerPort : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : networking.k8s.io/v1
2
+ kind : Ingress
3
+ metadata :
4
+ name : appingress
5
+ annotations :
6
+ nginx.ingress.kubernetes.io/rewrite-target : /$1
7
+ spec :
8
+ rules :
9
+ - host : webapp.com
10
+ http :
11
+ paths :
12
+ - path : /blue
13
+ pathType : Prefix
14
+ backend :
15
+ service :
16
+ name : bluesvc
17
+ port :
18
+ number : 80
19
+ - path : /green
20
+ pathType : Prefix
21
+ backend :
22
+ service :
23
+ name : greensvc
24
+ port :
25
+ number : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : blueapp
5
+ labels :
6
+ app : blue
7
+ spec :
8
+ replicas : 2
9
+ selector :
10
+ matchLabels :
11
+ app : blue
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : blue
16
+ spec :
17
+ containers :
18
+ - name : blueapp
19
+ image : ozgurozturknet/k8s:blue
20
+ ports :
21
+ - containerPort : 80
22
+ livenessProbe :
23
+ httpGet :
24
+ path : /healthcheck
25
+ port : 80
26
+ initialDelaySeconds : 5
27
+ periodSeconds : 5
28
+ readinessProbe :
29
+ httpGet :
30
+ path : /ready
31
+ port : 80
32
+ initialDelaySeconds : 5
33
+ periodSeconds : 3
34
+ ---
35
+ apiVersion : v1
36
+ kind : Service
37
+ metadata :
38
+ name : bluesvc
39
+ spec :
40
+ selector :
41
+ app : blue
42
+ ports :
43
+ - protocol : TCP
44
+ port : 80
45
+ targetPort : 80
46
+ ---
47
+ apiVersion : apps/v1
48
+ kind : Deployment
49
+ metadata :
50
+ name : greenapp
51
+ labels :
52
+ app : green
53
+ spec :
54
+ replicas : 2
55
+ selector :
56
+ matchLabels :
57
+ app : green
58
+ template :
59
+ metadata :
60
+ labels :
61
+ app : green
62
+ spec :
63
+ containers :
64
+ - name : greenapp
65
+ image : ozgurozturknet/k8s:green
66
+ ports :
67
+ - containerPort : 80
68
+ livenessProbe :
69
+ httpGet :
70
+ path : /healthcheck
71
+ port : 80
72
+ initialDelaySeconds : 5
73
+ periodSeconds : 5
74
+ readinessProbe :
75
+ httpGet :
76
+ path : /ready
77
+ port : 80
78
+ initialDelaySeconds : 5
79
+ periodSeconds : 3
80
+ ---
81
+ apiVersion : v1
82
+ kind : Service
83
+ metadata :
84
+ name : greensvc
85
+ spec :
86
+ selector :
87
+ app : green
88
+ ports :
89
+ - protocol : TCP
90
+ port : 80
91
+ targetPort : 80
92
+ ---
93
+ apiVersion : apps/v1
94
+ kind : Deployment
95
+ metadata :
96
+ name : todoapp
97
+ labels :
98
+ app : todo
99
+ spec :
100
+ replicas : 1
101
+ selector :
102
+ matchLabels :
103
+ app : todo
104
+ template :
105
+ metadata :
106
+ labels :
107
+ app : todo
108
+ spec :
109
+ containers :
110
+ - name : todoapp
111
+ image : ozgurozturknet/samplewebapp:latest
112
+ ports :
113
+ - containerPort : 80
114
+ ---
115
+ apiVersion : v1
116
+ kind : Service
117
+ metadata :
118
+ name : todosvc
119
+ spec :
120
+ selector :
121
+ app : todo
122
+ ports :
123
+ - protocol : TCP
124
+ port : 80
125
+ targetPort : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : networking.k8s.io/v1
2
+ kind : Ingress
3
+ metadata :
4
+ name : todoingress
5
+ spec :
6
+ rules :
7
+ - host : todoapp.com
8
+ http :
9
+ paths :
10
+ - path : /
11
+ pathType : Prefix
12
+ backend :
13
+ service :
14
+ name : todosvc
15
+ port :
16
+ number : 80
You can’t perform that action at this time.
0 commit comments