CI / CD - how to deploy ment from docker registry
You need to create certificate that you will upload to CloudUX machine and to your PC.
To generate certificate.
1 | $ mkdir -p certs |
Follow instruction to the end!
Linux: Copy the domain.crt file to /etc/docker/certs.d/myregistrydomain.com:5000/ca.crt on every Docker host. You do not need to restart Docker.
Windows:
Open Windows Explorer, right-click the domain.crt file, and choose Install certificate. When prompted, select the following options:
Store location | local machine |
---|---|
Place all certificates in the following store | selected |
Click Browser and select Trusted Root Certificate | Authorities.
Click Finish. Restart Docker.
SSH into mediacentral-machine:
In etc/hosts change your registry-ip to dome domain
1 | vim /usr/lib/systemd/system/docker.service |
And add:
1 | ExecStart= ... --insecure-registry <your-domain> |
Create docker registry.
1 | $ docker run -d \ |
Create your local docker image and push it to your registry
You on check your uploaded image under https://
Or check by docker ps if it’s running.
Create example deployment.yaml
1 | apiVersion: apps/v1 |
Copy file to root of your CloudUX machine and install deployment
1 | kubectl create -f path/to/deployment.yaml |
Your deployment should be working you can upgrade it with script deployment.sh for example:
1 |
|
It connects to external cluster and executes commands on it. Last line forces kuberneted to re-deploy and in that case pull image because of changed timestamp.
Remember
Your deployment.sh script needs to have access to kubectl kubernetes tool.
You can run it inside docker container.