Running the script inside a docker container
If you wish to test whether your docker container won't have issues when the old Root certificate expires, you can run the script inside the container itself.
In order to do this, follow these steps:
- Download the
verify-lets-encrypt.sh
script from the gist - Bring up your application container as you usually do - with
docker-compose up
,docker run
, via VS Code etc - Run
docker ps
, and look for any application containers that are up; theNAMES
column is the easiest for that - From the same folder where you've downloaded the script, run
docker exec -i <CONTAINER_NAME_OR_ID> /bin/sh < verify-lets-encrypt.sh
; this will run the script inside the container - Then, you should be able to see the script output in the same terminal
Great script @renato-zannon.
We can also run directly the script in our pod (for example in
dev
orstaging
environments)Retrieving pod names:
kubectl -n <application-name> get pods
Example:
kubectl -n ninjas get pods
Running script:
kubectl -n <application-name> exec -it <podname> -- /bin/sh < verify-lets-encrypt.sh
Example:
kubectl -n ninjas exec -it ni-r-62be-web-68b4878bf5-qw9rh -- /bin/sh < verify-lets-encrypt.sh
Output: