CKAD : 3. Build


App Container (appc) is an open specification that defines several aspects of how to run applications in containers: an image format, runtime environment, and discovery protocol. rkt's native image format and runtime environment are those defined by the specification.

clear container (from intel) uses kvmtool mini-hypervisor. So it is VM with quick bootup and low memory footprint. Not comparable with Docker but acceptable for many use cases. 

If we create a file inside Docker container, then it is acutally located at 
/var/snap/docker/common/var-lib-docker/aufs/diff/  
OR 
/var/lib/docker/aufs/diff/

Tools
1. Docker
2. buildah
- create OCI image
- with or without Dockerfile
- no superuser previliage needed
- Go-lan based API for easy integation
3. podman (pod manager)
- replacement of "docker run"
- it is for container LCM
4. Kompose

sudo kompose convert -f docker-compose.yaml -o localregistry.yaml

latest is just a string. we need process to name and rename latest version as "laters" as an when it available. Else, there is no point. 

k exec -it -- /bin/bash
Here instead of /bin/bash any tool of local host, (where kubectl is running) can be used. 

redinessProbe and livenessProbe
1. exec statement
2. HTTP GET. return value 200-399
3. TCP. Try to open port on pre-determined port

To get logs generated by etcd
k -n kube-system logs etcd

The events can be listed with
k describe pod  

We can user "--dry-run -o yaml" just to generate YAML file

Minikube

To access K8s service on Minikube we have few approaches

1. Make it as NodePort Service

1.1  we can change service type as NodePort by
k path svc -p '{"spec":{"type":"NodePort"}}'
Now to access NodePort service on Minikube, we need IP address of virtual box. 

1.2
minikube ip
this command  give IP address of Worker+Master Node.
User command 
curl http://192.168.99.108:31754/v2/
curl http://"Minikube IP":"NodePort"/v2/

1.3

Use the command
minikube service --url
you will get service end point
http://192.168.99.108:31754

http://"Minikube IP":"NodePort"

We can open this URL using default browser using command
minikube service 

2.1

We can use ClusterIP

sudo route add 10.100.88.2 gw 192.168.99.108
sudo route add gw

Registry

We should add insecure registry to docker with its ClusterIP 

sudo vim /etc/docker/daemon.json

{ "insecure-registries":["10.110.186.162:5000"] }

Then Restart Docker Service
sudo systemctl restart docker.service

0 comments:

Post a Comment