From d392b0f561a6df2ae43e42bd3e9ebbe371093057 Mon Sep 17 00:00:00 2001
From: Denis Mishin This value is referred to as the redirect_url in the OpenIDConnect and OAuth2 specs. Defaults to /oauth2/callback
\n
Ingress
for this\n\t\tvirtual
+ route, as it is handled by Pomerium internally. certificates
.\n\t\tIf
+ you use cert-manager
with HTTP01
challenge,\n\t\tyou
+ may use pomerium
ingressClass
to solve
+ it.
ca.crt
+ containing a CA certificate.
+ items:
+ type: string
+ type: array
+ certificates:
+ description: Certificates is a list of secrets of type TLS to use
+ format: namespace/name
+ items:
+ type: string
+ type: array
+ cookie:
+ description: Cookie defines Pomerium session cookie options.
+ properties:
+ domain:
+ description: |-
+ Domain defaults to the same host that set the cookie.
+ If you specify the domain explicitly, then subdomains would also be included.
+ type: string
+ expire:
+ description: |-
+ Expire sets cookie and Pomerium session expiration time.
+ Once session expires, users would have to re-login.
+ If you change this parameter, existing sessions are not affected.
+ See Session Management + (Enterprise) for a more fine-grained session controls.
+Defaults to 14 hours.
+ format: duration + type: string + httpOnly: + description: |- + HTTPOnly if set tofalse
, the cookie would be accessible from within the JavaScript.
+ Defaults to true
.
+ type: boolean
+ name:
+ description: |-
+ Name sets the Pomerium session cookie name.
+ Defaults to _pomerium
+ type: string
+ sameSite:
+ description: |-
+ SameSite sets the SameSite option for cookies.
+ Defaults to
.
+ enum:
+ - strict
+ - lax
+ - none
+ type: string
+ type: object
+ identityProvider:
+ description: |-
+ IdentityProvider configure single-sign-on authentication and user identity details
+ by integrating with your Identity Provider
+ properties:
+ provider:
+ description: |-
+ Provider is the short-hand name of a built-in OpenID Connect (oidc) identity provider to be used for authentication.
+ To use a generic provider, set to oidc
.
+ enum:
+ - auth0
+ - azure
+ - github
+ - gitlab
+ - google
+ - oidc
+ - okta
+ - onelogin
+ - ping
+ type: string
+ refreshDirectory:
+ description: |-
+ RefreshDirectory is no longer supported,
+ please see Upgrade Guide.
+ properties:
+ interval:
+ description: interval is the time that pomerium will sync
+ your IDP directory.
+ format: duration
+ type: string
+ timeout:
+ description: timeout is the maximum time allowed each run.
+ format: duration
+ type: string
+ required:
+ - interval
+ - timeout
+ type: object
+ requestParams:
+ additionalProperties:
+ type: string
+ description: RequestParams to be added as part of a sign-in request
+ using OAuth2 code flow.
+ format: namespace/name
+ type: object
+ requestParamsSecret:
+ description: RequestParamsSecret is a reference to a secret for
+ additional parameters you'd prefer not to provide in plaintext.
+ format: namespace/name
+ type: string
+ scopes:
+ description: |-
+ Scopes Identity provider scopes correspond to access privilege scopes
+ as defined in Section 3.3 of OAuth 2.0 RFC6749.
+ items:
+ type: string
+ type: array
+ secret:
+ description: |-
+ Secret containing IdP provider specific parameters.
+ and must contain at least client_id
and client_secret
values.
+ format: namespace/name
+ minLength: 1
+ type: string
+ serviceAccountFromSecret:
+ description: |-
+ ServiceAccountFromSecret is no longer supported,
+ see Upgrade Guide.
+ type: string
+ url:
+ description: |-
+ URL is the base path to an identity provider's OpenID connect discovery document.
+ See Identity Providers guides for details.
+ format: uri
+ pattern: ^https://
+ type: string
+ required:
+ - provider
+ - secret
+ type: object
+ jwtClaimHeaders:
+ additionalProperties:
+ type: string
+ description: |-
+ JWTClaimHeaders convert claims from the assertion token
+ into HTTP headers and adds them into JWT assertion header.
+ Please make sure to read
+
+ Getting User Identity guide.
+ type: object
+ passIdentityHeaders:
+ description: PassIdentityHeaders sets the pass
+ identity headers option.
+ type: boolean
+ programmaticRedirectDomains:
+ description: |-
+ ProgrammaticRedirectDomains specifies a list of domains that can be used for
+ programmatic redirects.
+ items:
+ type: string
+ type: array
+ runtimeFlags:
+ additionalProperties:
+ type: boolean
+ description: RuntimeFlags sets the runtime
+ flags to enable/disable certain features.
+ type: object
+ secrets:
+ description: "Secrets references a Secret with Pomerium bootstrap
+ parameters.\n\n\n\n
shared_secret
\n\t\t-
+ secures inter-Pomerium service communications.\n\tcookie_secret
\n\t\t-
+ encrypts Pomerium session browser cookie.\n\t\tSee also other Cookie parameters.\n\tsigning_key
\n\t\tsigns
+ Pomerium JWT assertion header. See\n\t\tGetting
+ the user's identity\n\t\tguide.\n\t\nIn
+ a default Pomerium installation manifest, they would be generated
+ via a\none-time
+ job\nand stored in a pomerium/bootstrap
Secret.\nYou
+ may re-run the job to rotate the secrets, or update the Secret values
+ manually.\n
ca.crt
containing CA certificate
+ that, if specified, would be used to populate sslrootcert
parameter of the connection string.
+ format: namespace/name
+ minLength: 1
+ type: string
+ secret:
+ description: |-
+ Secret specifies a name of a Secret that must contain
+ connection
key. See
+ DSN Format and Parameters.
+ Do not set sslrootcert
, sslcert
and sslkey
via connection string,
+ use tlsSecret
and caSecret
CRD options instead.
+ format: namespace/name
+ minLength: 1
+ type: string
+ tlsSecret:
+ description: |-
+ TLSSecret should refer to a k8s secret of type kubernetes.io/tls
+ and allows to specify an optional client certificate and key,
+ by constructing sslcert
and sslkey
connection string
+
+ parameter values.
+ format: namespace/name
+ minLength: 1
+ type: string
+ required:
+ - secret
+ type: object
+ type: object
+ timeouts:
+ description: Timeout specifies the global
+ timeouts for all routes.
+ properties:
+ idle:
+ description: Idle specifies the time at which a downstream or
+ upstream connection will be terminated if there are no active
+ streams.
+ format: duration
+ type: string
+ read:
+ description: Read specifies the amount of time for the entire
+ request stream to be received from the client.
+ format: duration
+ type: string
+ write:
+ description: |-
+ Write specifies max stream duration is the maximum time that a stream’s lifetime will span.
+ An HTTP request/response exchange fully consumes a single stream.
+ Therefore, this value must be greater than read_timeout as it covers both request and response time.
+ format: duration
+ type: string
+ type: object
+ useProxyProtocol:
+ description: UseProxyProtocol enables Proxy
+ Protocol support.
+ type: boolean
+ required:
+ - secrets
+ type: object
+ status:
+ description: PomeriumStatus represents configuration and Ingress status.
+ properties:
+ ingress:
+ additionalProperties:
+ description: |-
+ ResourceStatus represents the outcome of the latest attempt to reconcile
+ relevant Kubernetes resource with Pomerium.
+ properties:
+ error:
+ description: Error that prevented latest observedGeneration
+ to be synchronized with Pomerium.
+ type: string
+ observedAt:
+ description: ObservedAt is when last reconciliation attempt
+ was made.
+ format: date-time
+ type: string
+ observedGeneration:
+ description: ObservedGeneration represents the .metadata.generation
+ that was last presented to Pomerium.
+ format: int64
+ type: integer
+ reconciled:
+ description: Reconciled is whether this object generation was
+ successfully synced with pomerium.
+ type: boolean
+ warnings:
+ description: Warnings while parsing the resource.
+ items:
+ type: string
+ type: array
+ required:
+ - reconciled
+ type: object
+ description: Routes provide per-Ingress status.
+ type: object
+ settingsStatus:
+ description: SettingsStatus represent most recent main configuration
+ reconciliation status.
+ properties:
+ error:
+ description: Error that prevented latest observedGeneration to
+ be synchronized with Pomerium.
+ type: string
+ observedAt:
+ description: ObservedAt is when last reconciliation attempt was
+ made.
+ format: date-time
+ type: string
+ observedGeneration:
+ description: ObservedGeneration represents the .metadata.generation
+ that was last presented to Pomerium.
+ format: int64
+ type: integer
+ reconciled:
+ description: Reconciled is whether this object generation was
+ successfully synced with pomerium.
+ type: boolean
+ warnings:
+ description: Warnings while parsing the resource.
+ items:
+ type: string
+ type: array
+ required:
+ - reconciled
+ type: object
+ type: object
+ type: object
+ served: true
+ storage: true
+ subresources:
+ status: {}
diff --git a/ingress-controller/terraform/README.md b/ingress-controller/terraform/README.md
new file mode 100644
index 0000000..7e030f1
--- /dev/null
+++ b/ingress-controller/terraform/README.md
@@ -0,0 +1,33 @@
+This Terraform module installs
+
+```terraform
+provider "kubernetes" {
+
+}
+
+module "pomerium_ingress_controller" {
+ source = "git:https://github.com/pomerium/install//ingress-controller/terraform?ref=REF"
+}
+```
+
+Where `REF` may be an individual commit, a branch (i.e. `main`) or version tag (i.e. `v0.27.2`).
+
+Once Pomerium Ingress Controller is installed, you may reference additional configurations via the `Pomerium` CRD.
+See https://www.pomerium.com/docs/k8s/configure
+
+As it has to reference a CRD that does not exist until installed, the configuration manifest has to be created part of a separate Terraform run.
+
+```terraform
+resource "kubernetes_manifest" "pomerium_config" {
+ manifest = {
+ apiVersion = "ingress.pomerium.io/v1"
+ kind = "Pomerium"
+ metadata = {
+ name = "global"
+ }
+ spec = {
+ secrets = "pomerium-ingress-controller/bootstrap"
+ }
+ }
+}
+```
diff --git a/ingress-controller/terraform/cluster_role_bindings.tf b/ingress-controller/terraform/cluster_role_bindings.tf
new file mode 100644
index 0000000..2f61193
--- /dev/null
+++ b/ingress-controller/terraform/cluster_role_bindings.tf
@@ -0,0 +1,37 @@
+resource "kubernetes_cluster_role_binding" "controller" {
+ metadata {
+ name = var.controller_cluster_role_name
+ labels = var.cluster_role_labels
+ }
+
+ role_ref {
+ api_group = "rbac.authorization.k8s.io"
+ kind = "ClusterRole"
+ name = kubernetes_cluster_role.controller.metadata[0].name
+ }
+
+ subject {
+ kind = "ServiceAccount"
+ name = kubernetes_service_account.controller.metadata[0].name
+ namespace = kubernetes_namespace.pomerium.metadata[0].name
+ }
+}
+
+resource "kubernetes_cluster_role_binding" "gen_secrets" {
+ metadata {
+ name = var.gen_secrets_cluster_role_name
+ labels = var.cluster_role_labels
+ }
+
+ role_ref {
+ api_group = "rbac.authorization.k8s.io"
+ kind = "ClusterRole"
+ name = kubernetes_cluster_role.gen_secrets.metadata[0].name
+ }
+
+ subject {
+ kind = "ServiceAccount"
+ name = kubernetes_service_account.gen_secrets.metadata[0].name
+ namespace = kubernetes_namespace.pomerium.metadata[0].name
+ }
+}
diff --git a/ingress-controller/terraform/cluster_roles.tf b/ingress-controller/terraform/cluster_roles.tf
new file mode 100644
index 0000000..e2b6b2c
--- /dev/null
+++ b/ingress-controller/terraform/cluster_roles.tf
@@ -0,0 +1,61 @@
+resource "kubernetes_cluster_role" "controller" {
+ metadata {
+ name = var.controller_cluster_role_name
+ labels = var.cluster_role_labels
+ }
+
+ rule {
+ api_groups = [""]
+ resources = ["services", "endpoints", "secrets"]
+ verbs = ["get", "list", "watch"]
+ }
+
+ rule {
+ api_groups = [""]
+ resources = ["services/status", "secrets/status", "endpoints/status"]
+ verbs = ["get"]
+ }
+
+ rule {
+ api_groups = ["networking.k8s.io"]
+ resources = ["ingresses", "ingressclasses"]
+ verbs = ["get", "list", "watch"]
+ }
+
+ rule {
+ api_groups = ["networking.k8s.io"]
+ resources = ["ingresses/status"]
+ verbs = ["get", "patch", "update"]
+ }
+
+ rule {
+ api_groups = ["ingress.pomerium.io"]
+ resources = ["pomerium"]
+ verbs = ["get", "list", "watch"]
+ }
+
+ rule {
+ api_groups = ["ingress.pomerium.io"]
+ resources = ["pomerium/status"]
+ verbs = ["get", "update", "patch"]
+ }
+
+ rule {
+ api_groups = [""]
+ resources = ["events"]
+ verbs = ["create", "patch"]
+ }
+}
+
+resource "kubernetes_cluster_role" "gen_secrets" {
+ metadata {
+ name = var.gen_secrets_cluster_role_name
+ labels = var.cluster_role_labels
+ }
+
+ rule {
+ api_groups = [""]
+ resources = ["secrets"]
+ verbs = ["create"]
+ }
+}
diff --git a/ingress-controller/terraform/crd.tf b/ingress-controller/terraform/crd.tf
new file mode 100644
index 0000000..11ffcca
--- /dev/null
+++ b/ingress-controller/terraform/crd.tf
@@ -0,0 +1,3 @@
+resource "kubernetes_manifest" "pomerium_crd" {
+ manifest = yamldecode(file("${path.module}/crd.yaml"))
+}
diff --git a/ingress-controller/terraform/crd.yaml b/ingress-controller/terraform/crd.yaml
new file mode 120000
index 0000000..72566dc
--- /dev/null
+++ b/ingress-controller/terraform/crd.yaml
@@ -0,0 +1 @@
+../kustomize/crd/bases/ingress.pomerium.io_pomerium.yaml.yaml
\ No newline at end of file
diff --git a/ingress-controller/terraform/deployment.tf b/ingress-controller/terraform/deployment.tf
new file mode 100644
index 0000000..6fbdbbf
--- /dev/null
+++ b/ingress-controller/terraform/deployment.tf
@@ -0,0 +1,144 @@
+resource "kubernetes_deployment" "pomerium" {
+ metadata {
+ name = var.deployment_name
+ namespace = var.namespace_name
+ labels = var.deployment_labels
+ }
+
+ lifecycle {
+ ignore_changes = [
+ metadata[0].annotations
+ ]
+ }
+
+ spec {
+ replicas = var.deployment_replicas
+
+ selector {
+ match_labels = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+ }
+
+ template {
+ metadata {
+ labels = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+ }
+
+ spec {
+ service_account_name = kubernetes_service_account.controller.metadata[0].name
+ termination_grace_period_seconds = 10
+
+ security_context {
+ run_as_non_root = true
+ }
+
+ node_selector = merge(local.default_node_selector, var.node_selector)
+
+ container {
+ name = "pomerium-ingress-controller"
+ image = "${var.image_repository}:${var.image_tag}"
+ image_pull_policy = var.image_pull_policy
+
+ args = compact([
+ "all-in-one",
+ "--pomerium-config=${var.pomerium_config_name}",
+ "--update-status-from-service=${var.namespace_name}/pomerium-proxy",
+ "--metrics-bind-address=$(POD_IP):9090",
+ var.enable_databroker ? "--databroker-auto-tls=pomerium-databroker.${var.namespace_name}.svc" : null,
+ ])
+
+ env {
+ name = "TMPDIR"
+ value = "/tmp"
+ }
+
+ env {
+ name = "XDG_CACHE_HOME"
+ value = "/tmp"
+ }
+
+ env {
+ name = "POD_IP"
+ value_from {
+ field_ref {
+ field_path = "status.podIP"
+ }
+ }
+ }
+
+ port {
+ container_port = 8443
+ name = "https"
+ protocol = "TCP"
+ }
+
+ port {
+ container_port = 8080
+ name = "http"
+ protocol = "TCP"
+ }
+
+ port {
+ container_port = 9090
+ name = "metrics"
+ protocol = "TCP"
+ }
+
+ dynamic "port" {
+ for_each = var.enable_databroker ? [1] : []
+ content {
+ container_port = 5443
+ name = "databroker"
+ protocol = "TCP"
+ }
+ }
+
+ resources {
+ limits = {
+ cpu = var.resources_limits_cpu
+ memory = var.resources_limits_memory
+ }
+
+ requests = {
+ cpu = var.resources_requests_cpu
+ memory = var.resources_requests_memory
+ }
+ }
+
+ security_context {
+ allow_privilege_escalation = false
+ read_only_root_filesystem = true
+ run_as_group = 65532
+ run_as_non_root = true
+ run_as_user = 65532
+ }
+
+ volume_mount {
+ name = "tmp"
+ mount_path = "/tmp"
+ }
+ }
+
+ dynamic "toleration" {
+ for_each = var.tolerations
+ content {
+ key = lookup(toleration.value, "key", null)
+ operator = lookup(toleration.value, "operator", null)
+ value = lookup(toleration.value, "value", null)
+ effect = lookup(toleration.value, "effect", null)
+ toleration_seconds = lookup(toleration.value, "toleration_seconds", null)
+ }
+ }
+
+ volume {
+ name = "tmp"
+
+ empty_dir {}
+ }
+ }
+ }
+ }
+}
diff --git a/ingress-controller/terraform/gen_secrets.tf b/ingress-controller/terraform/gen_secrets.tf
new file mode 100644
index 0000000..a9f074d
--- /dev/null
+++ b/ingress-controller/terraform/gen_secrets.tf
@@ -0,0 +1,61 @@
+resource "kubernetes_job" "gen_secrets" {
+ metadata {
+ name = var.job_name
+ namespace = var.namespace_name
+ labels = var.deployment_labels
+ }
+
+ lifecycle {
+ ignore_changes = [
+ metadata[0].annotations
+ ]
+ }
+
+ spec {
+ template {
+ metadata {
+ name = var.job_name
+ labels = var.deployment_labels
+ }
+
+ spec {
+ service_account_name = kubernetes_service_account.gen_secrets.metadata[0].name
+ restart_policy = "OnFailure"
+
+ security_context {
+ fs_group = 1000
+ run_as_non_root = true
+ run_as_user = 1000
+ }
+
+ node_selector = merge(local.default_node_selector, var.node_selector)
+
+ container {
+ name = "gen-secrets"
+ image = "${var.image_repository}:${var.image_tag}"
+ image_pull_policy = "IfNotPresent"
+
+ args = [
+ "gen-secrets",
+ "--secrets=${var.namespace_name}/bootstrap",
+ ]
+
+ security_context {
+ allow_privilege_escalation = false
+ }
+ }
+
+ dynamic "toleration" {
+ for_each = var.tolerations
+ content {
+ key = lookup(toleration.value, "key", null)
+ operator = lookup(toleration.value, "operator", null)
+ value = lookup(toleration.value, "value", null)
+ effect = lookup(toleration.value, "effect", null)
+ toleration_seconds = lookup(toleration.value, "toleration_seconds", null)
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/ingress-controller/terraform/ingress_class.tf b/ingress-controller/terraform/ingress_class.tf
new file mode 100644
index 0000000..1b6eeb8
--- /dev/null
+++ b/ingress-controller/terraform/ingress_class.tf
@@ -0,0 +1,10 @@
+resource "kubernetes_ingress_class" "pomerium" {
+ metadata {
+ name = var.ingress_class_name
+ labels = var.labels
+ }
+
+ spec {
+ controller = "pomerium.io/ingress-controller"
+ }
+}
diff --git a/ingress-controller/terraform/locals.tf b/ingress-controller/terraform/locals.tf
new file mode 100644
index 0000000..46cfeab
--- /dev/null
+++ b/ingress-controller/terraform/locals.tf
@@ -0,0 +1,5 @@
+locals {
+ default_node_selector = {
+ "kubernetes.io/os" = "linux"
+ }
+}
diff --git a/ingress-controller/terraform/namespace.tf b/ingress-controller/terraform/namespace.tf
new file mode 100644
index 0000000..f9e674e
--- /dev/null
+++ b/ingress-controller/terraform/namespace.tf
@@ -0,0 +1,7 @@
+resource "kubernetes_namespace" "pomerium" {
+ count = var.use_external_namespace ? 0 : 1
+ metadata {
+ name = var.namespace_name
+ labels = var.labels
+ }
+}
diff --git a/ingress-controller/terraform/service_accounts.tf b/ingress-controller/terraform/service_accounts.tf
new file mode 100644
index 0000000..7d541b9
--- /dev/null
+++ b/ingress-controller/terraform/service_accounts.tf
@@ -0,0 +1,15 @@
+resource "kubernetes_service_account" "controller" {
+ metadata {
+ name = var.controller_service_account_name
+ namespace = locals.namespace_name
+ labels = var.service_account_labels
+ }
+}
+
+resource "kubernetes_service_account" "gen_secrets" {
+ metadata {
+ name = var.gen_secrets_service_account_name
+ namespace = locals.namespace_name
+ labels = var.service_account_labels
+ }
+}
diff --git a/ingress-controller/terraform/services.tf b/ingress-controller/terraform/services.tf
new file mode 100644
index 0000000..1285421
--- /dev/null
+++ b/ingress-controller/terraform/services.tf
@@ -0,0 +1,75 @@
+resource "kubernetes_service" "proxy" {
+ count = var.proxy_service_type == null ? 0 : 1
+
+ metadata {
+ name = "pomerium-proxy"
+ namespace = var.namespace_name
+ labels = var.service_labels
+ }
+
+ lifecycle {
+ ignore_changes = [
+ metadata[0].annotations
+ ]
+ }
+
+ spec {
+ selector = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+
+ external_traffic_policy = var.proxy_service_type == "LoadBalancer" ? "Local" : null
+
+ port {
+ name = "https"
+ port = var.proxy_port_https
+ node_port = var.proxy_node_port_https
+ target_port = "https"
+ protocol = "TCP"
+ }
+
+ dynamic "port" {
+ for_each = var.proxy_port_http != null ? [var.proxy_port_http] : []
+ content {
+ name = "http"
+ port = port.value
+ node_port = var.proxy_node_port_http
+ target_port = "http"
+ protocol = "TCP"
+ }
+ }
+
+ type = var.proxy_service_type
+ }
+}
+
+resource "kubernetes_service" "databroker" {
+ count = var.enable_databroker ? 1 : 0
+
+ metadata {
+ name = "pomerium-databroker"
+ namespace = kubernetes_namespace.pomerium.metadata[0].name
+ labels = var.service_labels
+ }
+
+ lifecycle {
+ ignore_changes = [
+ metadata[0].annotations
+ ]
+ }
+
+ spec {
+ selector = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+
+ port {
+ name = "databroker"
+ port = 443
+ target_port = "databroker"
+ protocol = "TCP"
+ }
+
+ type = "ClusterIP"
+ }
+}
diff --git a/ingress-controller/terraform/variables.tf b/ingress-controller/terraform/variables.tf
new file mode 100644
index 0000000..dea84e8
--- /dev/null
+++ b/ingress-controller/terraform/variables.tf
@@ -0,0 +1,201 @@
+variable "namespace_name" {
+ description = "The name of the namespace to create"
+ type = string
+ default = "pomerium-ingress-controller"
+}
+
+variable "use_external_namespace" {
+ description = "Skip creating the namespace, assume it already exists, and use the provided namespace name"
+ type = bool
+ default = false
+}
+
+variable "labels" {
+ description = "Labels to apply to resources"
+ type = map(string)
+ default = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+}
+
+variable "image_repository" {
+ description = "Container image repository"
+ type = string
+ default = "pomerium/ingress-controller"
+}
+
+variable "image_tag" {
+ description = "Container image tag"
+ type = string
+ default = "v0.27.0"
+}
+
+variable "image_pull_policy" {
+ description = "Image pull policy"
+ type = string
+ default = "IfNotPresent"
+}
+
+variable "controller_service_account_name" {
+ description = "Name of the controller service account"
+ type = string
+ default = "pomerium-ingress-controller"
+}
+
+variable "gen_secrets_service_account_name" {
+ description = "Name of the gen-secrets service account"
+ type = string
+ default = "pomerium-ingress-controller-gen-secrets"
+}
+
+variable "controller_cluster_role_name" {
+ description = "Name of the controller cluster role"
+ type = string
+ default = "pomerium-ingress-controller"
+}
+
+variable "gen_secrets_cluster_role_name" {
+ description = "Name of the gen-secrets cluster role"
+ type = string
+ default = "pomerium-ingress-controller-gen-secrets"
+}
+
+variable "deployment_name" {
+ description = "Name of the Deployment"
+ type = string
+ default = "pomerium-ingress-controller"
+}
+
+variable "deployment_replicas" {
+ description = "Number of replicas for the Deployment"
+ type = number
+ default = 1
+}
+
+variable "resources_requests_cpu" {
+ description = "CPU requests for the Deployment"
+ type = string
+ default = "300m"
+}
+
+variable "resources_requests_memory" {
+ description = "Memory requests for the Deployment"
+ type = string
+ default = "200Mi"
+}
+
+variable "resources_limits_cpu" {
+ description = "CPU limits for the Deployment"
+ type = string
+ default = "5000m"
+}
+
+variable "resources_limits_memory" {
+ description = "Memory limits for the Deployment"
+ type = string
+ default = "1Gi"
+}
+
+variable "proxy_service_type" {
+ description = "Type of the Proxy Service"
+ type = string
+ default = "LoadBalancer"
+}
+
+variable "ingress_class_name" {
+ description = "Name of the IngressClass"
+ type = string
+ default = "pomerium"
+}
+
+variable "service_account_labels" {
+ description = "Labels to apply to service accounts"
+ type = map(string)
+ default = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+}
+
+variable "cluster_role_labels" {
+ description = "Labels to apply to cluster roles"
+ type = map(string)
+ default = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+}
+
+variable "service_labels" {
+ description = "Labels to apply to services"
+ type = map(string)
+ default = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+}
+
+variable "deployment_labels" {
+ description = "Labels to apply to the deployment"
+ type = map(string)
+ default = {
+ "app.kubernetes.io/name" = "pomerium-ingress-controller"
+ }
+}
+
+variable "tolerations" {
+ description = "List of tolerations for the pods."
+ type = list(object({
+ key = optional(string)
+ operator = optional(string, "Equal")
+ value = optional(string)
+ effect = optional(string)
+ toleration_seconds = optional(number)
+ }))
+ default = []
+}
+
+variable "job_name" {
+ description = "Name of the Job"
+ type = string
+ default = "pomerium-gen-secrets"
+}
+
+variable "pomerium_config_name" {
+ description = "Name of the Pomerium CRD"
+ type = string
+ default = "global"
+}
+
+variable "enable_databroker" {
+ description = "Enable the databroker"
+ type = bool
+ default = false
+}
+
+variable "proxy_port_https" {
+ description = "Port for HTTPS"
+ type = number
+ default = 443
+}
+
+variable "proxy_port_http" {
+ description = "Port for HTTP"
+ type = number
+ default = 80
+}
+
+variable "proxy_node_port_https" {
+ description = "Node port for HTTPS, only used when proxy_service_type is NodePort"
+ type = number
+ default = null
+}
+
+variable "proxy_node_port_http" {
+ description = "Host port for HTTP"
+ type = number
+ default = null
+}
+
+variable "node_selector" {
+ description = "Node selector for the Deployment"
+ type = map(string)
+ default = {}
+}
From a82b60fb1dd8c350bea7444e1a2d87a3e727eaa2 Mon Sep 17 00:00:00 2001
From: Denis Mishin