Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKIP-943: expose optional metricsPort for certain applications #155

Merged
merged 5 commits into from
Feb 10, 2023

Conversation

berg-thom
Copy link
Contributor

Lets applications expose an optional extra port in those cases where we want a metrics endpoint available through a different port than the standard one.

@berg-thom berg-thom requested a review from a team as a code owner February 9, 2023 09:40
@berg-thom berg-thom requested review from evenh, lislei and omaen February 9, 2023 09:40
@github-actions
Copy link

github-actions bot commented Feb 9, 2023

Results for sandbox – ❗ CHANGED

Terraform Format and Style 🖌 success

Terraform Initialization ⚙️ success

Terraform Validation 🤖 success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖 success

Show Plan

[command]/home/runner/work/_temp/932a38d5-c34e-4762-9f95-f3937a5953c3/terraform-bin plan -input=false -no-color -detailed-exitcode -out=plan-sandbox.tfplan -var=image=ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497 -var-file=sandbox.tfvars
Acquiring state lock. This may take a few moments...

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # kubernetes_deployment_v1.deployment will be updated in-place
  ~ resource "kubernetes_deployment_v1" "deployment" {
        id               = "skiperator-system/skiperator"
        # (1 unchanged attribute hidden)

      ~ spec {
          ~ replicas                  = "2" -> "3"
            # (4 unchanged attributes hidden)

          ~ template {

              ~ spec {
                    # (12 unchanged attributes hidden)

                  ~ container {
                      ~ image                      = "ghcr.io/kartverket/skiperator-controller:sha-1b062705ca00eaffb7d0a32550645081159fb14b" -> "ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497"
                        name                       = "skiperator"
                        # (8 unchanged attributes hidden)

                        # (7 unchanged blocks hidden)
                    }
                }

                # (1 unchanged block hidden)
            }

            # (2 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.cluster_role will be updated in-place
  ~ resource "kubernetes_manifest" "cluster_role" {
      ~ object   = {
          ~ metadata        = {
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "skiperator"
                # (13 unchanged elements hidden)
            }
            # (4 unchanged elements hidden)
        }
        # (1 unchanged attribute hidden)

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.custom_resource_definition will be updated in-place
  ~ resource "kubernetes_manifest" "custom_resource_definition" {
      ~ manifest = {
          ~ metadata   = {
              ~ annotations       = {
                  ~ "controller-gen.kubebuilder.io/version" = "v0.11.1" -> "v0.11.3"
                }
                name              = "applications.skiperator.kartverket.no"
                # (1 unchanged element hidden)
            }
          ~ spec       = {
              ~ versions = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (3 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }
      ~ object   = {
          ~ metadata   = {
              ~ annotations                = {
                  - "controller-gen.kubebuilder.io/version"            = "v0.11.1"
                  - "kubectl.kubernetes.io/last-applied-configuration" = jsonencode(
                        {
                          - apiVersion = "apiextensions.k8s.io/v1"
                          - kind       = "CustomResourceDefinition"
                          - metadata   = {
                              - annotations       = {
                                  - "controller-gen.kubebuilder.io/version" = "v0.11.1"
                                }
                              - creationTimestamp = null
                              - name              = "applications.skiperator.kartverket.no"
                            }
                          - spec       = {
                              - group    = "skiperator.kartverket.no"
                              - names    = {
                                  - kind       = "Application"
                                  - listKind   = "ApplicationList"
                                  - plural     = "applications"
                                  - shortNames = [
                                      - "app",
                                    ]
                                  - singular   = "application"
                                }
                              - scope    = "Namespaced"
                              - versions = [
                                  - {
                                      - additionalPrinterColumns = [
                                          - {
                                              - jsonPath = ".status.application.status"
                                              - name     = "Status"
                                              - type     = "string"
                                            },
                                        ]
                                      - name                     = "v1alpha1"
                                      - schema                   = {
                                          - openAPIV3Schema = {
                                              - properties = {
                                                  - apiVersion = {
                                                      - description = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
                                                      - type        = "string"
                                                    }
                                                  - kind       = {
                                                      - description = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
                                                      - type        = "string"
                                                    }
                                                  - metadata   = {
                                                      - type = "object"
                                                    }
                                                  - spec       = {
                                                      - properties = {
                                                          - accessPolicy   = {
                                                              - properties = {
                                                                  - inbound  = {
                                                                      - properties = {
                                                                          - rules = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                  - outbound = {
                                                                      - properties = {
                                                                          - external = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - host  = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ip    = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ports = {
                                                                                          - items = {
                                                                                              - properties = {
                                                                                                  - name     = {
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                  - port     = {
                                                                                                      - type = "integer"
                                                                                                    }
                                                                                                  - protocol = {
                                                                                                      - enum = [
                                                                                                          - "HTTP",
                                                                                                          - "HTTPS",
                                                                                                          - "TCP",
                                                                                                        ]
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                }
                                                                                              - required   = [
                                                                                                  - "name",
                                                                                                  - "port",
                                                                                                  - "protocol",
                                                                                                ]
                                                                                              - type       = "object"
                                                                                            }
                                                                                          - type  = "array"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "host",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                          - rules    = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                          - command        = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - env            = {
                                                              - items = {
                                                                  - description = "EnvVar represents an environment variable present in a Container."
                                                                  - properties  = {
                                                                      - name      = {
                                                                          - description = "Name of the environment variable. Must be a C_IDENTIFIER."
                                                                          - type        = "string"
                                                                        }
                                                                      - value     = {
                                                                          - description = "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\"."
                                                                          - type        = "string"
                                                                        }
                                                                      - valueFrom = {
                                                                          - description = "Source for the environment variable's value. Cannot be used if value is not empty."
                                                                          - properties  = {
                                                                              - configMapKeyRef  = {
                                                                                  - description           = "Selects a key of a ConfigMap."
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key to select."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the ConfigMap or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - fieldRef         = {
                                                                                  - description           = "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs."
                                                                                  - properties            = {
                                                                                      - apiVersion = {
                                                                                          - description = "Version of the schema the FieldPath is written in terms of, defaults to \"v1\"."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - fieldPath  = {
                                                                                          - description = "Path of the field to select in the specified API version."
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "fieldPath",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - resourceFieldRef = {
                                                                                  - description           = "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported."
                                                                                  - properties            = {
                                                                                      - containerName = {
                                                                                          - description = "Container name: required for volumes, optional for env vars"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - divisor       = {
                                                                                          - anyOf                      = [
                                                                                              - {
                                                                                                  - type = "integer"
                                                                                                },
                                                                                              - {
                                                                                                  - type = "string"
                                                                                                },
                                                                                            ]
                                                                                          - description                = "Specifies the output format of the exposed resources, defaults to \"1\""
                                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                                          - x-kubernetes-int-or-string = true
                                                                                        }
                                                                                      - resource      = {
                                                                                          - description = "Required: resource to select"
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "resource",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - secretKeyRef     = {
                                                                                  - description           = "Selects a key of a secret in the pod's namespace"
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key of the secret to select from.  Must be a valid secret key."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the Secret or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                            }
                                                                          - type        = "object"
                                                                        }
                                                                    }
                                                                  - required    = [
                                                                      - "name",
                                                                    ]
                                                                  - type        = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - envFrom        = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap        = {
                                                                          - type = "string"
                                                                        }
                                                                      - gcpSecretManager = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret           = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - filesFrom      = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap             = {
                                                                          - type = "string"
                                                                        }
                                                                      - emptyDir              = {
                                                                          - type = "string"
                                                                        }
                                                                      - gcpSecretManager      = {
                                                                          - type = "string"
                                                                        }
                                                                      - mountPath             = {
                                                                          - type = "string"
                                                                        }
                                                                      - persistentVolumeClaim = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret                = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - required   = [
                                                                      - "mountPath",
                                                                    ]
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - gcp            = {
                                                              - properties = {
                                                                  - auth = {
                                                                      - properties = {
                                                                          - serviceAccount = {
                                                                              - type = "string"
                                                                            }
                                                                        }
                                                                      - required   = [
                                                                          - "serviceAccount",
                                                                        ]
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "auth",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - image          = {
                                                              - type = "string"
                                                            }
                                                          - ingresses      = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - labels         = {
                                                              - additionalProperties = {
                                                                  - type = "string"
                                                                }
                                                              - type                 = "object"
                                                            }
                                                          - liveness       = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - port           = {
                                                              - type = "integer"
                                                            }
                                                          - readiness      = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - replicas       = {
                                                              - properties = {
                                                                  - max                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - min                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - targetCpuUtilization = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "min",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - resourceLabels = {
                                                              - additionalProperties = {
                                                                  - additionalProperties = {
                                                                      - type = "string"
                                                                    }
                                                                  - type                 = "object"
                                                                }
                                                              - type                 = "object"
                                                            }
                                                          - resources      = {
                                                              - properties = {
                                                                  - limits   = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "ResourceList is a set of (resource name, quantity) pairs."
                                                                      - type                 = "object"
                                                                    }
                                                                  - requests = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "ResourceList is a set of (resource name, quantity) pairs."
                                                                      - type                 = "object"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                          - startup        = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - strategy       = {
                                                              - properties = {
                                                                  - type = {
                                                                      - default = "RollingUpdate"
                                                                      - enum    = [
                                                                          - "RollingUpdate",
                                                                          - "Recreate",
                                                                        ]
                                                                      - type    = "string"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "image",
                                                          - "port",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                  - status     = {
                                                      - properties = {
                                                          - application = {
                                                              - properties = {
                                                                  - message   = {
                                                                      - default = "hello"
                                                                      - type    = "string"
                                                                    }
                                                                  - status    = {
                                                                      - default = "Synced"
                                                                      - type    = "string"
                                                                    }
                                                                  - timestamp = {
                                                                      - default = "hello"
                                                                      - type    = "string"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "message",
                                                                  - "status",
                                                                  - "timestamp",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - controllers = {
                                                              - additionalProperties = {
                                                                  - properties = {
                                                                      - message   = {
                                                                          - default = "hello"
                                                                          - type    = "string"
                                                                        }
                                                                      - status    = {
                                                                          - default = "Synced"
                                                                          - type    = "string"
                                                                        }
                                                                      - timestamp = {
                                                                          - default = "hello"
                                                                          - type    = "string"
                                                                        }
                                                                    }
                                                                  - required   = [
                                                                      - "message",
                                                                      - "status",
                                                                      - "timestamp",
                                                                    ]
                                                                  - type       = "object"
                                                                }
                                                              - type                 = "object"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "application",
                                                          - "controllers",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                }
                                              - type       = "object"
                                            }
                                        }
                                      - served                   = true
                                      - storage                  = true
                                      - subresources             = {
                                          - status = {}
                                        }
                                    },
                                ]
                            }
                        }
                    )
                } -> (known after apply)
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "applications.skiperator.kartverket.no"
                # (12 unchanged elements hidden)
            }
          ~ spec       = {
              ~ versions              = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (6 unchanged elements hidden)
                    },
                ]
                # (5 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.

Warning: Attribute not found in schema

  with kubernetes_manifest.custom_resource_definition,
  on main.tf line 25, in resource "kubernetes_manifest" "custom_resource_definition":
  25: resource "kubernetes_manifest" "custom_resource_definition" {

Unable to find schema type for attribute:
metadata.clusterName

(and one more similar warning elsewhere)

Warning: "default_secret_name" is no longer applicable for Kubernetes v1.24.0 and above

  with kubernetes_service_account_v1.service_account,
  on role.tf line 1, in resource "kubernetes_service_account_v1" "service_account":
   1: resource "kubernetes_service_account_v1" "service_account" {

Starting from version 1.24.0 Kubernetes does not automatically generate a
token for service accounts, in this case, "default_secret_name" will be empty
Releasing state lock. This may take a few moments...

Next action 🚀

Changes detected. Will run Terraform apply job on merge to

Pusher: @evenh, Working Directory: deployment, Commit: fca2fa9, Generated at: 9.2.2023, 15:03:38

Results for dev – ❗ CHANGED

Terraform Format and Style 🖌 success

Terraform Initialization ⚙️ success

Terraform Validation 🤖 success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖 success

Show Plan

[command]/home/runner/work/_temp/e2769fc6-e8db-4d01-906e-c5ee1b4ba122/terraform-bin plan -input=false -no-color -detailed-exitcode -out=plan-dev.tfplan -var=image=ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497 -var-file=dev.tfvars
Acquiring state lock. This may take a few moments...

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # kubernetes_deployment_v1.deployment will be updated in-place
  ~ resource "kubernetes_deployment_v1" "deployment" {
        id               = "skiperator-system/skiperator"
        # (1 unchanged attribute hidden)

      ~ spec {
            # (5 unchanged attributes hidden)

          ~ template {

              ~ spec {
                    # (12 unchanged attributes hidden)

                  ~ container {
                      ~ image                      = "ghcr.io/kartverket/skiperator-controller:sha-1b062705ca00eaffb7d0a32550645081159fb14b" -> "ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497"
                        name                       = "skiperator"
                        # (8 unchanged attributes hidden)

                        # (7 unchanged blocks hidden)
                    }
                }

                # (1 unchanged block hidden)
            }

            # (2 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.cluster_role will be updated in-place
  ~ resource "kubernetes_manifest" "cluster_role" {
      ~ object   = {
          ~ metadata        = {
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "skiperator"
                # (14 unchanged elements hidden)
            }
            # (4 unchanged elements hidden)
        }
        # (1 unchanged attribute hidden)

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.custom_resource_definition will be updated in-place
  ~ resource "kubernetes_manifest" "custom_resource_definition" {
      ~ manifest = {
          ~ metadata   = {
              ~ annotations       = {
                  ~ "controller-gen.kubebuilder.io/version" = "v0.11.1" -> "v0.11.3"
                }
                name              = "applications.skiperator.kartverket.no"
                # (1 unchanged element hidden)
            }
          ~ spec       = {
              ~ versions = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (3 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }
      ~ object   = {
          ~ metadata   = {
              ~ annotations                = {
                  - "controller-gen.kubebuilder.io/version"            = "v0.11.1"
                  - "kubectl.kubernetes.io/last-applied-configuration" = jsonencode(
                        {
                          - apiVersion = "apiextensions.k8s.io/v1"
                          - kind       = "CustomResourceDefinition"
                          - metadata   = {
                              - annotations       = {
                                  - "controller-gen.kubebuilder.io/version" = "v0.10.0"
                                }
                              - creationTimestamp = null
                              - name              = "applications.skiperator.kartverket.no"
                            }
                          - spec       = {
                              - group    = "skiperator.kartverket.no"
                              - names    = {
                                  - kind       = "Application"
                                  - listKind   = "ApplicationList"
                                  - plural     = "applications"
                                  - shortNames = [
                                      - "app",
                                    ]
                                  - singular   = "application"
                                }
                              - scope    = "Namespaced"
                              - versions = [
                                  - {
                                      - additionalPrinterColumns = [
                                          - {
                                              - jsonPath = ".status.application.status"
                                              - name     = "Status"
                                              - type     = "string"
                                            },
                                        ]
                                      - name                     = "v1alpha1"
                                      - schema                   = {
                                          - openAPIV3Schema = {
                                              - properties = {
                                                  - apiVersion = {
                                                      - description = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
                                                      - type        = "string"
                                                    }
                                                  - kind       = {
                                                      - description = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
                                                      - type        = "string"
                                                    }
                                                  - metadata   = {
                                                      - type = "object"
                                                    }
                                                  - spec       = {
                                                      - properties = {
                                                          - accessPolicy = {
                                                              - properties = {
                                                                  - inbound  = {
                                                                      - properties = {
                                                                          - rules = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                  - outbound = {
                                                                      - properties = {
                                                                          - external = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - host  = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ip    = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ports = {
                                                                                          - items = {
                                                                                              - properties = {
                                                                                                  - name     = {
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                  - port     = {
                                                                                                      - type = "integer"
                                                                                                    }
                                                                                                  - protocol = {
                                                                                                      - enum = [
                                                                                                          - "HTTP",
                                                                                                          - "HTTPS",
                                                                                                          - "TCP",
                                                                                                        ]
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                }
                                                                                              - required   = [
                                                                                                  - "name",
                                                                                                  - "port",
                                                                                                  - "protocol",
                                                                                                ]
                                                                                              - type       = "object"
                                                                                            }
                                                                                          - type  = "array"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "host",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                          - rules    = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                          - command      = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - env          = {
                                                              - items = {
                                                                  - description = "EnvVar represents an environment variable present in a Container."
                                                                  - properties  = {
                                                                      - name      = {
                                                                          - description = "Name of the environment variable. Must be a C_IDENTIFIER."
                                                                          - type        = "string"
                                                                        }
                                                                      - value     = {
                                                                          - description = "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\"."
                                                                          - type        = "string"
                                                                        }
                                                                      - valueFrom = {
                                                                          - description = "Source for the environment variable's value. Cannot be used if value is not empty."
                                                                          - properties  = {
                                                                              - configMapKeyRef  = {
                                                                                  - description           = "Selects a key of a ConfigMap."
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key to select."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the ConfigMap or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - fieldRef         = {
                                                                                  - description           = "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs."
                                                                                  - properties            = {
                                                                                      - apiVersion = {
                                                                                          - description = "Version of the schema the FieldPath is written in terms of, defaults to \"v1\"."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - fieldPath  = {
                                                                                          - description = "Path of the field to select in the specified API version."
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "fieldPath",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - resourceFieldRef = {
                                                                                  - description           = "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported."
                                                                                  - properties            = {
                                                                                      - containerName = {
                                                                                          - description = "Container name: required for volumes, optional for env vars"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - divisor       = {
                                                                                          - anyOf                      = [
                                                                                              - {
                                                                                                  - type = "integer"
                                                                                                },
                                                                                              - {
                                                                                                  - type = "string"
                                                                                                },
                                                                                            ]
                                                                                          - description                = "Specifies the output format of the exposed resources, defaults to \"1\""
                                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                                          - x-kubernetes-int-or-string = true
                                                                                        }
                                                                                      - resource      = {
                                                                                          - description = "Required: resource to select"
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "resource",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - secretKeyRef     = {
                                                                                  - description           = "Selects a key of a secret in the pod's namespace"
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key of the secret to select from.  Must be a valid secret key."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the Secret or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                            }
                                                                          - type        = "object"
                                                                        }
                                                                    }
                                                                  - required    = [
                                                                      - "name",
                                                                    ]
                                                                  - type        = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - envFrom      = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret    = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - filesFrom    = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap             = {
                                                                          - type = "string"
                                                                        }
                                                                      - emptyDir              = {
                                                                          - type = "string"
                                                                        }
                                                                      - mountPath             = {
                                                                          - type = "string"
                                                                        }
                                                                      - persistentVolumeClaim = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret                = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - required   = [
                                                                      - "mountPath",
                                                                    ]
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - gcp          = {
                                                              - properties = {
                                                                  - auth = {
                                                                      - properties = {
                                                                          - serviceAccount = {
                                                                              - type = "string"
                                                                            }
                                                                        }
                                                                      - required   = [
                                                                          - "serviceAccount",
                                                                        ]
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "auth",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - image        = {
                                                              - type = "string"
                                                            }
                                                          - ingresses    = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - liveness     = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - port         = {
                                                              - type = "integer"
                                                            }
                                                          - readiness    = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - replicas     = {
                                                              - properties = {
                                                                  - max                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - min                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - targetCpuUtilization = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "min",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - resources    = {
                                                              - description = "ResourceRequirements describes the compute resource requirements."
                                                              - properties  = {
                                                                  - limits   = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"
                                                                      - type                 = "object"
                                                                    }
                                                                  - requests = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"
                                                                      - type                 = "object"
                                                                    }
                                                                }
                                                              - type        = "object"
                                                            }
                                                          - startup      = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - strategy     = {
                                                              - properties = {
                                                                  - type = {
                                                                      - default = "RollingUpdate"
                                                                      - enum    = [
                                                                          - "RollingUpdate",
                                                                          - "Recreate",
                                                                        ]
                                                                      - type    = "string"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "image",
                                                          - "port",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                  - status     = {
                                                      - properties = {
                                                          - application = {
                                                              - properties = {
                                                                  - message   = {
                                                                      - default = "hello"
                                                                      - type    = "string"
                                                                    }
                                                                  - status    = {
                                                                      - default = "Synced"
                                                                      - type    = "string"
                                                                    }
                                                                  - timestamp = {
                                                                      - default = "hello"
                                                                      - type    = "string"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "message",
                                                                  - "status",
                                                                  - "timestamp",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - controllers = {
                                                              - additionalProperties = {
                                                                  - properties = {
                                                                      - message   = {
                                                                          - default = "hello"
                                                                          - type    = "string"
                                                                        }
                                                                      - status    = {
                                                                          - default = "Synced"
                                                                          - type    = "string"
                                                                        }
                                                                      - timestamp = {
                                                                          - default = "hello"
                                                                          - type    = "string"
                                                                        }
                                                                    }
                                                                  - required   = [
                                                                      - "message",
                                                                      - "status",
                                                                      - "timestamp",
                                                                    ]
                                                                  - type       = "object"
                                                                }
                                                              - type                 = "object"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "application",
                                                          - "controllers",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                }
                                              - type       = "object"
                                            }
                                        }
                                      - served                   = true
                                      - storage                  = true
                                      - subresources             = {
                                          - status = {}
                                        }
                                    },
                                ]
                            }
                        }
                    )
                } -> (known after apply)
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "applications.skiperator.kartverket.no"
                # (13 unchanged elements hidden)
            }
          ~ spec       = {
              ~ versions              = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (6 unchanged elements hidden)
                    },
                ]
                # (5 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.

Warning: "default_secret_name" is no longer applicable for Kubernetes v1.24.0 and above

  with kubernetes_service_account_v1.service_account,
  on role.tf line 1, in resource "kubernetes_service_account_v1" "service_account":
   1: resource "kubernetes_service_account_v1" "service_account" {

Starting from version 1.24.0 Kubernetes does not automatically generate a
token for service accounts, in this case, "default_secret_name" will be empty
Releasing state lock. This may take a few moments...

Next action 🚀

Changes detected. Will run Terraform apply job on merge to

Pusher: @evenh, Working Directory: deployment, Commit: fca2fa9, Generated at: 9.2.2023, 15:05:45

Results for test – ❗ CHANGED

Terraform Format and Style 🖌 success

Terraform Initialization ⚙️ success

Terraform Validation 🤖 success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖 success

Show Plan

[command]/home/runner/work/_temp/abb59a8f-3253-4a8b-86e6-bc160868575d/terraform-bin plan -input=false -no-color -detailed-exitcode -out=plan-test.tfplan -var=image=ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497 -var-file=test.tfvars
Acquiring state lock. This may take a few moments...

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # kubernetes_deployment_v1.deployment will be updated in-place
  ~ resource "kubernetes_deployment_v1" "deployment" {
        id               = "skiperator-system/skiperator"
        # (1 unchanged attribute hidden)

      ~ spec {
            # (5 unchanged attributes hidden)

          ~ template {

              ~ spec {
                    # (12 unchanged attributes hidden)

                  ~ container {
                      ~ image                      = "ghcr.io/kartverket/skiperator-controller:sha-1b062705ca00eaffb7d0a32550645081159fb14b" -> "ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497"
                        name                       = "skiperator"
                        # (8 unchanged attributes hidden)

                        # (7 unchanged blocks hidden)
                    }
                }

                # (1 unchanged block hidden)
            }

            # (2 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.cluster_role will be updated in-place
  ~ resource "kubernetes_manifest" "cluster_role" {
      ~ object   = {
          ~ metadata        = {
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "skiperator"
                # (14 unchanged elements hidden)
            }
            # (4 unchanged elements hidden)
        }
        # (1 unchanged attribute hidden)

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.custom_resource_definition will be updated in-place
  ~ resource "kubernetes_manifest" "custom_resource_definition" {
      ~ manifest = {
          ~ metadata   = {
              ~ annotations       = {
                  ~ "controller-gen.kubebuilder.io/version" = "v0.11.1" -> "v0.11.3"
                }
                name              = "applications.skiperator.kartverket.no"
                # (1 unchanged element hidden)
            }
          ~ spec       = {
              ~ versions = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (3 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }
      ~ object   = {
          ~ metadata   = {
              ~ annotations                = {
                  - "controller-gen.kubebuilder.io/version"            = "v0.11.1"
                  - "kubectl.kubernetes.io/last-applied-configuration" = jsonencode(
                        {
                          - apiVersion = "apiextensions.k8s.io/v1"
                          - kind       = "CustomResourceDefinition"
                          - metadata   = {
                              - annotations       = {
                                  - "controller-gen.kubebuilder.io/version" = "v0.10.0"
                                }
                              - creationTimestamp = null
                              - name              = "applications.skiperator.kartverket.no"
                            }
                          - spec       = {
                              - group    = "skiperator.kartverket.no"
                              - names    = {
                                  - kind       = "Application"
                                  - listKind   = "ApplicationList"
                                  - plural     = "applications"
                                  - shortNames = [
                                      - "app",
                                    ]
                                  - singular   = "application"
                                }
                              - scope    = "Namespaced"
                              - versions = [
                                  - {
                                      - name         = "v1alpha1"
                                      - schema       = {
                                          - openAPIV3Schema = {
                                              - properties = {
                                                  - apiVersion = {
                                                      - description = "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
                                                      - type        = "string"
                                                    }
                                                  - kind       = {
                                                      - description = "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
                                                      - type        = "string"
                                                    }
                                                  - metadata   = {
                                                      - type = "object"
                                                    }
                                                  - spec       = {
                                                      - properties = {
                                                          - accessPolicy = {
                                                              - properties = {
                                                                  - inbound  = {
                                                                      - properties = {
                                                                          - rules = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                  - outbound = {
                                                                      - properties = {
                                                                          - external = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - host  = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ip    = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - ports = {
                                                                                          - items = {
                                                                                              - properties = {
                                                                                                  - name     = {
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                  - port     = {
                                                                                                      - type = "integer"
                                                                                                    }
                                                                                                  - protocol = {
                                                                                                      - enum = [
                                                                                                          - "HTTP",
                                                                                                          - "HTTPS",
                                                                                                          - "TCP",
                                                                                                        ]
                                                                                                      - type = "string"
                                                                                                    }
                                                                                                }
                                                                                              - required   = [
                                                                                                  - "name",
                                                                                                  - "port",
                                                                                                  - "protocol",
                                                                                                ]
                                                                                              - type       = "object"
                                                                                            }
                                                                                          - type  = "array"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "host",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                          - rules    = {
                                                                              - items = {
                                                                                  - properties = {
                                                                                      - application = {
                                                                                          - type = "string"
                                                                                        }
                                                                                      - namespace   = {
                                                                                          - type = "string"
                                                                                        }
                                                                                    }
                                                                                  - required   = [
                                                                                      - "application",
                                                                                    ]
                                                                                  - type       = "object"
                                                                                }
                                                                              - type  = "array"
                                                                            }
                                                                        }
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                          - command      = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - env          = {
                                                              - items = {
                                                                  - description = "EnvVar represents an environment variable present in a Container."
                                                                  - properties  = {
                                                                      - name      = {
                                                                          - description = "Name of the environment variable. Must be a C_IDENTIFIER."
                                                                          - type        = "string"
                                                                        }
                                                                      - value     = {
                                                                          - description = "Variable references $(VAR_NAME) are expanded using the previously defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. Double $ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$(VAR_NAME)\" will produce the string literal \"$(VAR_NAME)\". Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\"."
                                                                          - type        = "string"
                                                                        }
                                                                      - valueFrom = {
                                                                          - description = "Source for the environment variable's value. Cannot be used if value is not empty."
                                                                          - properties  = {
                                                                              - configMapKeyRef  = {
                                                                                  - description           = "Selects a key of a ConfigMap."
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key to select."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the ConfigMap or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - fieldRef         = {
                                                                                  - description           = "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs."
                                                                                  - properties            = {
                                                                                      - apiVersion = {
                                                                                          - description = "Version of the schema the FieldPath is written in terms of, defaults to \"v1\"."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - fieldPath  = {
                                                                                          - description = "Path of the field to select in the specified API version."
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "fieldPath",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - resourceFieldRef = {
                                                                                  - description           = "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported."
                                                                                  - properties            = {
                                                                                      - containerName = {
                                                                                          - description = "Container name: required for volumes, optional for env vars"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - divisor       = {
                                                                                          - anyOf                      = [
                                                                                              - {
                                                                                                  - type = "integer"
                                                                                                },
                                                                                              - {
                                                                                                  - type = "string"
                                                                                                },
                                                                                            ]
                                                                                          - description                = "Specifies the output format of the exposed resources, defaults to \"1\""
                                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                                          - x-kubernetes-int-or-string = true
                                                                                        }
                                                                                      - resource      = {
                                                                                          - description = "Required: resource to select"
                                                                                          - type        = "string"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "resource",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                              - secretKeyRef     = {
                                                                                  - description           = "Selects a key of a secret in the pod's namespace"
                                                                                  - properties            = {
                                                                                      - key      = {
                                                                                          - description = "The key of the secret to select from.  Must be a valid secret key."
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - name     = {
                                                                                          - description = "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names TODO: Add other useful fields. apiVersion, kind, uid?"
                                                                                          - type        = "string"
                                                                                        }
                                                                                      - optional = {
                                                                                          - description = "Specify whether the Secret or its key must be defined"
                                                                                          - type        = "boolean"
                                                                                        }
                                                                                    }
                                                                                  - required              = [
                                                                                      - "key",
                                                                                    ]
                                                                                  - type                  = "object"
                                                                                  - x-kubernetes-map-type = "atomic"
                                                                                }
                                                                            }
                                                                          - type        = "object"
                                                                        }
                                                                    }
                                                                  - required    = [
                                                                      - "name",
                                                                    ]
                                                                  - type        = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - envFrom      = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret    = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - filesFrom    = {
                                                              - items = {
                                                                  - properties = {
                                                                      - configMap             = {
                                                                          - type = "string"
                                                                        }
                                                                      - emptyDir              = {
                                                                          - type = "string"
                                                                        }
                                                                      - mountPath             = {
                                                                          - type = "string"
                                                                        }
                                                                      - persistentVolumeClaim = {
                                                                          - type = "string"
                                                                        }
                                                                      - secret                = {
                                                                          - type = "string"
                                                                        }
                                                                    }
                                                                  - required   = [
                                                                      - "mountPath",
                                                                    ]
                                                                  - type       = "object"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - gcp          = {
                                                              - properties = {
                                                                  - auth = {
                                                                      - properties = {
                                                                          - serviceAccount = {
                                                                              - type = "string"
                                                                            }
                                                                        }
                                                                      - required   = [
                                                                          - "serviceAccount",
                                                                        ]
                                                                      - type       = "object"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "auth",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - image        = {
                                                              - type = "string"
                                                            }
                                                          - ingresses    = {
                                                              - items = {
                                                                  - type = "string"
                                                                }
                                                              - type  = "array"
                                                            }
                                                          - liveness     = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - port         = {
                                                              - type = "integer"
                                                            }
                                                          - readiness    = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - replicas     = {
                                                              - properties = {
                                                                  - max                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - min                  = {
                                                                      - type = "integer"
                                                                    }
                                                                  - targetCpuUtilization = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "min",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - resources    = {
                                                              - description = "ResourceRequirements describes the compute resource requirements."
                                                              - properties  = {
                                                                  - limits   = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"
                                                                      - type                 = "object"
                                                                    }
                                                                  - requests = {
                                                                      - additionalProperties = {
                                                                          - anyOf                      = [
                                                                              - {
                                                                                  - type = "integer"
                                                                                },
                                                                              - {
                                                                                  - type = "string"
                                                                                },
                                                                            ]
                                                                          - pattern                    = "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$"
                                                                          - x-kubernetes-int-or-string = true
                                                                        }
                                                                      - description          = "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/"
                                                                      - type                 = "object"
                                                                    }
                                                                }
                                                              - type        = "object"
                                                            }
                                                          - startup      = {
                                                              - properties = {
                                                                  - failureThreshold = {
                                                                      - type = "integer"
                                                                    }
                                                                  - initialDelay     = {
                                                                      - type = "integer"
                                                                    }
                                                                  - path             = {
                                                                      - type = "string"
                                                                    }
                                                                  - port             = {
                                                                      - type = "integer"
                                                                    }
                                                                  - timeout          = {
                                                                      - type = "integer"
                                                                    }
                                                                }
                                                              - required   = [
                                                                  - "path",
                                                                  - "port",
                                                                ]
                                                              - type       = "object"
                                                            }
                                                          - strategy     = {
                                                              - properties = {
                                                                  - type = {
                                                                      - default = "RollingUpdate"
                                                                      - enum    = [
                                                                          - "RollingUpdate",
                                                                          - "Recreate",
                                                                        ]
                                                                      - type    = "string"
                                                                    }
                                                                }
                                                              - type       = "object"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "image",
                                                          - "port",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                  - status     = {
                                                      - properties = {
                                                          - conditions    = {
                                                              - items                      = {
                                                                  - description = <<-EOT
                                                                        Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions.  For example, 
                                                                         type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` 
                                                                         // other fields }
                                                                    EOT
                                                                  - properties  = {
                                                                      - lastTransitionTime = {
                                                                          - description = "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable."
                                                                          - format      = "date-time"
                                                                          - type        = "string"
                                                                        }
                                                                      - message            = {
                                                                          - description = "message is a human readable message indicating details about the transition. This may be an empty string."
                                                                          - maxLength   = 32768
                                                                          - type        = "string"
                                                                        }
                                                                      - observedGeneration = {
                                                                          - description = "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance."
                                                                          - format      = "int64"
                                                                          - minimum     = 0
                                                                          - type        = "integer"
                                                                        }
                                                                      - reason             = {
                                                                          - description = "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty."
                                                                          - maxLength   = 1024
                                                                          - minLength   = 1
                                                                          - pattern     = "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$"
                                                                          - type        = "string"
                                                                        }
                                                                      - status             = {
                                                                          - description = "status of the condition, one of True, False, Unknown."
                                                                          - enum        = [
                                                                              - "True",
                                                                              - "False",
                                                                              - "Unknown",
                                                                            ]
                                                                          - type        = "string"
                                                                        }
                                                                      - type               = {
                                                                          - description = "type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)"
                                                                          - maxLength   = 316
                                                                          - pattern     = "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$"
                                                                          - type        = "string"
                                                                        }
                                                                    }
                                                                  - required    = [
                                                                      - "lastTransitionTime",
                                                                      - "message",
                                                                      - "reason",
                                                                      - "status",
                                                                      - "type",
                                                                    ]
                                                                  - type        = "object"
                                                                }
                                                              - type                       = "array"
                                                              - x-kubernetes-list-map-keys = [
                                                                  - "type",
                                                                ]
                                                              - x-kubernetes-list-type     = "map"
                                                            }
                                                          - schemaCreated = {
                                                              - type = "boolean"
                                                            }
                                                        }
                                                      - required   = [
                                                          - "conditions",
                                                          - "schemaCreated",
                                                        ]
                                                      - type       = "object"
                                                    }
                                                }
                                              - type       = "object"
                                            }
                                        }
                                      - served       = true
                                      - storage      = true
                                      - subresources = {
                                          - status = {}
                                        }
                                    },
                                ]
                            }
                        }
                    )
                } -> (known after apply)
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "applications.skiperator.kartverket.no"
                # (13 unchanged elements hidden)
            }
          ~ spec       = {
              ~ versions              = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (6 unchanged elements hidden)
                    },
                ]
                # (5 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.

Warning: "default_secret_name" is no longer applicable for Kubernetes v1.24.0 and above

  with kubernetes_service_account_v1.service_account,
  on role.tf line 1, in resource "kubernetes_service_account_v1" "service_account":
   1: resource "kubernetes_service_account_v1" "service_account" {

Starting from version 1.24.0 Kubernetes does not automatically generate a
token for service accounts, in this case, "default_secret_name" will be empty
Releasing state lock. This may take a few moments...

Next action 🚀

Changes detected. Will run Terraform apply job on merge to

Pusher: @evenh, Working Directory: deployment, Commit: fca2fa9, Generated at: 9.2.2023, 15:07:49

Results for prod – ❗ CHANGED

Terraform Format and Style 🖌 success

Terraform Initialization ⚙️ success

Terraform Validation 🤖 success

Validation Output

Success! The configuration is valid.


Terraform Plan 📖 success

Show Plan

[command]/home/runner/work/_temp/b0263a75-9977-4f34-accb-65da60b86126/terraform-bin plan -input=false -no-color -detailed-exitcode -out=plan-prod.tfplan -var=image=ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497 -var-file=prod.tfvars
Acquiring state lock. This may take a few moments...

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # kubernetes_deployment_v1.deployment will be updated in-place
  ~ resource "kubernetes_deployment_v1" "deployment" {
        id               = "skiperator-system/skiperator"
        # (1 unchanged attribute hidden)

      ~ spec {
            # (5 unchanged attributes hidden)

          ~ template {

              ~ spec {
                    # (12 unchanged attributes hidden)

                  ~ container {
                      ~ image                      = "ghcr.io/kartverket/skiperator-controller:sha-1b062705ca00eaffb7d0a32550645081159fb14b" -> "ghcr.io/kartverket/skiperator-controller:sha-fca2fa9bb62aa80b2ba8f1158ad0758a78883497"
                        name                       = "skiperator"
                        # (8 unchanged attributes hidden)

                        # (7 unchanged blocks hidden)
                    }
                }

                # (1 unchanged block hidden)
            }

            # (2 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.cluster_role will be updated in-place
  ~ resource "kubernetes_manifest" "cluster_role" {
      ~ object   = {
          ~ metadata        = {
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "skiperator"
                # (14 unchanged elements hidden)
            }
            # (4 unchanged elements hidden)
        }
        # (1 unchanged attribute hidden)

        # (1 unchanged block hidden)
    }

  # kubernetes_manifest.custom_resource_definition will be updated in-place
  ~ resource "kubernetes_manifest" "custom_resource_definition" {
      ~ manifest = {
          ~ metadata   = {
              ~ annotations       = {
                  ~ "controller-gen.kubebuilder.io/version" = "v0.11.1" -> "v0.11.3"
                }
                name              = "applications.skiperator.kartverket.no"
                # (1 unchanged element hidden)
            }
          ~ spec       = {
              ~ versions = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (4 unchanged elements hidden)
                    },
                ]
                # (3 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }
      ~ object   = {
          ~ metadata   = {
              ~ annotations                = {
                  - "controller-gen.kubebuilder.io/version" = "v0.11.1"
                } -> (known after apply)
              ~ creationTimestamp          = null -> (known after apply)
                name                       = "applications.skiperator.kartverket.no"
                # (13 unchanged elements hidden)
            }
          ~ spec       = {
              ~ versions              = [
                  ~ {
                        name                     = "v1alpha1"
                      ~ schema                   = {
                          ~ openAPIV3Schema = {
                              ~ properties = {
                                  ~ spec       = {
                                      ~ properties = {
                                          + additionalPorts = {
                                              + items = {
                                                  + properties = {
                                                      + name     = {
                                                          + type = "string"
                                                        }
                                                      + port     = {
                                                          + format = "int32"
                                                          + type   = "integer"
                                                        }
                                                      + protocol = {
                                                          + default = "TCP"
                                                          + enum    = [
                                                              + "TCP",
                                                              + "UDP",
                                                              + "SCTP",
                                                            ]
                                                          + type    = "string"
                                                        }
                                                    }
                                                  + required   = [
                                                      + "name",
                                                      + "port",
                                                      + "protocol",
                                                    ]
                                                  + type       = "object"
                                                }
                                              + type  = "array"
                                            }
                                            # (17 unchanged elements hidden)
                                        }
                                        # (2 unchanged elements hidden)
                                    }
                                    # (4 unchanged elements hidden)
                                }
                                # (1 unchanged element hidden)
                            }
                        }
                        # (6 unchanged elements hidden)
                    },
                ]
                # (5 unchanged elements hidden)
            }
            # (2 unchanged elements hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 3 to change, 0 to destroy.

Warning: "default_secret_name" is no longer applicable for Kubernetes v1.24.0 and above

  with kubernetes_service_account_v1.service_account,
  on role.tf line 1, in resource "kubernetes_service_account_v1" "service_account":
   1: resource "kubernetes_service_account_v1" "service_account" {

Starting from version 1.24.0 Kubernetes does not automatically generate a
token for service accounts, in this case, "default_secret_name" will be empty
Releasing state lock. This may take a few moments...

Next action 🚀

Changes detected. Will run Terraform apply job on merge to

Pusher: @evenh, Working Directory: deployment, Commit: fca2fa9, Generated at: 9.2.2023, 15:10:06

README.md Outdated Show resolved Hide resolved
tests/metrics-port/00-assert.yaml Outdated Show resolved Hide resolved
tests/metrics-port/00-assert.yaml Outdated Show resolved Hide resolved
api/v1alpha1/application.go Show resolved Hide resolved
tests/additional-ports/00-assert.yaml Outdated Show resolved Hide resolved
@evenh evenh requested a review from anderssonw February 9, 2023 14:57
Copy link
Contributor

@anderssonw anderssonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@berg-thom berg-thom requested a review from anderssonw February 10, 2023 07:47
Copy link
Contributor

@omaen omaen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Veldig bra! Må deployere til dev før vi får testet Instana, men det burde jo gå fint :)

@@ -91,6 +90,15 @@ func (r *ApplicationReconciler) reconcileDeployment(ctx context.Context, applica

container.Ports = make([]corev1.ContainerPort, 1)
container.Ports[0].ContainerPort = int32(application.Spec.Port)
container.Ports[0].Name = "main"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slik det er i dag så mappes servicen til porten basert på indeksen, så navnet på port 0 blir ikke brukt til noe egentlig?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Det er korrekt. Tanken bak å navngi default-porten er for å kunne gjenbruke navnet på tvers i andre ressurser. Da gjør det ikke noe om selve portnummeret endrer seg over tid. Dette er dog ikke implementert i denne PR'en, men da ligger alt til rette for det.

Håpet er også at ekstern tooling skal kunne si noe om trafikkflyt på main-port vs metrics-port vs tertiær-porter. Det er lettere å forstå enn port 8080 for den app1 og port 4398 for app2

@berg-thom berg-thom added this pull request to the merge queue Feb 10, 2023
Merged via the queue into main with commit a8dce0a Feb 10, 2023
@berg-thom berg-thom deleted the SKIP-943 branch February 10, 2023 09:13
@omaen omaen mentioned this pull request Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants