Chapter02(day-3)
25 January 2025 09:16
Deployment
Objectives:
1. What is the Project in the kubernetes
2. Deploy the container in the kubernetes
3. Imperative mode vs declarative
4. Reliability and scalability (label and selector & RC/RS, Deployment)
5. Rolling and rollback
6. Deployment strategy
Learning vs Real time
1. What is the Project in the kubernetes
1. resource isolation between teams/users
2. improve the administrator security
3. restrict un-authorized operation over the pod .
4. we can delegate role access to user (RBAC)
5. limit cpu/memory for the pod/containers.
Noted: project=Namespace
List/create/use/delete
2. Deploy the container in the kubernetes ?
orphan pod : no failover, no scalability , no reliability
1. Impetrative: command line
2. Declarative : manifests/yaml file ?
kubernetes Morning Page 1
Yaml syntax ?
1. String
2. Listing
3. Mapping
4. List mapping
how to create same using declarative mode
controlled pod
1. RC : replication controllers ?
1. scalability
2. reliability
156 kubectl config get-context
157 kubectl config get-contexts
158 clear
159 kubectl get ns
160 clear
161 kubectl create ns testing
162 kubectl run test --image=[Link]/nginx -n testing
163 kubectl get pod -n testing
164 kubectl get pod -n testing -o wide
165 kubectl get pod -n testing
166 kubectl logs test -n testing
167 kubectl exec -it test -n testing bash
168 kubectl exec -it test -n testing -- bash
169 kubectl exec -it test -n testing -- sh
170 kubectl get pod -n testing
171 kubectl describe pod test -n testing
172 kubectl get pod -n testing
173 kubectl delete pod test -n testing
174 kubectl get pod -n testing
175 kubectl get pod -n cdi
176 kubectl describe pod cdi-apiserver-55dd4458c6-lbghd -n cdi | grep -i controller
177 kubectl describe pod cdi-apiserver-55dd4458c6-lbghd -n cdi | grep -i controll
178 history
179 clear
kubernetes Morning Page 2
179 clear
180 cat > [Link]
181 vim [Link]
182 kubectl create -f [Link] -n testing
183 kubectl get pod -n testing
184 vim [Link]
185 kubectl create -f [Link]
186 vim [Link]
187 kubectl create -f [Link]
188 vim [Link]
189 kubectl create -f [Link]
190 vim [Link]
191 kubectl create -f [Link]
192 vim [Link]
193 kubectl create -f [Link]
194 vim [Link]
195 kubectl create -f [Link]
196 clear
197 kubectl api-resources
198 cat [Link]
199 vim [Link]
200 kubectl create -f [Link] -n testing
201 vim [Link]
202 kubectl explain pod --recursive=true
203 kubectl explain pod --recursive=true | grep -iA5 namespace
204 kubectl explain pod --recursive=true | grep -ib5 namespace
205 kubectl explain pod --recursive=true | grep -iB5 namespace
206 kubectl explain pod --recursive=true | less
207 vim [Link]
208 kubectl explain [Link]
209 cat > [Link]
210 mv [Link] [Link]
211 vim [Link]
212 kubectl api-resources
213 vim [Link]
214 kubectl create -f [Link] -n testing
215 kubectl get pod -n testing
216 kubectl describe pod demo -n testing | grep -i controll
217 kubectl describe pod krnetwork-cbvdb -n testing | grep -i controll
218 kubectl get rc -n krnetwork
219 kubectl get rc -n testing
220 kubectl delete pod demo ran sham -n testing
221 kubectl get pod -n testing
222 kubectl get rc -n testing
223 kubectl delete pod krnetwork-cbvdb -n testing
224 kubectl get rc -n testing
225 kubectl get pod -n testing
226 kubectl scale --replicas=4 rc krnetwork -n testing
227 kubectl get rc -n testing
228 kubectl get pod -n testing
229 kubectl get pod -n testing -o wide
230 vim [Link]
231 ls
232 vim [Link]
233 kubectl get rc -n testing
234 kubectl apply -f [Link] -n testing
235 kubectl get rc -n testing
236 rm -f [Link]
kubernetes Morning Page 3
236 rm -f [Link]
237 kubectl get rc -n testing
238 kubectl delete rc krnetwork -n testing
239 kubectl get rc -n testing
240 kubectl get pod -n testing
241 clear
242 git clone [Link]
243 cd kubernetes-manifests/
244 ls
245 kubectl create -f [Link] -n testing
246 cd
247 kubectl get rc -n testing
248 kubectl edit rc krnetwork -n testing
249 kubectl get pod -n testing
250 kubectl scale --replicas=4 rc krnetwork -n testing
251 vim kubernetes-manifests/[Link]
252 kubectl apply -f kubernetes-manifests/[Link]
253 kubectl edit rc krnetwork -n testing
254 vim kubernetes-manifests/[Link]
255 kubectl api-resources
256 vim kubernetes-manifests/[Link]
257 kubectl explain [Link]
258 cat [Link]
259 vim [Link]
260 kubectl create -f [Link]
261 vim pod
262 vim [Link]
263 kubectl create -f [Link]
264 vim [Link]
265 kubectl create -f [Link]
266 vim [Link]
267 kubectl create -f [Link]
268 vim [Link]
269 kubectl explain pod
270 kubectl explain [Link]
271 kubectl explain [Link]
272 kubectl explain [Link]
273 clear
274 kubectl get nodes
275 history
kubernetes Morning Page 4