konstructio / kubefirst-api

Kubefirst API that serves console frontend
MIT License
14 stars 14 forks source link

feat(azure): create azure cluster #428

Closed mrsimonemms closed 2 weeks ago

mrsimonemms commented 2 months ago

Description

Adds support for Azure

Related Issue(s)

Fixes #458

How to test

This assumes you're running the console, API and CLI in local debug mode.

  1. Create personal keys for our Terraform service principal.
  2. Set ARM_CLIENT_ID, ARM_CLIENT_SECRET, ARM_TENANT_ID and ARM_SUBSCRIPTION_ID envvars
  3. Run your desired command in the CLI

Example CLI commands:

Azure DNS

You will need to create a DNS Zone with your desired domain registered. I have the domains registered elsewhere and setup a subdomain in Azure (eg, azure.domain.com) and then setup an NS record on my domain registrar.

Azure puts everything in resource groups, which is a logical grouping of multiple resources. You will need to provide the name of that in --dns-azure-resource-group.

go run . beta azure create \
  --alerts-email <your-email> \
  --github-org <github-org> \
  --domain-name <domain-name> \
  --gitops-template-branch sje/azure \
  --dns-azure-resource-group <dns-zone-resource-group>

Cloudflare

go run . beta azure create \
  --alerts-email <your-email> \
  --github-org <github-org> \
  --domain-name <domain> \
  --gitops-template-branch sje/azure \
  --cluster-name <cluster-name> \
  --dns-provider cloudflare \
  --cloud-region <region> \
  --subdomain <cloudflare-subdomain>