Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
[root@k8s-worker01 ~]# mkdir certs
[root@k8s-worker01 ~]# 
[root@k8s-worker01 ~]# openssl req \
>   -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key \
>   -x509 -days 365 -out certs/domain.crt
Generating a 4096 bit RSA private key
...................................................++
........................................................................++
writing new private key to 'certs/domain.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:kr
State or Province Name (full name) []:seoul      
Locality Name (eg, city) [Default City]:seoul 
Organization Name (eg, company) [Default Company Ltd]:sptek
Organizational Unit Name (eg, section) []:engops
Common Name (eg, your name or your server's hostname) []:registry.thesanse.com
Email Address []:sooabia22@sptek.co.kr
[root@k8s-worker01 ~]# cd certs
[root@k8s-worker01 certs]# ls
domain.crt  domain.key
[root@k8s-worker01 certs]# ls
domain.crt  domain.key
[root@k8s-worker01 certs]# 


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 ~]#


Info
$ docker run -d \
  --restart=always \
  --name registry \
  -v "$(pwd)"/certs:/certs \
  -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \
  -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
  -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
  -p 443:443 \
  registry:2

...