Skip to content

Commit 4755b38

Browse files
committed
added deploy, cm and secrets exercises
1 parent 7e6f412 commit 4755b38

File tree

2 files changed

+99
-1
lines changed

2 files changed

+99
-1
lines changed

exercises/100-cm-and-secrets.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#### 1. Create two differenct ConfigMap manifest with the follwing properties. If there are any bugs, fix them.
2+
```
3+
Name: ConfigMap-A
4+
data 1:
5+
SALT: astdXy3Cmn5DMbcPqeYK
6+
STATE: present
7+
8+
Name: ConfigMap-B
9+
data 2:
10+
API: https://107.178.217.202
11+
USER: admin
12+
```
13+
14+
#### 2. Complete the following Pod definition to use the above mentioned configMaps.
15+
```
16+
apiVersion: v1
17+
kind: Pod
18+
metadata:
19+
name: config-test-pod
20+
spec:
21+
containers:
22+
- name: config-test-container
23+
image: k8s.gcr.io/busybox
24+
command: [ "/bin/sh", "-c", "echo $(SALT) $(STATE) $(API)" ]
25+
xxx:
26+
[...]
27+
restartPolicy: Never
28+
```
29+
30+
#### 3. Convert the following data into secret.
31+
```
32+
name: mongo-secret
33+
data:
34+
username: mongoadmin
35+
password: Cr0wnJ3w3!
36+
secret_key: AsMPgc3xTroPcv6vi$NO
37+
```
38+
39+
#### 4. Mount the above created secret as a volume with the /etc/mongoCreds path in the following Pod manifest.
40+
```
41+
apiVersion: v1
42+
kind: Pod
43+
metadata:
44+
name: secret-test-pod
45+
spec:
46+
containers:
47+
- name: secret-test-container
48+
image: k8s.gcr.io/busybox
49+
command: [ "/bin/sh", "-c", "ping" "localhost" ]
50+
```
51+
52+
#### 5. Create a Secret from literal values using kubectl.
53+
```
54+
username: casterAdmin
55+
password: s3cr3tsauc3
56+
```

exercises/90-deploy.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,43 @@
1-
#### 1.
1+
#### 1. Create an Nginx Deployment using kubectl with following properties.
2+
```
3+
1. Name: nginx-frontend
4+
2. Labels: app=nginx, tier=frontend
5+
3. Image: nginx:latest
6+
3. Replicas: 3
7+
4. ImagePullPolicy: Always
8+
```
9+
10+
#### 2. For the above mentioned Deployment, change the image version from `nginx:latest` to `nginx:1.12.0` using `kubectl set image` command
11+
12+
#### 3. For the above mentioned Deployment, undo the changes using `kubectl rollout` command and rollback to revision 1.
13+
14+
#### 4. Create a Deployment manifest with the following properties and apply it. If it fails, try to do rolling update the image version to `0.3.0`
15+
```
16+
1. Name: web-app
17+
2. Labels: env=prod, tier=web
18+
3. Image: robotshop/rs-web:v1.0
19+
4. Port: 8080
20+
5. Restart Policy: Always
21+
```
22+
23+
#### 5. For the following application, fix and fill in the missing details.
24+
```
25+
apiVersion: extensions/v1beta1
26+
kind: deployment
27+
metadata:
28+
labels:
29+
name: mysql
30+
spec:
31+
replicas: 1
32+
template:
33+
metadata:
34+
labels:
35+
app: mysql
36+
spec:
37+
containers:
38+
- image: robotshop/rs-mysql-db:latest
39+
name:
40+
ports:
41+
- Containerport: 3306
42+
restartPolicy: xxxx
43+
```

0 commit comments

Comments
 (0)