{"id":14957765,"url":"https://github.com/philippechepy/exoscale-kubernetes-crio","last_synced_at":"2026-01-05T02:03:41.943Z","repository":{"id":118531339,"uuid":"322111424","full_name":"PhilippeChepy/exoscale-kubernetes-crio","owner":"PhilippeChepy","description":"Installation of Kubernetes with CRI-O on Exoscale platform through Packer and Terraform","archived":false,"fork":false,"pushed_at":"2021-02-05T17:31:37.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-21T08:17:11.156Z","etag":null,"topics":["cluster","cluster-autoscaler","cri-o","exoscale","hashicorp-packer","hashicorp-terraform","kubeadm","kubernetes","kubernetes-cluster","packer","terraform"],"latest_commit_sha":null,"homepage":"https://easyadmin.tech/projets/installation-un-cluster-kubernetes-auto-scalable-exoscale-avec-terraform-et-packer","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhilippeChepy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-16T21:55:40.000Z","updated_at":"2025-02-08T09:33:42.000Z","dependencies_parsed_at":"2023-07-03T22:46:05.664Z","dependency_job_id":null,"html_url":"https://github.com/PhilippeChepy/exoscale-kubernetes-crio","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":0.07692307692307687,"last_synced_commit":"678ecf7576843ba2dfe31b18acce486488980fcb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippeChepy%2Fexoscale-kubernetes-crio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippeChepy%2Fexoscale-kubernetes-crio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippeChepy%2Fexoscale-kubernetes-crio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhilippeChepy%2Fexoscale-kubernetes-crio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhilippeChepy","download_url":"https://codeload.github.com/PhilippeChepy/exoscale-kubernetes-crio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244759961,"owners_count":20505716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","cluster-autoscaler","cri-o","exoscale","hashicorp-packer","hashicorp-terraform","kubeadm","kubernetes","kubernetes-cluster","packer","terraform"],"created_at":"2024-09-24T13:15:33.040Z","updated_at":"2026-01-05T02:03:41.863Z","avatar_url":"https://github.com/PhilippeChepy.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autoscalable Kubernetes cluster at Exoscale, using Packer and Terraform\n\n![Kubernetes](.documentation/images/kubernetes-logo.svg)\n\n## TL;DR\n\nThe purpose of this repository is to install [Kubernetes](https://kubernetes.io) 1.20 with support for cluster autoscaling.\nThe cloud provider used is [Exoscale](https://www.exoscale.com). However this repository can be adapted to other providers.\n\nThe container runtime is [CRI-O](https://cri-o.io).\nThe network is managed by [Calico](https://www.projectcalico.org). It was chosen for its ease of installation (by default), and its polyvalence. Indeed, its performance is excellent in most use-cases compared to other alternatives, while keeping a reasonable resource consumption.\n\nTwo steps are involved in the installation of the cluster:\n\n* The creation of a system image using [Packer](https://www.packer.io) and the Exoscale plugin. This image contains the packages for Kubernetes, [kubeadm](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/) and CRI-O.\n* The provisioning of the cluster using [Terraform](https://www.terraform.io) and the Exoscale provider (blazingly fast!)\n\n## Explanations\n\nThis repository is explained in depth (in French) here :\n\n* [Partie 1 : Préparation du dépôt](https://easyadmin.tech/tutoriel-comment-deployer-kubernetes-chez-exoscale-avec-packer-et-terraform-preparation-depot)\n* [Partie 2 : Création d'une image de machine virtuelle](https://easyadmin.tech/tutoriel-comment-deployer-kubernetes-chez-exoscale-avec-packer-et-terraform-creation-image-machine-virtuelle)\n* [Partie 3 : Création de l'infrastructure](https://easyadmin.tech/tutoriel-comment-deployer-kubernetes-chez-exoscale-avec-packer-et-terraform-creation-infrastructure)\n\n## Installation\n\nYou must have docker installed locally in order to make the work done. Packer and Terraform are run using containers.\n\n### First step: building the system image\n\n```shell\n# Download the Exoscale plugin for packer\nmake packer.deps\n\n# Build and upload Kubernetes base system image in your Exoscale account's custom templates\n# This step can take up to 10~15mn\nmake packer.build\n```\n\n### Update terraform variables\n\nNext, you must create a `terraform/terraform.tfvars` file containing the template id you just built with packer (visible in the previous command output, or in the Exoscale interface).\n\n```hcl\ncontrol_plane_template_id = \"...\"\nnode_template_id = \"...\"\n```\n\n### Build the final infrastructure\n\n```shell\n# Initialize terraform\nmake terraform.init\n\n# Create the Kubernetes cluster\n# This process usually takes 1 to 2 minutes to complete\nmake terraform.apply\n```\n\n## Connection to control-plane\n\n```shell\n# After provisioning your cluster\nmake ssh-cp\n```\n\nAfter connecting to the control-plane, you can play with kubectl.\n\n# Infrastructure design\n\n## Network\n\nThe communication between nodes is done via a managed private network (`exoscale_network` in Terraform).\n\nAll virtual machines are protected by a firewall which allows access to the necessary ports from the public network (`exoscale_security_group` and `exoscale_security_group_rules`). The default policy is to block all other connections (as in the Exoscale platform).\n\n* The control-plane server allows inbound connections on port `22` (ssh) only.\n* Workers allow incoming connections on ports `30000` to `32767` (TCP and UDP). Those ports match Kubernetes' NodePort range and allow the implementation of various `Services`.\n\n* Outgoing connections are allowed from all virtual machines to the following ports:\nTCP: `22` (SSH), `80` (HTTP), `443` (HTTPS), `11371` (HKP)\nUDP: `53` (DNS)\n\n## Virtual Machines\n\nThe Kubernetes cluster consists in a single virtual machine for the control-plane (`exoscale_compute` in Terraform). This machine hosts the Kubernetes API server along with Etcd.\n\nWorkers are implemented as an instance pool (`exoscale_instance_pool` in Terraform). This pool is configured to contain a single agent upon creation of the infrastructure. The autoscaler cluster will automatically increase the size of the instance pool as soon your workloads need it.\n\nThe control-plane server initializes its own services via a `kubeadm init` command.\nNew worker nodes (belonging to the instance pool) will automatically connect to the control-plane server in order to join the Kubernetes cluster (via `kubeadm`) on first boot.\n\nThe initialization of each virtual machine is controlled by cloud-init at the first instance startup.\nSee cloud-init [here for the control-plane](terraform/templates/control-plane/cloud-init.yaml), and [here for the workers](terraform/templates/nodes/cloud-init.yaml)\n\n# Limitations\n\n* Be careful when using this script in production (the cluster autoscaler has not been extensively tested in this configuration). **Use at your own risks!**\n\n# References\n\n* Kubernetes\n  * [Website](https://kubernetes.io)\n  * [Documentation](https://kubernetes.io/docs/home/)\n* CRI-O\n  * [Website](https://cri-o.io)\n* Calico\n  * [Website](https://www.projectcalico.org)\n* Exoscale\n  * [Website](https://www.exoscale.com)\n  * [Documentation](https://community.exoscale.com)\n  * [Cluster autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/exoscale)\n* Packer\n  * [Website](https://www.packer.io)\n  * [Documentation](https://www.packer.io/docs)\n  * [Creating Custom Templates Using Packer](https://www.exoscale.com/syslog/creating-custom-templates-using-packer/)\n* Terraform\n  * [Website](https://www.terraform.io)\n  * [Documentation](https://www.terraform.io/docs/index.html)\n  * [Exoscale Provider](https://registry.terraform.io/providers/exoscale/exoscale/latest/docs)\n\n# Author\n\nPhilippe Chepy\n\n* Github: [@PhilippeChepy](https://github.com/PhilippeChepy)\n* LinkedIn: [@philippe-chepy](https://www.linkedin.com/in/philippe-chepy/)\n* Website [EasyAdmin](https://easyadmin.tech)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippechepy%2Fexoscale-kubernetes-crio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilippechepy%2Fexoscale-kubernetes-crio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilippechepy%2Fexoscale-kubernetes-crio/lists"}