Skip to content

Example of deploying kubernetes cluster on Outscale using Terraform and RKE

Notifications You must be signed in to change notification settings

jerome-jutteau/kubernetes-with-rke

Repository files navigation

Kubernetes with RKE

This reprository contain a way to deploy a kubernetes cluster using rke on Outscale cloud provider.

Architecture

The Kubernetes cluster is deployed inside a Net with three Subnets:

  • One subnet (10.0.0.0/24) containing a bastion host, and a NAT Service
  • One subnet (10.0.0.1/24) containing control plane nodes
  • One subnet (10.0.0.2/24) containing woker nodes

Prerequisite

Configuration

export TF_VAR_access_key_id="myaccesskey"
export TF_VAR_secret_key_id="mysecretkey"
export TF_VAR_region="eu-west-2"

By editing 'terraform.tfvars', you can adjust the number of worker/control-plane nodes, size of node and more.

Deploy

First deploy infrastructure resources:

terraform init
terraform apply

Then you should be able to deploy RKE using:

rke up --config rke/cluster.yml

You can now copy your kubeconfig file to bastion host:

scp -F ssh_config rke/kube_config_cluster.yml bastion:.kube/config

Connect to bastion and test kubeapi-server:

ssh -F ssh_config bastion
kubectl get nodes

If needed, you can connect to any worker or control-plane node:

ssh -F ssh_config worker-0
ssh -F ssh_config control-plane-0

Smoke Test

Smoke testing our newly created Kubernetes cluster can be done very similarely to kubernetes-the-hard-way.

Note that workers has no public IP so you can test Nodeport service from bastion.

Cleaning Up

Just run terraform destroy.

Alternatively, you can manually cleanup your resources if something goes wrong:

  • Connect to cockpit interface
  • Go to VPC->VPCs, Select the created VPC, click the "Teardown" button and validate.
  • Go to Network/Security->Keypairs and delete Keypairs created for each node
  • Go to Network/Security->External Ips and delete EIP created for each control-planes
  • Go to Compute->Outscale Machine Image and delete created image

Contributing

Feel free to report an issue.

About

Example of deploying kubernetes cluster on Outscale using Terraform and RKE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages