From 8b14aa80c106848d3b06118f7dec53c90aedfa62 Mon Sep 17 00:00:00 2001 From: Joseph Ware <53935796+DiamondJoseph@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:26:57 +0000 Subject: [PATCH] Add helm (#827) * Naive output of `helm create tiled` * Update Chart and values * Mount API key, config, set default port * Working example from single_catalog_single_user * Make use of fastapi healthz endpoint * Add docs and enforce mounting api key as Secret * Add github action to publish Helm chart * Switch Service type to ClusterIP to prevent exposing prematurely * Whitespace * Example deployment level configuration * Linting * Adjust names of secrets to match RFC requirements * Whitespace * Ensure semVer compliance * Remove leading v on tag if present to ensure semVer compatible * Ensure Helm chart valid prior to first publish * Defer SemVer parsing to docker metadata action --- .github/workflows/publish-image.yml | 22 ++- .pre-commit-config.yaml | 2 + CHANGELOG.md | 1 + docs/source/how-to/helm.md | 98 ++++++++++++ docs/source/index.md | 1 + helm/tiled/.helmignore | 23 +++ helm/tiled/Chart.yaml | 19 +++ helm/tiled/templates/NOTES.txt | 22 +++ helm/tiled/templates/_helpers.tpl | 62 ++++++++ helm/tiled/templates/configmap.yaml | 7 + helm/tiled/templates/deployment.yaml | 77 ++++++++++ helm/tiled/templates/hpa.yaml | 32 ++++ helm/tiled/templates/ingress.yaml | 43 ++++++ helm/tiled/templates/service.yaml | 15 ++ helm/tiled/templates/serviceaccount.yaml | 13 ++ .../templates/tests/test-connection.yaml | 15 ++ helm/tiled/values.yaml | 140 ++++++++++++++++++ 17 files changed, 590 insertions(+), 2 deletions(-) create mode 100644 docs/source/how-to/helm.md create mode 100644 helm/tiled/.helmignore create mode 100644 helm/tiled/Chart.yaml create mode 100644 helm/tiled/templates/NOTES.txt create mode 100644 helm/tiled/templates/_helpers.tpl create mode 100644 helm/tiled/templates/configmap.yaml create mode 100644 helm/tiled/templates/deployment.yaml create mode 100644 helm/tiled/templates/hpa.yaml create mode 100644 helm/tiled/templates/ingress.yaml create mode 100644 helm/tiled/templates/service.yaml create mode 100644 helm/tiled/templates/serviceaccount.yaml create mode 100644 helm/tiled/templates/tests/test-connection.yaml create mode 100644 helm/tiled/values.yaml diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index e7e28cad9..bbca7fa9d 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -3,7 +3,7 @@ # separate terms of service, privacy policy, and support # documentation. -name: Create and publish image +name: Create and publish image and chart on: push: @@ -15,7 +15,7 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - build-and-push-image: + build-and-push: runs-on: ubuntu-latest permissions: contents: read @@ -39,6 +39,8 @@ jobs: uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc @@ -48,3 +50,19 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + - name: Install Helm + uses: Azure/setup-helm@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + id: install + + - name: Log in to the Chart registry + run: | + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} --username ${{ github.repository_owner }} --password-stdin + + - name: Package and Push chart + run: | + helm dependencies update helm/tiled + helm package helm/tiled --version ${{ steps.meta.outputs.version }} --app-version ${{ steps.meta.outputs.version }} -d /tmp/ + helm push /tmp/tiled-${{ steps.meta.outputs.version }}.tgz oci://ghcr.io/bluesky/charts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 503573beb..37332184e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,8 @@ repos: - id: check-merge-conflict - id: check-symlinks - id: check-yaml + # These yaml files output valid yaml only after templating + exclude: ^helm/tiled/templates/ - id: debug-statements - repo: https://github.com/pycqa/flake8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c93632e7..61deb8ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ Write the date in place of the "Unreleased" in the case a new version is release - Fix bug where access policies were not applied to child nodes during request - Add metadata-based access control to SimpleAccessPolicy - Add example test of metadata-based allowed_scopes which requires the path to the target node +- Added Helm chart with deployable default configuration ### Fixed diff --git a/docs/source/how-to/helm.md b/docs/source/how-to/helm.md new file mode 100644 index 000000000..dbed2ccee --- /dev/null +++ b/docs/source/how-to/helm.md @@ -0,0 +1,98 @@ +# Run Tiled Server from the Helm chart + +There is an official Tiled helm chart image for use with +[Helm](https://helm.sh/) and [Kubernetes](https://kubernetes.io/). + +## Quickstart + +This quickstart guide installs the Tiled server configured with a single API key +with permissions to write and access all data. It is not intended for production use, +and is just a useful default with minimal configuration. + +Installing the Helm chart with default values: + +``` +helm install tiled oci://ghcr.io/bluesky/charts/tiled +``` + +This Helm chart additionally refers to, but does not create, a Secret that contains +the value to use as the API key. It is highly recommended to use a +[SealedSecret](https://github.com/bitnami-labs/sealed-secrets#readme) if kubeseal is +available on the cluster you are installing into. + +See the [Docker documentation](./docker.md) for instructions on creating a secure key. + +```sh +# This will only decrypt in your namespace, in your cluster, and is safe to commit +$ echo -n | kubeseal --raw --namespace --name tiled-secrets +AgCC... +``` + +Use the result as the body of a SealedSecret: + +```yaml +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: tiled-secrets +spec: + encryptedData: + TILED_SINGLE_USER_API_KEY: AgCC... +``` + +Apply the SealedSecret to the cluster with kubernetes: + +```sh +kubectl apply -f secret.yaml +``` + +## Further Configuration + +A common pattern for managing the configuration of a Helm chart is to wrap the config +as another layer of chart, with the bundled instance configuration and the dependent +charts kept under source control. + +``` +( + | Chart.yaml + | values.yaml + | \templates + | secret.yaml + | .git +``` + +The dependent chart(s): tiled and any other services that *should live and die with the +tiled instance* can be referenced from the Chart.yaml: + +```yaml +apiVersion: v2 +name: my-install-of-tiled +description: tiled configured for use at... + +version: 0.1.0 +appVersion: v0.1.0b12 + +type: application + +dependencies: +# Fetches the tiled Helm chart with version 0.1.0 + - name: tiled + version: "0.1.0" + repository: "oci://ghcr.io/bluesky/charts" +``` + +While overrides for the bundled values.yaml in each dependency chart can be passed +as part of the values.yaml. + +Note that the `name` in the `dependencies` in the Chart.yaml give the top-level key +to use in the values.yaml: + +```yaml +tiled: + # This is mounted as config.yaml to the tiled container + # Replacing `config` value in the helm/tiled/values.yaml file in this repository + config: {} +``` + +Additional templates to be deployed alongside the tiled server can be defined- for +example the SealedSecret defined above. diff --git a/docs/source/index.md b/docs/source/index.md index 5dd157fb9..82f80194d 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -22,6 +22,7 @@ how-to/authentication how-to/profiles how-to/client-logger how-to/docker +how-to/helm how-to/configuration how-to/read-custom-formats how-to/custom-export-formats diff --git a/helm/tiled/.helmignore b/helm/tiled/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/helm/tiled/.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/helm/tiled/Chart.yaml b/helm/tiled/Chart.yaml new file mode 100644 index 000000000..f6e651401 --- /dev/null +++ b/helm/tiled/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +name: tiled +description: Tiled is a data access service for data-aware portals and data science tools. + +# 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 + +# Chart version, automatically incremented by CI during release +version: 0.0.1 + +# Container version, automatically incremented by CI during release +appVersion: v0.1.0b12 diff --git a/helm/tiled/templates/NOTES.txt b/helm/tiled/templates/NOTES.txt new file mode 100644 index 000000000..2560662aa --- /dev/null +++ b/helm/tiled/templates/NOTES.txt @@ -0,0 +1,22 @@ +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 "tiled.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 its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "tiled.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "tiled.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 "tiled.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/helm/tiled/templates/_helpers.tpl b/helm/tiled/templates/_helpers.tpl new file mode 100644 index 000000000..2312e5218 --- /dev/null +++ b/helm/tiled/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "tiled.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 "tiled.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 "tiled.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "tiled.labels" -}} +helm.sh/chart: {{ include "tiled.chart" . }} +{{ include "tiled.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "tiled.selectorLabels" -}} +app.kubernetes.io/name: {{ include "tiled.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "tiled.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "tiled.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/helm/tiled/templates/configmap.yaml b/helm/tiled/templates/configmap.yaml new file mode 100644 index 000000000..aefbd0f7d --- /dev/null +++ b/helm/tiled/templates/configmap.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "tiled.fullname" . }}-config +data: + config.yaml: |- + {{- toYaml .Values.config | nindent 4 }} diff --git a/helm/tiled/templates/deployment.yaml b/helm/tiled/templates/deployment.yaml new file mode 100644 index 000000000..6fe7d60a0 --- /dev/null +++ b/helm/tiled/templates/deployment.yaml @@ -0,0 +1,77 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "tiled.fullname" . }} + labels: + {{- include "tiled.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "tiled.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "tiled.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "tiled.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: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- with .Values.volumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.extraEnvVars }} + env: + {{- toYaml . | nindent 12 }} + {{- end }} + volumes: + - name: config + projected: + sources: + - configMap: + name: {{ include "tiled.fullname" . }}-config + {{- with .Values.volumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- 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/helm/tiled/templates/hpa.yaml b/helm/tiled/templates/hpa.yaml new file mode 100644 index 000000000..26e05d510 --- /dev/null +++ b/helm/tiled/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "tiled.fullname" . }} + labels: + {{- include "tiled.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "tiled.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/tiled/templates/ingress.yaml b/helm/tiled/templates/ingress.yaml new file mode 100644 index 000000000..64cc21553 --- /dev/null +++ b/helm/tiled/templates/ingress.yaml @@ -0,0 +1,43 @@ +{{- if .Values.ingress.enabled -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ include "tiled.fullname" . }} + labels: + {{- include "tiled.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.ingress.className }} + ingressClassName: {{ . }} + {{- 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 }} + {{- with .pathType }} + pathType: {{ . }} + {{- end }} + backend: + service: + name: {{ include "tiled.fullname" $ }} + port: + number: {{ $.Values.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/tiled/templates/service.yaml b/helm/tiled/templates/service.yaml new file mode 100644 index 000000000..5feb1afa6 --- /dev/null +++ b/helm/tiled/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "tiled.fullname" . }} + labels: + {{- include "tiled.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "tiled.selectorLabels" . | nindent 4 }} diff --git a/helm/tiled/templates/serviceaccount.yaml b/helm/tiled/templates/serviceaccount.yaml new file mode 100644 index 000000000..3a7c569de --- /dev/null +++ b/helm/tiled/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "tiled.serviceAccountName" . }} + labels: + {{- include "tiled.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +automountServiceAccountToken: {{ .Values.serviceAccount.automount }} +{{- end }} diff --git a/helm/tiled/templates/tests/test-connection.yaml b/helm/tiled/templates/tests/test-connection.yaml new file mode 100644 index 000000000..54d3daa7d --- /dev/null +++ b/helm/tiled/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "tiled.fullname" . }}-test-connection" + labels: + {{- include "tiled.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "tiled.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/helm/tiled/values.yaml b/helm/tiled/values.yaml new file mode 100644 index 000000000..b714a9ca8 --- /dev/null +++ b/helm/tiled/values.yaml @@ -0,0 +1,140 @@ +# Default values for tiled. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +config: + authentication: + allow_anonymous_access: false + trees: + - path: / + tree: catalog + args: + uri: "sqlite+aiosqlite:////storage/catalog.db" + writable_storage: "/storage/data" + init_if_not_exists: true + +# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ +replicaCount: 1 + +# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/ +image: + repository: ghcr.io/bluesky/tiled + # This sets the pull policy for images. + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ +imagePullSecrets: [] +# This is to override the chart name. +nameOverride: "" +fullnameOverride: "" + +#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +serviceAccount: + # Specifies whether a service account should be created + create: false + # Automatically mount a ServiceAccount's API credentials? + automount: 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: "" + +# This is for setting Kubernetes Annotations to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +podAnnotations: {} +# This is for setting Kubernetes Labels to a Pod. +# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/ +service: + # This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types + type: ClusterIP + # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports + port: 8000 + +# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ +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 + +# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ +livenessProbe: + httpGet: + path: /healthz + port: http +readinessProbe: + httpGet: + path: /healthz + port: http + +#This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +# Additional volumes on the output Deployment definition. +volumes: [] + + +# Additional volumeMounts on the output Deployment definition. +volumeMounts: + - name: config + mountPath: "/deploy/config" + readOnly: true + +nodeSelector: {} + +tolerations: [] + +affinity: {} + + +# Additional envVars to mount to the pod +extraEnvVars: +- name: TILED_SINGLE_USER_API_KEY + valueFrom: + secretKeyRef: + name: tiled-secrets + key: TILED_SINGLE_USER_API_KEY