• Kubernetes

  • Terraform

  • Rancher

  • Scaleway

  • Cloudflare






We mentioned

























Why Rancher?












Let’s get started!








  • Get a Scaleway account
  • Prepare a Cloudflare account
  • Set up at least 1 zone in Cloudflare (you can get a free service domain like Freenom)
  • Clone kenfdev/ Rancher-Scaleway warehouse
  • Install terraform
  • Install kubectl


















Get information from Scaleway
































Get an API token from Cloudflare

























Prepare Terraform resources for the Rancher server








































  • Scw_token – Your Scaleway Secret Token
  • Scw_org – your Scaleway Organization ID
  • Admin_password – the password you will use on the Rancher server
  • Rancher_server_url – THE URL used by the Rancher server. Terraform will set up a Rancher subdomain for your CloudFlare Zone. So if your zone is named example.com, terraform creates a record link to rancher.example.com.
  • Cloudflare_email – The Email in your Cloudflare
  • Cloudflare_token – Your Cloudflare API token
  • Cloudflare_zone – Your Cloudflare zone












Deploy the Rancher Server



























  • 1 server (Rancher server)
  • 1 user data to boot the Rancher server for the cloud-init process
  • One security group
  • A rule that is attached to a security group to control traffic
  • 1 Cloudflare DNS record pointing to the Rancher server



















































rancher.your.zone/



















































Prepare Terraform resources for the Rancher agent


































  • Rancher_server_address — The address of the Rancher Serve. It could be an IP address or a domain name, but I recommend that you set it to a domain name in the previous step
  • Count_agent_all_nodes – Counts the number of created nodes that have all roles (etcd, Controlplane, worker). If you are just trying out the Kubernetes cluster, one is enough.
  • Count_agent_etcd_nodes – Counts the number of created nodes that have an ETCD role
  • Count_agent_controlplane – Counts the number of created nodes that have the ControlPlane role
  • Count_agent_worker_nodes – Counts the number of created nodes that have worker roles






Deploy the Rancher agent







































































Test the Ingress controller

























default.your.zone



















Access the cluster through Kubectl
































































Clear cut












Break the Rancher proxy and Cloudflare resources



















Destroy the Rancher server and Cloudflare resources