File tree 23 files changed +576
-0
lines changed
23 files changed +576
-0
lines changed Original file line number Diff line number Diff line change
1
+ use nix
2
+
3
+ minikube config set driver docker
4
+ minikube status > /dev/null 2>&1 || minikube start
5
+
6
+ echo -e " \033[31mminikube automatically started.\033[0m"
7
+ echo -e " \033[31mRemember to manually stop minikube before exiting. 'minikube stop'\033[0m"
8
+ echo -e " \033[31mHelper: alias k='minikube kubectl --'\033[0m"
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Pod
3
+ metadata :
4
+ name : nginx
5
+ spec :
6
+ containers :
7
+ - name : nginx-container
8
+ image : nginx
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 3
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
21
+ # this should fail
22
+ readinessProbe :
23
+ periodSeconds : 1
24
+ successThreshold : 5
25
+ httpGet :
26
+ path : /foo
27
+ port : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 3
8
+
9
+ strategy :
10
+ rollingUpdate :
11
+ maxSurge : 1
12
+ maxUnavailable : 1
13
+
14
+ selector :
15
+ matchLabels :
16
+ app : appname
17
+
18
+ template :
19
+ metadata :
20
+ labels :
21
+ app : appname
22
+
23
+ spec :
24
+ containers :
25
+ - name : nginx-container
26
+ image : nginx
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 1
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 2
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
21
+ livenessProbe :
22
+ httpGet :
23
+ path : /
24
+ port : 80
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 1
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ # just pretend is a new version of an app...
21
+ image : caddy
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 5
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 2
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Service
3
+ metadata :
4
+ name : appname-svc
5
+
6
+ spec :
7
+ type : NodePort
8
+ selector :
9
+ app : appname
10
+
11
+ ports :
12
+ - port : 80
13
+ nodePort : 30001
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 1
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ volumes :
19
+ - name : config
20
+ configMap :
21
+ name : appname-config
22
+
23
+ containers :
24
+ - name : nginx-container
25
+ image : nginx
26
+ volumeMounts :
27
+ - name : config
28
+ mountPath : /config
29
+ ---
30
+
31
+ apiVersion : v1
32
+ kind : ConfigMap
33
+ metadata :
34
+ name : appname-config
35
+
36
+ data :
37
+ THIS_FILE : " THIS_CONTENT"
Original file line number Diff line number Diff line change
1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : appname
5
+
6
+ spec :
7
+ replicas : 1
8
+ selector :
9
+ matchLabels :
10
+ app : appname
11
+
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : appname
16
+
17
+ spec :
18
+ containers :
19
+ - name : nginx-container
20
+ image : nginx
21
+ # injecting directly
22
+ env :
23
+ - name : FOO
24
+ value : " BAR"
25
+
26
+ - name : BAR
27
+ valueFrom :
28
+ configMapKeyRef :
29
+ name : appname-config
30
+ key : BAR
31
+
32
+ # alternative
33
+ # envFrom:
34
+ # - configMapRef:
35
+ # name: appname-config
36
+ # prefix: SOME_
37
+
38
+ ---
39
+
40
+ apiVersion : v1
41
+ kind : ConfigMap
42
+ metadata :
43
+ name : appname-config
44
+
45
+ data :
46
+ BAR : " FOO"
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Secret
3
+ metadata :
4
+ name : appname-secrets
5
+
6
+ stringData :
7
+ SHIU : " secret"
8
+
9
+ # also valid
10
+ # data:
11
+ # SHIU: "c2VjcmV0Cg=="
12
+
13
+ ---
14
+
15
+ apiVersion : apps/v1
16
+ kind : Deployment
17
+ metadata :
18
+ name : appname
19
+
20
+ spec :
21
+ replicas : 1
22
+ selector :
23
+ matchLabels :
24
+ app : appname
25
+
26
+ template :
27
+ metadata :
28
+ labels :
29
+ app : appname
30
+
31
+ spec :
32
+ containers :
33
+ - name : nginx-container
34
+ image : nginx
35
+ # use secretKeyRef instead
36
+ env :
37
+ - name : SHIU
38
+ valueFrom :
39
+ secretKeyRef :
40
+ name : appname-secrets
41
+ key : SHIU
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : CronJob
3
+ metadata :
4
+ name : appname-cron
5
+ spec :
6
+ schedule : " * * * * * "
7
+ jobTemplate :
8
+ spec :
9
+ template :
10
+ spec :
11
+ restartPolicy : OnFailure
12
+ containers :
13
+ - name : echo
14
+ image : busybox
15
+ command : ["echo", "job is done in cronjob"]
Original file line number Diff line number Diff line change
1
+ apiVersion : batch/v1
2
+ kind : Job
3
+ metadata :
4
+ name : app-jobs
5
+ spec :
6
+ # auto clean up
7
+ # ttlSecondsAfterFinished: 60
8
+ # multiple runs
9
+ # completions: 5
10
+ #
11
+ # parallelism: 2
12
+ # backoffLimit: 10
13
+ template :
14
+ spec :
15
+ restartPolicy : OnFailure
16
+ containers :
17
+ - name : echo
18
+ image : busybox
19
+ command : ["echo", "jobs is done"]
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Namespace
3
+ metadata :
4
+ name : my-name-is
Original file line number Diff line number Diff line change
1
+ apiVersion : v1
2
+ kind : Pod
3
+ metadata :
4
+ name : pod-in-space
5
+ namespace : my-name-is
6
+ spec :
7
+ containers :
8
+ - name : nginx-container
9
+ image : nginx
You can’t perform that action at this time.
0 commit comments