Skip to content

Commit 17fb85e

Browse files
committed
docs: add AKS cluster module
1 parent 4d72cc8 commit 17fb85e

File tree

10 files changed

+43
-36
lines changed

10 files changed

+43
-36
lines changed

antora-playbook.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ content:
5555
- "!v1.0.0"
5656
- "!v1.0.0-alpha.*"
5757
- "!v{3..4}.{0..1}.{0..2}"
58+
- url: https://github.com/camptocamp/devops-stack-module-cluster-aks.git
59+
start_path: docs
60+
branches: []
61+
tags:
62+
- "v@({1..9})*({0..9}).+({0..9}).*"
63+
# Exclude versions without proper folder structure or with generation errors
64+
- "!v1.0.0-alpha.*"
5865
- url: https://github.com/camptocamp/devops-stack-module-cluster-eks.git
5966
start_path: docs
6067
branches: []

docs/modules/ROOT/nav.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,26 @@
2222
** xref:ROOT:contributing/project_board.adoc[Project Board]
2323
2424
.*Cluster Modules*
25+
* xref:aks:ROOT:README.adoc[Azure AKS]
2526
* xref:eks:ROOT:README.adoc[Amazon EKS]
2627
* xref:sks:ROOT:README.adoc[Exoscale SKS]
2728
* xref:kind:ROOT:README.adoc[KinD]
2829
2930
.*Chart Modules*
30-
* xref:aad-pod-identity:ROOT:README.adoc[AAD Pod Identity]
3131
* xref:application:ROOT:README.adoc[Application]
3232
* xref:applicationset:ROOT:README.adoc[ApplicationSet]
3333
* xref:argocd:ROOT:README.adoc[Argo CD]
34-
* xref:azure-workload-identity:ROOT:README.adoc[Azure Workload Identity]
3534
* xref:oidc-aws-cognito:ROOT:README.adoc[AWS Cognito OIDC]
3635
* xref:cert-manager:ROOT:README.adoc[cert-manager]
3736
* xref:dex:ROOT:README.adoc[Dex]
3837
* xref:ebs-csi-driver:ROOT:README.adoc[EBS CSI Driver]
3938
* xref:efs-csi-driver:ROOT:README.adoc[EFS CSI Driver]
40-
* xref:grafana:ROOT:README.adoc[Grafana]
4139
* xref:keycloak:ROOT:README.adoc[Keycloak]
4240
* xref:kube-prometheus-stack:ROOT:README.adoc[kube-prometheus-stack]
4341
* xref:loki:ROOT:README.adoc[Loki]
4442
* xref:longhorn:ROOT:README.adoc[Longhorn]
4543
* xref:metallb:ROOT:README.adoc[MetalLB]
44+
* xref:metrics-server:ROOT:README.adoc[Metrics Server]
4645
* xref:minio:ROOT:README.adoc[MinIO]
4746
* xref:rclone:ROOT:README.adoc[Rclone]
4847
* xref:thanos:ROOT:README.adoc[Thanos]

docs/modules/ROOT/pages/index.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ image::devops-stack-logo_large.png[DevOps Stack]
1111

1212
The DevOps Stack provides a standardized deployment Kubernetes Platform, bringing together automated Provisioning as Code, Continuous Application Deployment, and readily-made configurations for the best Cloud Native tools in the industry.
1313

14-
TIP: The easiest way to get started with the DevOps Stack is to follow the tutorial on the xref:tutorials/deploy_kind.adoc[Deployment on KinD] page. This tutorial you will leave you with a fully operational https://kind.sigs.k8s.io/[KinD] playground on your local machine.
14+
TIP: The easiest way to get started with the DevOps Stack is to follow the tutorial on the xref:ROOT:tutorials/deploy_kind.adoc[Deployment on KinD] page. This tutorial you will leave you with a fully operational https://kind.sigs.k8s.io/[KinD] playground on your local machine.
1515

1616
== Project Sponsor
1717

examples/aks/dns.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Use these resources if you are creating the DNS zone using this code.
1+
# Use these resources if you are creating the DNS zone using this code specifically for this deployment (so we will
2+
# deploy the DNS zone on the same resource group).
23

34
resource "azurerm_dns_zone" "this" {
45
name = local.base_domain
@@ -11,7 +12,7 @@ resource "azurerm_dns_cname_record" "wildcard" {
1112

1213
zone_name = resource.azurerm_dns_zone.this.name
1314
name = "*.apps"
14-
resource_group_name = "default"
15+
resource_group_name = resource.azurerm_resource_group.main.name
1516
ttl = 300
1617
record = format("%s-%s.%s.cloudapp.azure.com.", module.aks.cluster_name, replace(resource.azurerm_dns_zone.this.name, ".", "-"), resource.azurerm_resource_group.main.location)
1718
}
@@ -20,7 +21,7 @@ resource "azurerm_dns_cname_record" "wildcard" {
2021

2122
# data "azurerm_dns_zone" "this" {
2223
# name = local.base_domain
23-
# resource_group_name = "default"
24+
# resource_group_name = local.default_resource_group
2425
# }
2526

2627
# # This resource should be deactivated if there are multiple development clusters on the same account.
@@ -29,7 +30,7 @@ resource "azurerm_dns_cname_record" "wildcard" {
2930

3031
# zone_name = data.azurerm_dns_zone.this.name
3132
# name = "*.apps"
32-
# resource_group_name = "default"
33+
# resource_group_name = local.default_resource_group
3334
# ttl = 300
3435
# record = format("%s-%s.%s.cloudapp.azure.com.", module.aks.cluster_name, replace(data.azurerm_dns_zone.this.name, ".", "-"), resource.azurerm_resource_group.main.location)
3536
# }

examples/aks/locals.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
locals {
22
# Parameters for the resources that are created outside this code, but still on the Azure subscription where the DevOps Stack will be deployed.
3-
default_resource_group = "YOUR_DEFAULT_RESOURCE_GROUP" # The default resource group where the Key Vault with the Azure AD application credentials is located.
4-
default_key_vault = "YOUR_KEY_VAULT_NAME" # The name of the Key Vault with the Azure AD application credentials.
5-
oidc_application_name = "YOUR_APPLICATION_NAME" # The name of the Azure AD application that will be used for OIDC authentication.
3+
default_resource_group = "YOUR_DEFAULT_RESOURCE_GROUP" # The default resource group where the Key Vault with the Azure AD application credentials is located.
4+
default_key_vault = "YOUR_KEY_VAULT_NAME" # The name of the Key Vault with the Azure AD application credentials.
5+
oidc_application_name = "YOUR_APPLICATION_NAME" # The name of the Azure AD application that will be used for OIDC authentication. cluster_admins_group_object_id = "38a1908d-0ccd-4acc-99d5-7f0228289752"
6+
cluster_admins_group_object_id = "YOUR_CLUSTER_ADMINS_GROUP_OBJECT_ID"
67

78
# Parameters used for this deployment of the DevOps Stack.
89
common_resource_group = "YOUR_COMMON_RESOURCE_GROUP" # The resource group where the common resources will reside. Must be unique for each DevOps Stack deployment in a single Azure subscription.

examples/aks/main.tf

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ data "azuread_client_config" "current" {}
22

33
data "azurerm_client_config" "current" {}
44

5-
data "azuread_group" "YOUR_GROUP_NAME" {
6-
object_id = "YOUR_GROUP_OBJECT_ID"
5+
data "azuread_group" "cluster_admins" {
6+
object_id = local.cluster_admins_group_object_id
77
}
88

99
resource "azurerm_resource_group" "main" {
@@ -31,19 +31,8 @@ module "aks" {
3131
kubernetes_version = local.kubernetes_version
3232
sku_tier = local.sku_tier
3333

34-
automatic_channel_upgrade = "patch"
35-
maintenance_window = {
36-
allowed = [
37-
{
38-
day = "Sunday",
39-
hours = [22, 23]
40-
},
41-
]
42-
not_allowed = []
43-
}
44-
4534
rbac_aad_admin_group_object_ids = [
46-
data.azuread_group.YOUR_GROUP_NAME.object_id
35+
data.azuread_group.cluster_admins.object_id
4736
]
4837

4938
# Extra node pools
@@ -236,7 +225,7 @@ module "argocd" {
236225
rbac = {
237226
policy_csv = <<-EOT
238227
g, pipeline, role:admin
239-
g, ${data.azuread_group.YOUR_GROUP_NAME.object_id}, role:admin
228+
g, ${data.azuread_group.cluster_admins.object_id}, role:admin
240229
EOT
241230
}
242231

examples/aks/requirements/application.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
locals {
2+
# You can add here any user that should be owner of the Enterprise Application. The key can be anything an is used for
3+
# identification on the for each below, the value must be a valid object ID on your Azure tenant.
24
application_owners = {
3-
"YOUR_GROUP_NAME" = "YOUR_GROUP_OBJECT_ID",
5+
"${trimspace(data.azuread_group.admins.display_name)}" = data.azuread_group.admins.object_id,
46
}
57
}
68

79
resource "azuread_application_registration" "default" {
8-
display_name = "YOUR_APPLICATION_NAME"
10+
display_name = local.oidc_application_name
911

1012
group_membership_claims = ["SecurityGroup"]
1113
}

examples/aks/requirements/dns.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
resource "azurerm_dns_zone" "this" {
2-
name = "your.domain.here"
2+
name = local.base_domain
33
resource_group_name = resource.azurerm_resource_group.default.name
44
}

examples/aks/requirements/locals.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
locals {
2+
location = "YOUR_LOCATION"
3+
base_domain = "your.domain.here"
4+
default_key_vault = "YOUR_KEY_VAULT_NAME" # The name of the Key Vault with the Azure AD application credentials.
5+
default_resource_group = "YOUR_DEFAULT_RESOURCE_GROUP" # The default resource group where the Key Vault with the Azure AD application credentials will reside.
6+
oidc_application_name = "YOUR_APPLICATION_NAME" # The name of the Azure AD application that will be used for OIDC authentication.
7+
admins_group_object_id = "YOUR_CLUSTER_ADMINS_GROUP_OBJECT_ID"
8+
}

examples/aks/requirements/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ data "azuread_client_config" "current" {}
33
data "azurerm_client_config" "current" {}
44

55
resource "azurerm_resource_group" "default" {
6-
name = "default"
7-
location = "YOUR_LOCATION"
6+
name = local.default_resource_group
7+
location = local.location
88
}
99

1010
resource "azurerm_key_vault" "main" {
11-
name = "YOUR_KEY_VAULT_NAME"
11+
name = local.default_key_vault
1212
location = resource.azurerm_resource_group.default.location
1313
resource_group_name = resource.azurerm_resource_group.default.name
1414
sku_name = "standard"
@@ -25,16 +25,16 @@ resource "azurerm_key_vault" "main" {
2525
]
2626
}
2727

28-
data "azuread_group" "YOUR_GROUP_NAME" {
29-
object_id = "YOUR_GROUP_OBJECT_ID"
28+
data "azuread_group" "admins" {
29+
object_id = local.admins_group_object_id
3030
}
3131

32-
resource "azurerm_role_assignment" "YOUR_GROUP_NAME" {
32+
resource "azurerm_role_assignment" "admins" {
3333
for_each = toset([
3434
"Key Vault Reader", # Permissions required to read Key Vault secrets
3535
"Key Vault Secrets User", # Permissions required to read contents of Key Vault secrets
3636
])
37-
principal_id = data.azuread_group.YOUR_GROUP_NAME.object_id
37+
principal_id = data.azuread_group.admins.object_id
3838
role_definition_name = each.value
3939
scope = "/subscriptions/${data.azurerm_client_config.current.subscription_id}"
4040
}

0 commit comments

Comments
 (0)