Docker
OCI – Kubernetes – 1
Kubernetes – Pod Creation Examples
* Replica 3, Name : nginx-deployment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 |
* Create a simple Pod to use as a test environment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
apiVersion: v1 kind: Pod metadata: name: dnsutils namespace: default spec: containers: - name: dnsutils image: gcr.io/kubernetes-e2e-test-images/dnsutils:1.3 command: - sleep - "3600" imagePullPolicy: IfNotPresent restartPolicy: Always |
* dd
1 |
kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml |
* cc
*
Ref :
- https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
- a
- b
- c
- d
Kubernetes
Docker Command Line Examples
Changing directory of the overlay and Docker installation images
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
1) /etc/sysconfig/docker 2) /etc/docker/daemon.json 1) Updating ‘/etc/sysconfig/docker’ file: cat /etc/sysconfig/docker OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false -D -g /home/thiru/docker' g -> specify docker’s root directory 2) Updating /etc/docker/daemon.json [root@docker-host-1 ~]# cat /etc/docker/daemon.json { "graph": "/home/thiru/docker" } |
Docker Shared Mount ( Mount directory from one container to another )
Ex1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
docker run -v /data/myfolder --name container1 image-name-1 docker run --volumes-from container1 image-name-2 docker run -v myfolder:/data/myfolder image-name-1 docker run -v myfolder:/data/myfolder image-name-2 Building from file # Ubuntu image FROM ubuntu:14.04 for the image to test the use of the other data only volume. docker build -t bitplan/dataonly:0.0.1 -f Dockerfile.data . docker build -t bitplan/dataexample:0.0.1 . |