Everyone can contribute! Let's learn together in a weekly cafe ☕
We love to break things, make mistakes, debug, analyse, fix problems together. Live and unfiltered on Youtube.
Community members and thought leaders regularly join and share their projects and ideas.
"Everyone Can Contribute" is inspired by GitLab's mission.
24. #everyonecancontribute cafe: Automate Kubernetes deployment with Terraform and GitLab CI/CD
We are learning how to deploy and secure Kubernetes into Hetzner cloud in this series:
In this session, we automate the deployment of the Kubernetes cluster with Max inside GitLab CI/CD:
- Automate the deployment from the repository with GitLab CI/CD
- Preparations in GitLab: Add CI/CD variables and update settings.
SSH_KEY- GitLab reads the file.
public pipelineto avoid leaking credentials in artifacts.
- Define GitLab CI/CD pipeline stages:
- CI/CD rule with the pre-defined variable CI_PIPELINE_SOURCE to only allow triggers from
web- single click deployments from the GitLab web interface.
- Create a template job, starting with a dot and later imported with extends.
- Import the
.terraformjob template into new Terraform jobs:
gitlab-terraformis a wrapper which sets config automatically. Infrastructure as Code with Terraform and GitLab docs.
- Example worflow from the GitLab Terraform template.
- Add more jobs:
- Navigate into
CI/CD > Pipelinesand click
Run pipelinefor the
In the future, we’ll explore more Kubernetes topics:
- Use Renovate to keep deployments updated with GitLab CI/CD.
- CI/CD, IaC and GitOps with the GitLab Kubernetes Agent
- Hetzner storage volumes
- Monitoring with Prometheus, GitLab CI/CD deployments and much more :)
Enjoy the session! 🦊