Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Add AKS platform support
Browse files Browse the repository at this point in the history
Refs #215 #216

Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
  • Loading branch information
invidian committed Apr 2, 2020
1 parent 2a57662 commit f249636
Show file tree
Hide file tree
Showing 18 changed files with 1,061 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ VERSION :=
MOD ?= vendor
DOCS_DIR ?= docs/cli

ALL_BUILD_TAGS := "aws,packet,e2e,disruptivee2e,poste2e"
ALL_BUILD_TAGS := "aws,packet,aks,e2e,disruptivee2e,poste2e"

## Adds a '-dirty' suffix to version string if there are uncommitted changes
changes := $(shell git status --porcelain)
Expand Down
104 changes: 104 additions & 0 deletions ci/aks/aks-cluster.lokocfg.envsubst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
variable "cert_manager_email" {
default = "$EMAIL"
}
variable "cluster_name" {
default = "$CLUSTER_ID"
}

variable "aws_zone_id" {
default = "$AWS_DNS_ZONE_ID"
}

variable "aws_access_key_id" {
default = "$AWS_ACCESS_KEY_ID"
}

variable "aws_secret_access_key" {
default = "$AWS_SECRET_ACCESS_KEY"
}

variable "aws_dns_zone" {
default = "$AWS_DNS_ZONE"
}

variable "resource_group_name" {
default = "$CLUSTER_ID"
}

variable "grafana_admin_password" {
default = "admin"
}

variable "asset_dir" {
default = "~/lokoctl-assets"
}

variable "workers_count" {
default = 2
}

variable "workers_type" {
default = "Standard_D2_v2"
}

variable "location" {
default = "Germany West Central"
}

variable "worker_labels" {
default = {
"testing.io" = "yes",
"roleofnode" = "testing",
}
}

cluster "aks" {
asset_dir = pathexpand(var.asset_dir)
cluster_name = var.cluster_name

location = var.location
resource_group_name = var.resource_group_name

worker_pool "default" {
vm_size = var.workers_type
count = var.workers_count
labels = var.worker_labels
}

tags = {
"owner" = "LokomotiveCI"
}
}

component "prometheus-operator" {
grafana_admin_password = var.grafana_admin_password
disable_webhooks = true
}

component "contour" {
ingress_hosts = [
"httpbin.${var.cluster_name}.${var.aws_dns_zone}",
]
service_monitor = true
}

component "cert-manager" {
email = var.cert_manager_email
service_monitor = true
}

component "external-dns" {
policy = "sync"
owner_id = var.cluster_name
aws {
zone_id = var.aws_zone_id
aws_access_key_id = var.aws_access_key_id
aws_secret_access_key = var.aws_secret_access_key
}

service_monitor = true
}

component "httpbin" {
ingress_host = "httpbin.${var.cluster_name}.${var.aws_dns_zone}"
}
1 change: 1 addition & 0 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/spf13/viper"

// Register platforms by adding an anonymous import.
_ "github.com/kinvolk/lokomotive/pkg/platform/aks"
_ "github.com/kinvolk/lokomotive/pkg/platform/aws"
_ "github.com/kinvolk/lokomotive/pkg/platform/baremetal"
_ "github.com/kinvolk/lokomotive/pkg/platform/packet"
Expand Down
64 changes: 64 additions & 0 deletions examples/aks-testing/cluster.lokocfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
variable "subscription_id" {}
variable "tenant_id" {}
variable "grafana_admin_password" {}
variable "resource_group_name" {}
variable "cert_manager_email" {}

variable "manage_resource_group" {
default = true
}

variable "application_name" {
default = ""
}

variable "asset_dir" {
default = "./lokomotive-assets"
}

variable "cluster_name" {
default = "lokomotive-cluster"
}

variable "workers_count" {
default = 1
}

variable "workers_type" {
default = "Standard_D2_v2"
}

variable "location" {
default = "West Europe"
}

cluster "aks" {
asset_dir = pathexpand(var.asset_dir)
cluster_name = var.cluster_name

subscription_id = var.subscription_id
tenant_id = var.tenant_id
location = var.location
resource_group_name = var.resource_group_name
application_name = var.application_name
manage_resource_group = var.manage_resource_group

worker_pool "default" {
vm_size = var.workers_type
count = var.workers_count
}
}

component "prometheus-operator" {
grafana_admin_password = var.grafana_admin_password
disable_webhooks = true
}

component "cert-manager" {
email = var.cert_manager_email
service_monitor = true
}

component "contour" {
service_monitor = true
}
Loading

0 comments on commit f249636

Please sign in to comment.