Deploying apps to kubernetes using GHA
Deploying apps to kubernetes using GHA
Steps:
- Dockerize app(s)
- Deploy kubernetes
- GHA CI/CD
- Add Kubernetes resources to enable CI/CD from GHA
- Set secrets values to repository
- Deploy app to kubernetes using GHA
- Publish app - deploy
ingress-nginx
to kubernetes - Enable secure access to app - deploy
cert-manager
to kubernetes and set DNS
Tasks
- Dockerize app(s):
- find a couple of simple apps or write your own
- create a git repository
- write Dockerfiles and push them to the repository
- build and push them to a registry server
- Deploy kubernetes:
- create an instance in Aws EC2 from the web UI
- install all required packages and deploy
kind
- set security groups(ec2) to expose required ports if required
- test kubernetes API access from your machine
- GHA CI/CD
- create workflow files in GitHub repository
- add step to build the apps
- create docker server token (dockerhub) to be used in the workflow
- Add Kubernetes resources to enable CI/CD from GHA
- create the following resources:
namespace
serviceaccount
token
- create the following resources:
- Set secrets values to repository
- create secrets in the repo settings to be used in workflows
- Deploy app to kubernetes using GHA
- apply changes to the app code and push it to repository
- Publish app - deploy
ingress-nginx
to kubernetes- deploy ingress-nginx with Helm
- create kubernetes services and ingresses resources to expose application to the internet
- Enable secure access to app - deploy
cert-manager
to kubernetes and set DNS- deploy cert-manager with Helm
- create ingresses to enable TLS certificates