Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
87 views6 pages

- Cài đặt docker

The document provides instructions for installing Docker and Kubernetes on Ubuntu. It discusses installing Docker using apt, lists common Docker commands, and explains how to configure the Docker API. It then covers installing Kubernetes by adding the apt repository, downloading keys, and installing packages. The Kubernetes architecture of masters, nodes, etcd, kube-scheduler, kube-controller, Kubelet and kube-proxy is also summarized. Finally, Calico is mentioned as a Kubernetes network add-on.

Uploaded by

PhanDuy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views6 pages

- Cài đặt docker

The document provides instructions for installing Docker and Kubernetes on Ubuntu. It discusses installing Docker using apt, lists common Docker commands, and explains how to configure the Docker API. It then covers installing Kubernetes by adding the apt repository, downloading keys, and installing packages. The Kubernetes architecture of masters, nodes, etcd, kube-scheduler, kube-controller, Kubelet and kube-proxy is also summarized. Finally, Calico is mentioned as a Kubernetes network add-on.

Uploaded by

PhanDuy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

- Cài đặt docker

$sudo apt-get update

$ sudo apt-get install \

apt-transport-https \

ca-certificates \

curl \

gnupg \

lsb-release

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

$ sudo add-apt-repository "deb [arch=amd64]


https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

$ sudo apt-get update

$sudo apt-get install docker-ce docker-ce-cli containerd.io

- 18 command in docker
docker attach – Attach local standard input, output, and error streams to a running container

docker build – Build an image from a Dockerfile

docker builder – Manage builds

docker checkpoint – Manage checkpoints

docker commit – Create a new image from a container's changes

docker config – Manage Docker configs

docker container – Manage containers


docker context – Manage contexts

docker cp – Copy files/folders between a container and local filesystem

docker create – Create a new container

docker diff – Inspect changes to files or directories on a container's filesystem

docker events – Get real time events from the server

docker exec – Run a command in a running container

docker export – Export a container's filesystem as a tar archive

docker history – Show the history of an image

docker image – Manage images

docker images – List images

docker import – Import the contents from a tarball to create a filesystem image

docker info – Display system-wide information

docker inspect – Return low-level information on Docker objects

docker kill – Kill one or more running containers

docker load – Load an image from a tar archive or STDIN

docker login – Log in to a Docker registry

docker logout – Log out from a Docker registry

docker logs – Fetch the logs of a container

docker manifest – Manage Docker image manifests and manifest lists

docker network – Manage networks

docker node – Manage Swarm nodes

docker pause – Pause all processes within one or more containers

docker plugin – Manage plugins

docker port – List port mappings or a specific mapping for the container

docker ps – List containers

docker pull – Pull an image or a repository from a registry

docker push – Push an image or a repository to a registry


docker rename – Rename a container

docker restart – Restart one or more containers

docker rm – Remove one or more containers

docker rmi – Remove one or more images

docker run – Run a command in a new container

docker save – Save one or more images to a tar archive (streamed to STDOUT by default)

docker search – Search the Docker Hub for images

docker secret – Manage Docker secrets

docker service – Manage services

docker stack – Manage stacks

docker start – Start one or more stopped containers

docker stats – Display a live stream of container(s) resource usage statistics

docker stop – Stop one or more running containers

docker swarm – Manage Swarm

docker system – Manage Docker

docker tag – Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

docker top – Display the running processes of a container

docker trust – Manage trust on Docker images

docker unpause – Unpause all processes within one or more containers

docker update – Update configuration of one or more containers

docker version – Show the Docker version information

docker volume – Manage volumes

docker wait – Block until one or more containers stop, then print their exit codes

+ viết docker API

Create file daemon.json in folder /etc/docker/


{

"debug": true,

"hosts": ["tcp://0.0.0.0:2375"]

- Kubernet (k8s)

1. Update the apt package index and install packages needed to use the


Kubernetes apt repository:

sudo apt-get update

sudo apt-get install -y apt-transport-https ca-certificates curl

2. Download the Google Cloud public signing key:

sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg


https://packages.cloud.google.com/apt/doc/apt-key.gpg

3. Add the Kubernetes apt repository:

echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/


kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

4. Update apt package index, install kubelet, kubeadm and kubectl, and pin their version:

sudo apt-get update

sudo apt-get install -y kubelet kubeadm kubectl

sudo apt-mark hold kubelet kubeadm kubectl

+ Kiến trúc
Master Server là máy chính của cluster, tại đây điều khiển cả cụm máy.

etct là thành phần cơ bản cần thiết cho Kubernetes, nó lưu trữ các cấu hình chung cho cả cụm máy, etct chạy tại máy
master. etct là một dự án nguồn mở (xem tại etcd) nó cung cấp dịch vụ lưu dữ liệu theo cặp key/value

kube-scheduler chạy tại master, thành phần này giúp lựa chọn Node nào để chạy các ứng dụng căn cứ vào tài
nguyên và các thành phần khác sao cho hệ thống ổn định.

kube-controller chạy tại master, nó điều khiển trạng thái cluster, tương tác để thực hiện các tác vụ tạo, xóa, cập
nhật ... các tài nguyên

Kubelet dịch vụ vụ chạy trên tất cả các máy (Node), nó đảm đương giám sát chạy, dừng, duy trì các ứng dụng chạy
trên node của nó.

Kube-proxy: cung cấp mạng proxy để các ứng dụng nhận được traffic từ ngoài mạng vào cluster.
+ add-on calcilo

https://docs.projectcalico.org/about/about-calico

You might also like