From 88e72a69460887a1d1b4e28b29654f352602f249 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Fri, 23 Aug 2024 23:05:17 -0400 Subject: [PATCH] clean up chart --- deploy/ctrlplane/Chart.yaml | 26 +-- deploy/ctrlplane/README.md | 1 + .../ctrlplane/charts/webservice/.helmignore | 23 +++ deploy/ctrlplane/charts/webservice/Chart.yaml | 24 +++ .../charts/webservice/templates/_helpers.tpl | 62 ++++++ .../webservice/templates/deployment.yaml | 67 +++++++ .../charts/webservice/templates/service.yaml | 23 +++ .../ctrlplane/charts/webservice/values.yaml | 32 +++ deploy/ctrlplane/templates/NOTES.txt | 22 --- deploy/ctrlplane/templates/_env.tpl | 20 ++ deploy/ctrlplane/templates/_labels.tpl | 9 + deploy/ctrlplane/templates/_pod.tpl | 25 +++ deploy/ctrlplane/templates/_selector.tpl | 7 + deploy/ctrlplane/templates/deployment.yaml | 61 ------ deploy/ctrlplane/templates/hpa.yaml | 28 --- deploy/ctrlplane/templates/ingress.yaml | 61 ------ deploy/ctrlplane/templates/service.yaml | 15 -- .../ctrlplane/templates/serviceaccount.yaml | 12 -- .../templates/tests/test-connection.yaml | 15 -- deploy/ctrlplane/values.yaml | 85 +------- pnpm-lock.yaml | 182 ++++++++---------- 21 files changed, 380 insertions(+), 420 deletions(-) create mode 100644 deploy/ctrlplane/README.md create mode 100644 deploy/ctrlplane/charts/webservice/.helmignore create mode 100644 deploy/ctrlplane/charts/webservice/Chart.yaml create mode 100644 deploy/ctrlplane/charts/webservice/templates/_helpers.tpl create mode 100644 deploy/ctrlplane/charts/webservice/templates/deployment.yaml create mode 100644 deploy/ctrlplane/charts/webservice/templates/service.yaml create mode 100644 deploy/ctrlplane/charts/webservice/values.yaml delete mode 100644 deploy/ctrlplane/templates/NOTES.txt create mode 100644 deploy/ctrlplane/templates/_env.tpl create mode 100644 deploy/ctrlplane/templates/_labels.tpl create mode 100644 deploy/ctrlplane/templates/_pod.tpl create mode 100644 deploy/ctrlplane/templates/_selector.tpl delete mode 100644 deploy/ctrlplane/templates/deployment.yaml delete mode 100644 deploy/ctrlplane/templates/hpa.yaml delete mode 100644 deploy/ctrlplane/templates/ingress.yaml delete mode 100644 deploy/ctrlplane/templates/service.yaml delete mode 100644 deploy/ctrlplane/templates/serviceaccount.yaml delete mode 100644 deploy/ctrlplane/templates/tests/test-connection.yaml diff --git a/deploy/ctrlplane/Chart.yaml b/deploy/ctrlplane/Chart.yaml index db06f1d5..73f9d96b 100644 --- a/deploy/ctrlplane/Chart.yaml +++ b/deploy/ctrlplane/Chart.yaml @@ -1,24 +1,12 @@ apiVersion: v2 name: ctrlplane -description: A Helm chart for Kubernetes - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. +description: Ctrlplane Helm chart for Kubernetes type: application - -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) version: 0.1.0 - -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. appVersion: "1.16.0" + +dependencies: + - name: webservice + version: "*.*.*" + repository: file://charts/webservice + condition: webservice.install diff --git a/deploy/ctrlplane/README.md b/deploy/ctrlplane/README.md new file mode 100644 index 00000000..5d2871cd --- /dev/null +++ b/deploy/ctrlplane/README.md @@ -0,0 +1 @@ +# Ctrlplane Helm Chart diff --git a/deploy/ctrlplane/charts/webservice/.helmignore b/deploy/ctrlplane/charts/webservice/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/ctrlplane/charts/webservice/Chart.yaml b/deploy/ctrlplane/charts/webservice/Chart.yaml new file mode 100644 index 00000000..0347a98a --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: webservice +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/deploy/ctrlplane/charts/webservice/templates/_helpers.tpl b/deploy/ctrlplane/charts/webservice/templates/_helpers.tpl new file mode 100644 index 00000000..23245c14 --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "webservice.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "webservice.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "webservice.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "webservice.labels" -}} +helm.sh/chart: {{ include "webservice.chart" . }} +{{ include "webservice.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "webservice.selectorLabels" -}} +app.kubernetes.io/name: {{ include "webservice.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "webservice.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "webservice.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/deploy/ctrlplane/charts/webservice/templates/deployment.yaml b/deploy/ctrlplane/charts/webservice/templates/deployment.yaml new file mode 100644 index 00000000..cd50acda --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/templates/deployment.yaml @@ -0,0 +1,67 @@ +{{- $imageCfg := dict "global" $.Values.global.image "local" $.Values.image -}} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "webservice.fullname" . }} + labels: + {{- if .Values.deployment.labels -}} + {{- toYaml .Values.deployment.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.deployment.annotations -}} + {{- toYaml .Values.deployment.annotations | nindent 4 }} + {{- end }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "ctrlplane.selectorLabels" $ | nindent 6 }} + {{- include "webservice.labels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "webservice.labels" . | nindent 8 }} + annotations: + {{- if .Values.pod.annotations -}} + {{- toYaml .Values.pod.annotations | nindent 8 }} + {{- end }} + spec: + serviceAccountName: {{ include "webservice.serviceAccountName" . }} + {{- if .tolerations }} + tolerations: + {{- toYaml .tolerations | nindent 8 }} + {{- end }} + {{- include "ctrlplane.nodeSelector" . | nindent 6 }} + {{- include "ctrlplane.priorityClassName" . | nindent 6 }} + {{- include "ctrlplane.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - name: http + containerPort: 8080 + protocol: TCP + env: + {{- include "ctrlplane.extraEnv" (dict "root" $ "local" .) | nindent 12 }} + {{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 12 }} + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /ready + port: http + initialDelaySeconds: 20 + periodSeconds: 5 + startupProbe: + httpGet: + path: /ready + port: http + initialDelaySeconds: 20 + periodSeconds: 5 + failureThreshold: 120 + + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: {} \ No newline at end of file diff --git a/deploy/ctrlplane/charts/webservice/templates/service.yaml b/deploy/ctrlplane/charts/webservice/templates/service.yaml new file mode 100644 index 00000000..07a19509 --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/templates/service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "webservice.fullname" . }} + labels: + {{- include "ctrlplane.commonLabels" . | nindent 4 }} + {{- include "webservice.labels" . | nindent 4 }} + {{- include "webservice.commonLabels" . | nindent 4 }} + {{- if .Values.service.labels -}} + {{- toYaml .Values.service.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.service.annotations -}} + {{- toYaml .Values.service.annotations | nindent 4 }} + {{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: 8080 + protocol: TCP + name: webservice + selector: + {{- include "webservice.labels" . | nindent 4 }} \ No newline at end of file diff --git a/deploy/ctrlplane/charts/webservice/values.yaml b/deploy/ctrlplane/charts/webservice/values.yaml new file mode 100644 index 00000000..933e21dc --- /dev/null +++ b/deploy/ctrlplane/charts/webservice/values.yaml @@ -0,0 +1,32 @@ +nameOverride: "" +fullnameOverride: "" + +replica: 5 + +image: + repository: ctrlplane/webservice + tag: latest + pullPolicy: Always + +extraEnv: {} +extraEnvFrom: {} + +deployment: + labels: {} + annotations: {} + +service: + type: ClusterIP + annotations: {} + labels: {} + +tolerations: [] +pod: {} + +resources: + requests: + cpu: 500m + memory: 1Gi + limits: + cpu: 4000m + memory: 4Gi diff --git a/deploy/ctrlplane/templates/NOTES.txt b/deploy/ctrlplane/templates/NOTES.txt deleted file mode 100644 index b66d22eb..00000000 --- a/deploy/ctrlplane/templates/NOTES.txt +++ /dev/null @@ -1,22 +0,0 @@ -1. Get the application URL by running these commands: -{{- if .Values.ingress.enabled }} -{{- range $host := .Values.ingress.hosts }} - {{- range .paths }} - http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} - {{- end }} -{{- end }} -{{- else if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "ctrlplane.fullname" . }}) - export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT -{{- else if contains "LoadBalancer" .Values.service.type }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "ctrlplane.fullname" . }}' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "ctrlplane.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - echo http://$SERVICE_IP:{{ .Values.service.port }} -{{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "ctrlplane.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") - echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT -{{- end }} diff --git a/deploy/ctrlplane/templates/_env.tpl b/deploy/ctrlplane/templates/_env.tpl new file mode 100644 index 00000000..e231616a --- /dev/null +++ b/deploy/ctrlplane/templates/_env.tpl @@ -0,0 +1,20 @@ +{{- define "ctrlplane.extraEnvFrom" -}} +{{- $global := deepCopy (get .root.Values.global "extraEnvFrom" | default (dict)) -}} +{{- $values := deepCopy (get .root.Values "extraEnvFrom" | default (dict)) -}} +{{- $local := deepCopy (get .local "extraEnvFrom" | default (dict)) -}} +{{- $allExtraEnvFrom := mergeOverwrite $global $values $local -}} +{{- range $key, $value := $allExtraEnvFrom }} +- name: {{ $key }} + valueFrom: +{{ toYaml $value | nindent 4 }} +{{- end -}} +{{- end -}} + + +{{- define "ctrlplane.extraEnv" -}} +{{- $allExtraEnv := merge (default (dict) .Values.extraEnv) .Values.global.extraEnv -}} +{{- range $key, $value := $allExtraEnv }} +- name: {{ $key }} + value: {{ $value | quote }} +{{- end -}} +{{- end -}} \ No newline at end of file diff --git a/deploy/ctrlplane/templates/_labels.tpl b/deploy/ctrlplane/templates/_labels.tpl new file mode 100644 index 00000000..f12a7f91 --- /dev/null +++ b/deploy/ctrlplane/templates/_labels.tpl @@ -0,0 +1,9 @@ +{{- define "ctrlplane.commonLabels" -}} +{{- $commonLabels := merge (pluck "labels" (default (dict) .Values.common) | first) .Values.global.common.labels}} +{{- if $commonLabels }} +{{- range $key, $value := $commonLabels }} +{{ $key }}: {{ $value | quote }} +{{- end }} +{{- end -}} +{{- end -}} + diff --git a/deploy/ctrlplane/templates/_pod.tpl b/deploy/ctrlplane/templates/_pod.tpl new file mode 100644 index 00000000..9afe95fb --- /dev/null +++ b/deploy/ctrlplane/templates/_pod.tpl @@ -0,0 +1,25 @@ +{{- define "ctrlplane.priorityClassName" -}} +{{- $pcName := default .Values.global.priorityClassName .Values.priorityClassName -}} +{{- if $pcName }} +priorityClassName: {{ $pcName }} +{{- end -}} +{{- end -}} + +{{- define "ctrlplane.podSecurityContext" -}} +{{- $psc := . }} +{{- if $psc }} +securityContext: +{{- if not (empty $psc.runAsUser) }} + runAsUser: {{ $psc.runAsUser }} +{{- end }} +{{- if not (empty $psc.runAsGroup) }} + runAsGroup: {{ $psc.runAsGroup }} +{{- end }} +{{- if not (empty $psc.fsGroup) }} + fsGroup: {{ $psc.fsGroup }} +{{- end }} +{{- if not (empty $psc.fsGroupChangePolicy) }} + fsGroupChangePolicy: {{ $psc.fsGroupChangePolicy }} +{{- end }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/deploy/ctrlplane/templates/_selector.tpl b/deploy/ctrlplane/templates/_selector.tpl new file mode 100644 index 00000000..00c11abf --- /dev/null +++ b/deploy/ctrlplane/templates/_selector.tpl @@ -0,0 +1,7 @@ +{{- define "ctrlplane.nodeSelector" -}} +{{- $nodeSelector := default .Values.global.nodeSelector .Values.nodeSelector -}} +{{- if $nodeSelector }} +nodeSelector: + {{- toYaml $nodeSelector | nindent 2 }} +{{- end }} +{{- end -}} \ No newline at end of file diff --git a/deploy/ctrlplane/templates/deployment.yaml b/deploy/ctrlplane/templates/deployment.yaml deleted file mode 100644 index 7b932fd7..00000000 --- a/deploy/ctrlplane/templates/deployment.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "ctrlplane.fullname" . }} - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "ctrlplane.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "ctrlplane.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "ctrlplane.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: {{ .Values.service.port }} - protocol: TCP - livenessProbe: - httpGet: - path: / - port: http - readinessProbe: - httpGet: - path: / - port: http - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} diff --git a/deploy/ctrlplane/templates/hpa.yaml b/deploy/ctrlplane/templates/hpa.yaml deleted file mode 100644 index b9fcb7d8..00000000 --- a/deploy/ctrlplane/templates/hpa.yaml +++ /dev/null @@ -1,28 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "ctrlplane.fullname" . }} - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "ctrlplane.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} diff --git a/deploy/ctrlplane/templates/ingress.yaml b/deploy/ctrlplane/templates/ingress.yaml deleted file mode 100644 index cce0d636..00000000 --- a/deploy/ctrlplane/templates/ingress.yaml +++ /dev/null @@ -1,61 +0,0 @@ -{{- if .Values.ingress.enabled -}} -{{- $fullName := include "ctrlplane.fullname" . -}} -{{- $svcPort := .Values.service.port -}} -{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} - {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} - {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} - {{- end }} -{{- end }} -{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} -kind: Ingress -metadata: - name: {{ $fullName }} - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} - ingressClassName: {{ .Values.ingress.className }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} - pathType: {{ .pathType }} - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ $fullName }} - port: - number: {{ $svcPort }} - {{- else }} - serviceName: {{ $fullName }} - servicePort: {{ $svcPort }} - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/deploy/ctrlplane/templates/service.yaml b/deploy/ctrlplane/templates/service.yaml deleted file mode 100644 index ed9ee360..00000000 --- a/deploy/ctrlplane/templates/service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "ctrlplane.fullname" . }} - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "ctrlplane.selectorLabels" . | nindent 4 }} diff --git a/deploy/ctrlplane/templates/serviceaccount.yaml b/deploy/ctrlplane/templates/serviceaccount.yaml deleted file mode 100644 index d2db7f3b..00000000 --- a/deploy/ctrlplane/templates/serviceaccount.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "ctrlplane.serviceAccountName" . }} - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} diff --git a/deploy/ctrlplane/templates/tests/test-connection.yaml b/deploy/ctrlplane/templates/tests/test-connection.yaml deleted file mode 100644 index 464c44c9..00000000 --- a/deploy/ctrlplane/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "ctrlplane.fullname" . }}-test-connection" - labels: - {{- include "ctrlplane.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "ctrlplane.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/deploy/ctrlplane/values.yaml b/deploy/ctrlplane/values.yaml index e8bbfea1..5a59b849 100644 --- a/deploy/ctrlplane/values.yaml +++ b/deploy/ctrlplane/values.yaml @@ -1,82 +1,3 @@ -# Default values for ctrlplane. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -image: - repository: nginx - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - tag: "" - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: true - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -service: - type: ClusterIP - port: 80 - -ingress: - enabled: false - className: "" - annotations: {} - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - hosts: - - host: chart-example.local - paths: - - path: / - pathType: ImplementationSpecific - tls: [] - # - secretName: chart-example-tls - # hosts: - # - chart-example.local - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -nodeSelector: {} - -tolerations: [] - -affinity: {} +global: + extraEnvFrom: {} + extraEnv: {} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1d06fc2b..e0944dac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -217,7 +217,59 @@ importers: specifier: ^5.4.5 version: 5.5.4 - apps/nextjs: + apps/provider: + dependencies: + '@ctrlplane/db': + specifier: workspace:* + version: link:../../packages/db + '@google-cloud/container': + specifier: ^5.16.0 + version: 5.16.0 + '@kubernetes/client-node': + specifier: ^0.21.0 + version: 0.21.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) + '@t3-oss/env-core': + specifier: ^0.10.1 + version: 0.10.1(typescript@5.5.3)(zod@3.23.8) + cron: + specifier: ^3.1.7 + version: 3.1.7 + dotenv: + specifier: ^16.4.5 + version: 16.4.5 + google-auth-library: + specifier: ^9.13.0 + version: 9.13.0 + semver: + specifier: ^7.6.2 + version: 7.6.3 + zod: + specifier: 'catalog:' + version: 3.23.8 + devDependencies: + '@ctrlplane/eslint-config': + specifier: workspace:^ + version: link:../../tooling/eslint + '@ctrlplane/prettier-config': + specifier: workspace:^ + version: link:../../tooling/prettier + '@ctrlplane/tsconfig': + specifier: workspace:* + version: link:../../tooling/typescript + eslint: + specifier: 'catalog:' + version: 9.9.0(jiti@1.21.6) + prettier: + specifier: 'catalog:' + version: 3.3.3 + tsx: + specifier: ^4.11.0 + version: 4.16.2 + typescript: + specifier: ^5.4.5 + version: 5.5.3 + + apps/webservice: dependencies: '@ctrlplane/api': specifier: workspace:* @@ -446,58 +498,6 @@ importers: specifier: ^1.3.0 version: 1.3.0 - apps/provider: - dependencies: - '@ctrlplane/db': - specifier: workspace:* - version: link:../../packages/db - '@google-cloud/container': - specifier: ^5.16.0 - version: 5.16.0 - '@kubernetes/client-node': - specifier: ^0.21.0 - version: 0.21.0(bufferutil@4.0.8)(utf-8-validate@6.0.4) - '@t3-oss/env-core': - specifier: ^0.10.1 - version: 0.10.1(typescript@5.5.3)(zod@3.23.8) - cron: - specifier: ^3.1.7 - version: 3.1.7 - dotenv: - specifier: ^16.4.5 - version: 16.4.5 - google-auth-library: - specifier: ^9.13.0 - version: 9.13.0 - semver: - specifier: ^7.6.2 - version: 7.6.3 - zod: - specifier: 'catalog:' - version: 3.23.8 - devDependencies: - '@ctrlplane/eslint-config': - specifier: workspace:^ - version: link:../../tooling/eslint - '@ctrlplane/prettier-config': - specifier: workspace:^ - version: link:../../tooling/prettier - '@ctrlplane/tsconfig': - specifier: workspace:* - version: link:../../tooling/typescript - eslint: - specifier: 'catalog:' - version: 9.9.0(jiti@1.21.6) - prettier: - specifier: 'catalog:' - version: 3.3.3 - tsx: - specifier: ^4.11.0 - version: 4.16.2 - typescript: - specifier: ^5.4.5 - version: 5.5.3 - apps/webshell-router: dependencies: '@ctrlplane/db': @@ -1232,10 +1232,6 @@ packages: resolution: {integrity: sha512-DXG/BhegtMHhnN7YPIvxWd303/9aXvYFD1TjNL3CD6tUrhI2LVsg3Lck0aql5TRH29n4sj3emcROypkZVUfSuA==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.24.5': - resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} - engines: {node: '>=6.9.0'} - '@babel/runtime@7.24.7': resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} engines: {node: '>=6.9.0'} @@ -1811,9 +1807,6 @@ packages: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} - '@jridgewell/sourcemap-codec@1.4.15': - resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} @@ -2085,9 +2078,6 @@ packages: '@octokit/types@13.5.0': resolution: {integrity: sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==} - '@panva/hkdf@1.1.1': - resolution: {integrity: sha512-dhPeilub1NuIG0X5Kvhh9lH4iW3ZsHlnzwgwbOlgwQ2wG1IqFzsgHqmKPk3WzsdWAeaxKJxgM0+W433RmN45GA==} - '@panva/hkdf@1.2.0': resolution: {integrity: sha512-97ZQvZJ4gJhi24Io6zI+W7B67I82q1I8i3BSzQ4OyZj1z4OW87/ruF26lrMES58inTKLy2KgVIDcx8PU4AaANQ==} @@ -5817,9 +5807,6 @@ packages: jose@4.15.9: resolution: {integrity: sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==} - jose@5.2.3: - resolution: {integrity: sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==} - jose@5.6.2: resolution: {integrity: sha512-F1t1/WZJ4JdmCE/XoMYw1dPOW5g8JF0xGm6Ox2fwaCAPlCzt+4Bh0EWP59iQuZNHHauDkCdjx+kCZSh5z/PGow==} @@ -6507,9 +6494,6 @@ packages: oauth-sign@0.9.0: resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==} - oauth4webapi@2.10.3: - resolution: {integrity: sha512-9FkXEXfzVKzH63GUOZz1zMr3wBaICSzk6DLXx+CGdrQ10ItNk2ePWzYYc1fdmKq1ayGFb2aX97sRCoZ2s0mkDw==} - oauth4webapi@2.11.1: resolution: {integrity: sha512-aNzOnL98bL6izG97zgnZs1PFEyO4WDVRhz2Pd066NPak44w5ESLRCYmJIyey8avSBPOMtBjhF3ZDDm7bIb7UOg==} @@ -8273,11 +8257,11 @@ snapshots: '@auth/core@0.31.0': dependencies: - '@panva/hkdf': 1.1.1 + '@panva/hkdf': 1.2.0 '@types/cookie': 0.6.0 cookie: 0.6.0 - jose: 5.2.3 - oauth4webapi: 2.10.3 + jose: 5.6.2 + oauth4webapi: 2.11.1 preact: 10.11.3 preact-render-to-string: 5.2.3(preact@10.11.3) @@ -8420,10 +8404,6 @@ snapshots: core-js-pure: 3.37.1 regenerator-runtime: 0.14.1 - '@babel/runtime@7.24.5': - dependencies: - regenerator-runtime: 0.14.1 - '@babel/runtime@7.24.7': dependencies: regenerator-runtime: 0.14.1 @@ -8856,14 +8836,12 @@ snapshots: '@jridgewell/set-array@1.2.1': {} - '@jridgewell/sourcemap-codec@1.4.15': {} - '@jridgewell/sourcemap-codec@1.5.0': {} '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/trace-mapping@0.3.9': dependencies: @@ -9157,8 +9135,6 @@ snapshots: dependencies: '@octokit/openapi-types': 22.2.0 - '@panva/hkdf@1.1.1': {} - '@panva/hkdf@1.2.0': {} '@pkgjs/parseargs@0.11.0': @@ -9196,7 +9172,7 @@ snapshots: '@radix-ui/primitive@1.0.1': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/primitive@1.1.0': {} @@ -9307,7 +9283,7 @@ snapshots: '@radix-ui/react-compose-refs@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -9320,7 +9296,7 @@ snapshots: '@radix-ui/react-context@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -9333,7 +9309,7 @@ snapshots: '@radix-ui/react-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-context': 1.0.1(@types/react@18.3.3)(react@18.3.1) @@ -9384,7 +9360,7 @@ snapshots: '@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/primitive': 1.0.1 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -9426,7 +9402,7 @@ snapshots: '@radix-ui/react-focus-guards@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 react: 18.3.1 optionalDependencies: '@types/react': 18.3.3 @@ -9439,7 +9415,7 @@ snapshots: '@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) @@ -9483,7 +9459,7 @@ snapshots: '@radix-ui/react-id@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -9596,7 +9572,7 @@ snapshots: '@radix-ui/react-portal@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -9616,7 +9592,7 @@ snapshots: '@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 @@ -9637,7 +9613,7 @@ snapshots: '@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-slot': 1.0.2(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -9746,7 +9722,7 @@ snapshots: '@radix-ui/react-slot@1.0.2(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -9825,7 +9801,7 @@ snapshots: '@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.3)(react@18.3.1)': dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.3)(react@18.3.1) react: 18.3.1 optionalDependencies: @@ -13920,8 +13896,6 @@ snapshots: jose@4.15.9: optional: true - jose@5.2.3: {} - jose@5.6.2: {} js-base64@3.7.7: {} @@ -14123,7 +14097,7 @@ snapshots: match-sorter@6.3.4: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 remove-accents: 0.5.0 mdast-util-definitions@5.1.2: @@ -14719,7 +14693,7 @@ snapshots: nano-css@5.6.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 css-tree: 1.1.3 csstype: 3.1.3 fastest-stable-stringify: 2.0.2 @@ -14905,8 +14879,6 @@ snapshots: oauth-sign@0.9.0: {} - oauth4webapi@2.10.3: {} - oauth4webapi@2.11.1: {} object-assign@4.1.1: {} @@ -15558,10 +15530,10 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-universal-interface@0.6.2(react@18.3.1)(tslib@2.6.2): + react-universal-interface@0.6.2(react@18.3.1)(tslib@2.6.3): dependencies: react: 18.3.1 - tslib: 2.6.2 + tslib: 2.6.3 react-use-websocket@4.8.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: @@ -15579,13 +15551,13 @@ snapshots: nano-css: 5.6.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-universal-interface: 0.6.2(react@18.3.1)(tslib@2.6.2) + react-universal-interface: 0.6.2(react@18.3.1)(tslib@2.6.3) resize-observer-polyfill: 1.5.1 screenfull: 5.2.0 set-harmonic-interval: 1.0.1 throttle-debounce: 3.0.1 ts-easing: 0.2.0 - tslib: 2.6.2 + tslib: 2.6.3 react@18.3.1: dependencies: @@ -15829,7 +15801,7 @@ snapshots: rtl-css-js@1.16.1: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.7 run-async@2.4.1: {}