Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. # 1.Core Concept
  2.  
  3. #### Q1. Create a `Multi-container Pod` with name `multi-c-pod`, which contains containers from following images :-
  4. - image1 : nginx:alpine
  5. - image2 : redis
  6. - image3 : memcached
  7.  
  8. You can have container names, as per your choice.
  9.  
  10. #### Q2. Create a `Namespace` with name `mynamespace` using YAML. Create a `Pod` with name `mypod` using `nginx:alpine` image, inside this `mynamespace` namespace.
  11.  
  12. #### Q3. Create a Replicaset using the YAML file.
  13. - image : nginx:alpine
  14. - name : nginx-rs
  15. - label : app=ckad
  16. - replicas : 3
  17.  
  18. #### Q4. Create 2 pods as follow and perform `Set Based Requirement` Label selector operations given below and save all the commands and the outputs to `~/label.txt`.
  19.  
  20. - A. Create a `Pod` with name `prod-pod`
  21. - image : nginx:alpine
  22. - name : prod-pod
  23. - label : environment=production,tier=frontend
  24.  
  25. - B. Create a `Pod` with name `dev-pod`
  26. - image : nginx:alpine
  27. - name : dev-pod
  28. - label : environment=dev,tier=backend
  29.  
  30. - C. List the Pods using `Set Based Requirement` Label selector for following conditions:
  31. - List the pods which exist in `production` environment.
  32. - List the Pods which does not exist in `production` environment.
  33. - List he Pods which does not exist in `qa` environment.
  34.  
  35. #### Q5.Create a `Daemonset` using the YAML file.
  36. - image : nginx:alpine
  37. - name : nginx-ds
  38. - label : app=ds-app
  39. - nodeselector: disk=ssd
  40.  
  41. # 2.Application Managements
  42.  
  43. #### Q1. Create a simple job which will write “Hello world” for 50 times with 5 parallelism.
  44.  
  45. #### Q2. Create a Deployment using the YAML file
  46. - image : nginx:alpine
  47. - name : nginx-deploy
  48. - label : app=web
  49. - replicas : 3
  50.  
  51. #### Q3. Scale the `Deployment` `nginx-deploy` to 5 replicas.
  52.  
  53. #### Q4. Update the image for `Pods` in `Deployment` `nginx-deploy` to `nginx:stable` . Save rollout history to `~/rollout.txt`
  54.  
  55.  
  56. #### Q5. Create `Pod` with name `healthy-pod` and configure the readiness and liveness probe for it. Use following configuration while creating the pods.
  57.  
  58. - name: healthy-pod
  59. - image: nginx
  60. - Liveness Probe
  61. - initial delay for liveness probe: 5 seconds
  62. - timeout for liveness probe: 1 second
  63. - kubelet should perform a liveness probe every 3 seconds
  64. - maximum restarts: 5
  65.  
  66. - Liveness Probe
  67. - initial delay for readiness probe: 5 seconds
  68. - timeout for readiness probe: 1 second
  69. - kubelet should perform a readiness probe every 3 seconds
  70. - maximum restarts: 7
  71.  
  72. # 3.Storage
  73.  
  74.  
  75.  
  76. #### Q1. Create `Persistent Volume` with name `mypv` Using YAML such that:
  77. - name: mypv
  78. - size: 5gb
  79. - volumedriver: Hostpath
  80. - Retain policy: recycle
  81.  
  82.  
  83.  
  84. #### Q2. Create `Persistent Volume Claim` with name `mypvc` which consume `Persistent Volume` `mypv` Using YAML such that:
  85.  
  86. - name: mypvc
  87. - size: 2gb
  88.  
  89.  
  90. #### Q3. Create a Pod with name `mypvpod` from `ubuntu` image, which will mount the `Persistent Volume Claim` `mypvc` at mount path `/data` such that:
  91.  
  92. - name: mypvpod
  93. - image: ubuntu
  94. - PVC: mypvc
  95. - mountpath: /data
  96.  
  97.  
  98. #### Q4. Create a `Pod` named `non-persistent-redis` from `redis` image that have a volume with name `app-cache` , and mountpath will be `/data/redis`. It should launch in the `staging` namespace and the volume MUST NOT be persistent.
  99.  
  100.  
  101. # 4.Scheduling
  102.  
  103. #### Q1. Create Pod name `init-demo` which have one init container with name `init-ctr` which will write a file and another container with name `app-ctr` will check whether that file is exist or not. You can choose any container images of your choice for creating the `init container` and `container`.
  104.  
  105.  
  106. #### Q2. Create a `Secret` with name `mysecret` using YAML, which consists the following data.
  107. - USERNAME: cloudyuga
  108. - PASSWORD: CloudyugaCKA
  109.  
  110. #### Q3. Create a `Pod` with name `mysecretpod` which will be consuming the secret `mysecret` as enviorment variable `TOPSECRETUSERNAME` will have value of `USERNAME` and enviorment variable `TOPSECRETPASSWORD` will have value of `PASSWORD`. You can use any image of your choice for creating pod.
  111.  
  112. #### Q4. Create a Namespace `test-quota` such that
  113. - Put memory limits of 256Mi on the namespace.
  114. - Limit pods to 2 persistent volumes in this namespace.
  115. - Run a pod with name `test-pod` in the `test-quota` namespace with resource request and limit which satisfy the resource quota. You can use image of your choice to create the pod.
  116.  
  117.  
  118. # 5.Networking
  119.  
  120. #### Q1. Create an `Deployment` with name `deploy-app` and create service for that deployment `svc-app`. Deploy Ingress controller and create Ingress resource `app-ing` such that `app.example.com` resolve to service `svc-app`.
  121. - name of Deployment: deploy-app
  122. - image: nginx:alpine
  123. - labels: app=nginx-deploy
  124. - replicas: 3
  125. - name of Service: svc-app
  126. - name of ingress object: app-ing
  127.  
  128.  
  129. #### Q2. Create a `Deployment` with name `nginx-deploy-test` using YAML.
  130. - name of Deployment: nginx-deploy
  131. - image: nginx:alpine
  132. - labels: app=nginx-deploy
  133. - replicas: 4
  134.  
  135. #### Q3. Create a Service for the `Deployment` `nginx-deploy-test` using YAML such that:
  136. - name of Service: nginx-svc
  137. - type of service: NodePort
  138. - NodePort: 31089
  139.  
  140. #### Q4. Create a `Pod` with name `test` and ClusterIP service with name `test-svc` for accessing this `test` pod using YAML:
  141. - Pod configuration:
  142. - Name of Pod: test
  143. - image: nginx
  144. - labels: app=test-app
  145.  
  146. - Service Configuration:
  147. - Name of service: test-svc
  148. - service type: ClusterIP
  149.  
  150. #### Q5: Get the DNS records for `test` `Pod` and `test-svc` `service`. and store it at `~/testpod.txt` and `~/testsvc.txt` respectively.
  151.  
  152. # 6.Security
  153.  
  154. #### Q1. Create a `Namespace` with name `demo` in this namespace create `Pod` with name`demo`. Create a `Namespace` with name `test` in this namespace create `Pod` with name`test`. Create a Network Policy in such way that It should allow traffic to the `demo` pod only from `test` pod running in `test` namespace. You can use any image of your choice to create the pods.
  155.  
  156.  
  157. #### Q2. Creare a namespace called `secure`, in that namespace create Pod with name `sec-pod` which is running with UID 2000 and GID 2000. You can use any image of your choice to create the pods.
  158.  
  159. #### Q3. Create a new `Namespace` called `demo-sa`. In that `demo-sa` Namespace create `Service Account` with name `demo` using YAML. Now in the Namespace `demo-sa`, create a `Pod` `demo-pod` using YAML as following configuration:
  160.  
  161. - name: demo-pod
  162. - namespace: demo-ns
  163. - serviceaccount: demo
  164. - image: nginx:alpine
  165. - lable: app=demo-app
  166.  
  167. # 7-Logging-Monitoring
  168.  
  169. #### Q1. Create a `Pod` with name `log-pod` such that it continuously echo the current time after interval of 2 seconds. You can use any image of your choice to create the pod.
  170.  
  171. #### Q2.Get the logs of pod `log-pod` and write down in file called `~/logs.txt`
  172.  
  173. # 8-Cluster-Maintenance
  174.  
  175. #### Q1. Create a static pod with name `stat-pod` and use image `nginx:alpine` by keeping manifest in /etc/kubernetes/manifests.
  176.  
  177. #### Q2. Take the back up of ETCD at `/opt/baks/etcd0001/`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement