Skip to content

Commit

Permalink
Merge pull request #2 from mastodon/oidc
Browse files Browse the repository at this point in the history
Add OIDC provider configuration
  • Loading branch information
timetinytim committed May 10, 2024
2 parents c2b8f00 + 0f9ebe6 commit 90584af
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@ resource "ovh_cloud_project_kube_nodepool" "node_pool" {
max_nodes = var.node_pools[count.index].nodes
min_nodes = var.node_pools[count.index].nodes
}

resource "ovh_cloud_project_kube_oidc" "oidc" {
count = var.oidc_provider_url != "" ? 1 : 0

service_name = var.project_id
kube_id = ovh_cloud_project_kube.cluster.id

client_id = var.oidc_client_id
issuer_url = var.oidc_provider_url

oidc_username_claim = var.oidc_username_claim
oidc_username_prefix = var.oidc_username_prefix
oidc_groups_claim = var.oidc_groups_claim
oidc_groups_prefix = var.oidc_groups_prefix
}
38 changes: 38 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,41 @@ variable "network_gateway_model" {
error_message = "Valid values for network_gateway_model are (s, m, l)"
}
}

# OIDC settings

variable "oidc_provider_url" {
description = "URL to use for OIDC authentication. Enables OIDC if specified."
type = string
default = ""
}

variable "oidc_client_id" {
description = "OIDC client ID to give the cluster for login."
type = string
default = ""
}

variable "oidc_username_claim" {
description = "OIDC Property to use for username."
type = string
default = "email"
}

variable "oidc_username_prefix" {
description = "Prefix to add to all usernames connecting to the cluster."
type = string
default = ""
}

variable "oidc_groups_claim" {
description = "Groups to include in the OIDC claim."
type = list(string)
default = []
}

variable "oidc_groups_prefix" {
description = "Prefix to add to all groups connecting to the cluster."
type = string
default = ""
}

0 comments on commit 90584af

Please sign in to comment.