...
Code Block |
---|
[root@k8s-worker01 ~]# docker swarm init --advertise-addr 52.231.65.113
Swarm initialized: current node (0zhxqeqg5zcidk4mte87htlej) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join \
--token SWMTKN-1-2pe05um3cnu3z8ktyxkjmozujgmmvffdct4dz81bd2dghurjyr-eu3oqllp4b637iksavox60t0x \
52.231.65.113:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]# docker secret create domain.crt certs/domain.crt
ulpoxrnjasokhz9tv3yx0cocy
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]# docker secret create domain.key certs/domain.key
5gbj3r3s81bmxp4s1ueduzdtm
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]# docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
0zhxqeqg5zcidk4mte87htlej * k8s-worker01 Ready Active Leader
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]# docker node update --label-add registry=true 0zhxqeqg5zcidk4mte87htlej
0zhxqeqg5zcidk4mte87htlej
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]#
[root@k8s-worker01 ~]# docker service create \
> --name registry \
> --secret domain.crt \
> --secret domain.key \
> --constraint 'node.labels.registry==true' \
> --mount type=bind,src=/mnt/registry,dst=/var/lib/registry \
> -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \
> -e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt \
> -e REGISTRY_HTTP_TLS_KEY=/run/secrets/domain.key \
> --publish published=443,target=443 \
> --replicas 1 \
> registry:2
7bzq5bkrm51i9nmjtyaqyizkq
[root@k8s-worker01 ~]#
|
Info |
---|
|
...