Git Product home page Git Product logo

dsop-rke2's Introduction

This project includes the Terraform configuration to deploy an RKE2 cluster in Azure.

Notes

  1. The terraform script does not work within Azure Cloudshell because of a Cloudshell/Terraform AzureRM provider issue.
  2. A .devcontainer is provided with all dependencies installed. It is not required to be used.
  3. The .devcontainer can be easily utilised from VS Code.
  4. It is expected that the cloud target has been set using az cloud set -name AzureUSGovernment and an az login and subscription setting has been performed.
  5. The .tfvar cloud variable values are determined by the Kubernetes azure cloud provider which utilises the go-autorest library which doesn't use Azure defined cloud names.

Supported Azure regions

  1. USGovVirginia

Unsuported Azure regions

  1. USGovArizona - LocationNotSupportAvailabilityZones

Getting Started

  1. The dev environment with all the development requirements can be set up by starting the devcontainer in .devcontainer.

  2. An example usage of this module can be found in the example folder

Connecting to RKE2

This section assumes you have a publicly accessible cluster, i.e. you have set server_public_ip to true

A script is provided to download the kubeconfig file needed to access the cluster, from KeyVault to the local machine, it also sets KUBECONFIG to point to the new kubeconfig

source scripts/fetch-kubeconfig.sh

Note. You must run this from the location where Terraform apply has been run and there is a terraform.tfstate file Note. You must source the script, also you may have to wait for a minute or two after deploying the cluster before the kubeconfig is ready

Now you can run kubectl commands against the cluster as normal, e.g. kubectl get nodes or kubectl get pods -A to see the status and health of the cluster.

Smoke Tests

A set of simple smoke tests is provided to validate the cluster is healthy and can communicate with Azure

See Smoke Tests for Bare Metal Kubernetes on Azure

SSH to Servers (Control Plane)

If you set server_open_ssh_public to true, then SSH will be allowed onto the server nodes, through the control plane load balancer.

Note. This is only recommended when troubleshooting RKE2 itself, and associated configuration such as the Azure cloud provider. For normal operation SSH access is not required.

This is done with a Azure Load Balancer NAT pool, the pool maps ports from 5000 onwards to port 22 on each of the instances, e.g.

  • Port 5000 -> port 22 on instance 0
  • Port 5001 -> port 22 on instance 1
  • Port 5002 -> port 22 on instance 2
  • etc

A script is provided that will download the SSH private key from KeyVault and tell you the public IP you need to use. The SSH username is rke2

./scripts/fetch-ssh-key.sh

Note. You must run this from the location where Terraform apply has been run and there is a terraform.tfstate file

Note. For reasons unknown sometimes the scale set takes some time to settle down, and even with a single instance, it might not be instance 0, it can be 1 or even 2, so try ports 5001 and 5002 if 5000 doesn't work

dsop-rke2's People

Contributors

marlinspike avatar

Stargazers

Tim avatar

Watchers

 avatar James Cloos avatar

Forkers

rguthriemsft

dsop-rke2's Issues

RKE2-init fails to upload kubeconfig to keyvault

In running through the example, the cloud init script succeeds in provisioning the server role but fails to upload kubeconfig to keyvault in public cloud. It seems to have the right permissions but here is log:

  • Connection #0 to host <my_key_vault>.vault.azure.net left intact
    {"error":{"code":"Unauthorized","message":"[BearerReadAccessTokenFailed] Error validating token: 'S2S12005'."}}
    [INFO] Beginning user defined post userdata
    [INFO] Ending user defined post userdata

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.