

Easily deploy an SKS cluster on Exoscale with Terraform
source link: https://dev.to/camptocamp-ops/easily-deploy-an-sks-cluster-on-exoscale-with-terraform-3c3o
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Following the recent announcement of Exoscale's managed Kubernetes service, we gave it a test run to deploy our standard stack of tools. As usual, we wanted to do it "as Code", so we chose Terraform for the task.
Since the release of Exoscale's Terraform provider v0.22.0, it is now possible to create SKS clusters as code.
To deploy a cluster you'll need to create all these resources:
- An
exoscale_sks_cluster
, - One or more
exoscale_sks_nodepools
, - An
exoscale_affinity
per node pool to ensure that all nodes in a pools are in the same anti-affinity group in case of outage in an hypervisor, - An
exoscale_security_group
for your node pools, - An
exoscale_security_group_rule
to allow Calico traffic behind your nodes, - An
exoscale_security_group_rule
to allownodePorts
access from everywhere, - An
exoscale_security_group_rule
to allow access to logs and exec.
To ease the deployment of all these resources, we decided to write a Terraform module that we published on the Terraform registry.
In order to use it, simply copy this HCL code:
module "sks" {
source = "camptocamp/sks/exoscale"
version = "0.3.1"
name = "test"
zone = "de-fra-1"
nodepools = {
"router" = {
instance_type = "medium"
size = 2
},
"compute" = {
instance_type = "small"
size = 3
},
}
}
output "kubeconfig" {
value = module.sks.kubeconfig
sensitive = true
}
Export your API keys:
$ export EXOSCALE_API_KEY=...
$ export EXOSCALE_API_SECRET=...
Then run:
$ terraform apply
This will deploy an SKS cluster with 2 nodepools (one that we'll dedicate for our Ingress Controller and one to host our applications), one anti-affinity group per nodepool and a security group with proper rules so that everything runs properly (you'll still have to open access to http and https ports if needed).
You can retrieve the kubeconfig for the kube-admin user using this command:
$ terraform output -json kubeconfig | jq -r . > ~/.kube/config
NOTE: make sure to not overwrite a previous cluster configuration or prefer working with environment variables with KUBECONFIG=~/path/to/sks-config
You should then be able to connect to the cluster:
$ kubectl get pods --all-namespaces
And voilà.
Recommend
-
52
This is the third blog post in a three-part series about building, testing, and deploying a Clojure web application. You can find information on setting up previously mentioned applications like CircleCI in the ...
-
21
Provision your Azure environment with Terraform and Octopus Deploy 21 Mar 2020 My current project has reached the point where we have to manage our infrastructure in a more organized way rather than ad-hoc manual configurations.
-
12
Platform and cloud interoperability has come a long way. IaaS and unstructured PaaS options such as OpenStack and Kubernet...
-
166
terraform-aws-eks A terraform module to create a managed Kubernetes cluster on AWS EKS. Available through the Terraform registry. Inspired by and adapt...
-
10
sks-keyservers pool DNS records to be disabled effective immediately The announcement from the sks-keyservers.net website: This service is deprecated. This means it is no longer maintained, and new HKP...
-
8
How To Deploy EKS Cluster on AWS using TerraformSearch ComputingForGeeksElastic Kubernetes Service is a mana...
-
8
Install Vault Cluster in GKE via Helm, Terraform and BitBucket PipelinesMotivationThe management of secrets in an organisation holds a special place in the running of day to day activities of the business. All the way from access to...
-
6
Free Oracle Cloud Kubernetes cluster with Terraform New week has come so here we go. I’m gonna show you how I built a free Oracle Cloud Kubernetes cluster using Terraform. Here’s the previous piece of this article serie...
-
14
The Amazon Elastic Kubernetes Service (EKS) is the AWS service for deploying, managing, and scaling containerised applications with Kubernetes. In this tutorial, you will deploy an EKS cluster using Terraform. Then, you will configure...
-
6
Getting Started With Creating, Managing an AWS ECS Cluster With TerraformMay 15th 2022 new story...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK