├── .github
├── community-maintained.svg
├── config.yaml
├── release.yml
└── workflows
│ ├── helm-docs.yml
│ └── helm-release.yml
├── .gitignore
├── .pre-commit-config.yaml
├── README.md
└── charts
└── directus
├── .helmignore
├── Chart.yaml
├── README.md
├── templates
├── NOTES.txt
├── _helpers.tpl
├── configmap.yaml
├── deployment.yaml
├── hpa.yaml
├── ingress.yaml
├── secrets-application.yaml
├── secrets-mysql.yaml
├── secrets-postgresql.yaml
├── service.yaml
├── serviceaccount.yaml
└── tests
│ └── test-connection.yaml
└── values.yaml
/.github/community-maintained.svg:
--------------------------------------------------------------------------------
1 |
6 |
--------------------------------------------------------------------------------
/.github/config.yaml:
--------------------------------------------------------------------------------
1 | generate-release-notes: true
2 | skip-existing: true
3 |
--------------------------------------------------------------------------------
/.github/release.yml:
--------------------------------------------------------------------------------
1 | changelog:
2 | categories:
3 | - title: Breaking Changes 🚨
4 | labels:
5 | - breaking change
6 | - title: Enhancements 🚀
7 | labels:
8 | - enhancement
9 | - title: Bug Fixes 🐛
10 | labels:
11 | - defect
12 | - title: Dependency Updates 🤖
13 | labels:
14 | - dependencies
15 | - title: Other Changes 🧰
16 | labels:
17 | - "*"
--------------------------------------------------------------------------------
/.github/workflows/helm-docs.yml:
--------------------------------------------------------------------------------
1 | name: Helm Docs
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | paths:
8 | - .github/workflows/**
9 | - charts/**
10 | workflow_dispatch: { }
11 |
12 | permissions: { }
13 |
14 | jobs:
15 | update-docs:
16 | name: Update Docs
17 | runs-on: ubuntu-latest
18 | timeout-minutes: 5
19 | permissions:
20 | contents: write
21 | pull-requests: write
22 | steps:
23 | - name: Checkout Repository
24 | uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # tag=v4.2.0
25 | - name: Setup Go
26 | uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
27 | with:
28 | go-version: "1.22"
29 | check-latest: true
30 | - name: Install helm-docs
31 | run: go install -v github.com/norwoodj/helm-docs/cmd/helm-docs@v1.13.1
32 | - name: Run helm-docs
33 | run: helm-docs
34 | - name: Create Pull Request
35 | uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # tag=v7.0.5
36 | with:
37 | add-paths: "charts/*/README.md"
38 | branch: update-helm-docs
39 | body: "Updates Helm chart documentation using [helm-docs](https://github.com/norwoodj/helm-docs)"
40 | commit-message: Update helm docs
41 | delete-branch: true
42 | labels: documentation
43 | signoff: true
44 | title: Update helm docs
--------------------------------------------------------------------------------
/.github/workflows/helm-release.yml:
--------------------------------------------------------------------------------
1 | name: Helm Release
2 |
3 | on:
4 | workflow_dispatch: { }
5 |
6 | permissions: { }
7 |
8 | jobs:
9 | release:
10 | name: Release
11 | runs-on: ubuntu-latest
12 | timeout-minutes: 5
13 | permissions:
14 | contents: write
15 | steps:
16 | - name: Checkout Repository
17 | uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # tag=v4.2.0
18 | with:
19 | fetch-depth: "0"
20 | - name: Configure Git
21 | run: |
22 | git config user.name "$GITHUB_ACTOR"
23 | git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
24 | - name: Set up Helm
25 | uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # tag=v4.2.0
26 | - name: Release Chart
27 | uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # tag=v1.6.0
28 | env:
29 | CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30 | with:
31 | config: .github/config.yaml
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # General files for the project
2 | pkg/*
3 | *.pyc
4 | bin/*
5 | .project
6 | /.bin
7 | /_test/secrets/*.json
8 |
9 | # OSX leaves these everywhere on SMB shares
10 | ._*
11 |
12 | # OSX trash
13 | .DS_Store
14 |
15 | # Files generated by JetBrains IDEs, e.g. IntelliJ IDEA
16 | .idea/
17 | *.iml
18 |
19 | # Vscode files
20 | .vscode
21 |
22 | # Emacs save files
23 | *~
24 | \#*\#
25 | .\#*
26 |
27 | # Vim-related files
28 | [._]*.s[a-w][a-z]
29 | [._]s[a-w][a-z]
30 | *.un~
31 | Session.vim
32 | .netrwhist
33 |
34 | # Chart dependencies
35 | **/charts/*.tgz
36 | Chart.lock
37 |
38 | .history
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/pre-commit/pre-commit-hooks
3 | rev: v5.0.0
4 | hooks:
5 | - id: check-added-large-files
6 | args: [ '--maxkb=128' ]
7 | - id: check-case-conflict
8 | - id: check-executables-have-shebangs
9 | - id: check-json
10 | - id: check-merge-conflict
11 | - id: check-shebang-scripts-are-executable
12 | - id: detect-aws-credentials
13 | args: [ '--allow-missing-credentials' ]
14 | - id: detect-private-key
15 | - id: end-of-file-fixer
16 | - id: mixed-line-ending
17 | args: [ --fix=lf ]
18 | - id: no-commit-to-branch
19 | args: [--branch, dev, --branch, main]
20 | - id: pretty-format-json
21 | args: [ --autofix, --no-sort-keys, --indent, "4" ]
22 | - id: trailing-whitespace
23 | args: [ --markdown-linebreak-ext=md ]
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | > [!NOTE]
2 | >
3 | > This is a community-maintained repository and is not actively maintained by the Directus Core Team.
4 |
5 | # Directus Community Helm Charts
6 |
7 | This is the Community Helm Charts repository for [Directus](https://directus.io/).
8 |
9 | ## Usage
10 |
11 | To install the Directus Helm charts, you need to add the following repository:
12 |
13 | ```sh
14 | helm repo add directus https://directus-labs.github.io/helm-chart/
15 | ```
16 |
17 | ## Documentation
18 |
19 | Chart documentation is found in [Directus directory](charts/directus/README.md).
20 |
--------------------------------------------------------------------------------
/charts/directus/.helmignore:
--------------------------------------------------------------------------------
1 | # Patterns to ignore when building packages.
2 | # This supports shell glob matching, relative path matching, and
3 | # negation (prefixed with !). Only one pattern per line.
4 | .DS_Store
5 | # Common VCS dirs
6 | .git/
7 | .gitignore
8 | .bzr/
9 | .bzrignore
10 | .hg/
11 | .hgignore
12 | .svn/
13 | # Common backup files
14 | *.swp
15 | *.bak
16 | *.tmp
17 | *.orig
18 | *~
19 | # Various IDEs
20 | .project
21 | .idea/
22 | *.tmproj
23 | .vscode/
24 |
--------------------------------------------------------------------------------
/charts/directus/Chart.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v2
2 | name: directus
3 | type: application
4 |
5 | description: |
6 | A Helm chart for installing Directus on Kubernetes.
7 | Directus is a real-time API and App dashboard for managing SQL database content.
8 |
9 | home: https://directus.io/
10 |
11 | sources:
12 | - https://github.com/directus-labs/helm-chart/tree/master/charts/directus
13 | - https://github.com/directus/directus
14 |
15 | icon: https://avatars.githubusercontent.com/u/79210894
16 |
17 | maintainers:
18 | - name: mikesindieiev
19 | email: sindieiev@protonmail.ch
20 | url: https://github.com/directus-labs/helm-chart
21 |
22 | version: 2.0.2
23 | appVersion: "11.8.0"
24 |
25 | dependencies:
26 | - name: mysql
27 | version: "~13.0.0"
28 | repository: "https://charts.bitnami.com/bitnami"
29 | condition: mysql.enableInstallation
30 | - name: postgresql
31 | version: "~16.7.8"
32 | repository: "https://charts.bitnami.com/bitnami"
33 | condition: postgresql.enableInstallation
34 | - name: redis
35 | version: "~21.1.11"
36 | repository: "https://charts.bitnami.com/bitnami"
37 | condition: redis.enabled
38 |
--------------------------------------------------------------------------------
/charts/directus/README.md:
--------------------------------------------------------------------------------
1 | # directus
2 |
3 |   
4 |
5 | A Helm chart for installing Directus on Kubernetes.
6 | Directus is a real-time API and App dashboard for managing SQL database content.
7 |
8 | **Homepage:**
9 |
10 | ## Maintainers
11 |
12 | | Name | Email | Url |
13 | | ---- | ------ | --- |
14 | | mikesindieiev | | |
15 |
16 | ## Source Code
17 |
18 | *
19 | *
20 |
21 | ## Requirements
22 |
23 | | Repository | Name | Version |
24 | |------------|------|---------|
25 | | https://charts.bitnami.com/bitnami | mysql | ~13.0.0 |
26 | | https://charts.bitnami.com/bitnami | postgresql | ~16.7.8 |
27 | | https://charts.bitnami.com/bitnami | redis | ~21.1.11 |
28 |
29 | ## Values
30 |
31 | | Key | Type | Default | Description |
32 | |-----|------|---------|-------------|
33 | | adminEmail | string | `"directus-admin@example.com"` | |
34 | | affinity | object | `{}` | |
35 | | applicationSecretName | string | `"directus-application-secret"` | |
36 | | attachExistingSecrets | list | `[]` | |
37 | | autoscaling.enabled | bool | `false` | |
38 | | autoscaling.maxReplicas | int | `100` | |
39 | | autoscaling.minReplicas | int | `1` | |
40 | | autoscaling.targetCPUUtilizationPercentage | int | `80` | |
41 | | createApplicationSecret | bool | `true` | This setting enables the creation of `ADMIN_PASSWORD`, `KEY`, and `SECRET` variables in k8s secrets If it is set to false, you MUST set these variables manually via existing secret resource and set its name below |
42 | | createMysqlSecret | bool | `true` | Create MySQL secret in Directus chart If set to enable, mysql secret with values of `mysql-root-password`, `mysql-replication-password` and `mysql-password` variables will be created Please consult the official bitnami mysql values file - https://github.com/bitnami/charts/blob/main/bitnami/mysql/values.yaml#L152 If set to false, you MUST create a secret resource in k8s for mysql installation and set the correct value to the `existingSecret` in the mysql settings section |
43 | | createPostgresqlSecret | bool | `false` | Create PostgreSQL secret in Directus chart If set to enable, postgresql secret with values of `postgres-password`, `password`, and `replication-password` variables will be created Please consult the official bitnami postgres values file - https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml#L164 If set to false, you MUST create a secret resource in k8s for postgresql installation and set the correct value to the `existingSecret` in the postgresql settings setion |
44 | | databaseEngine | string | `"mysql"` | Database engine. Could be set to one value from the following list: mysql, postgresql Please disable installations for other database engines in this chart Please not if you use mariadb server, set databaseEngine to 'mysql' value Details are here - https://docs.directus.io/self-hosted/config-options.html#database |
45 | | extraEnvVars | list | `[]` | |
46 | | extraVolumeMounts | list | `[]` | |
47 | | extraVolumes | list | `[]` | |
48 | | fullnameOverride | string | `""` | Completely overrides Chart name |
49 | | image.pullPolicy | string | `"IfNotPresent"` | Pull policy for docker image |
50 | | image.repository | string | `"directus/directus"` | Directus image docker repository |
51 | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
52 | | imagePullSecrets | list | `[]` | Image Pull Secrets in k8s for docker image |
53 | | ingress.annotations | object | `{}` | Ingress annotations. Usually used in cloud environments |
54 | | ingress.className | string | `""` | |
55 | | ingress.enableTLS | bool | `true` | Enable TLS in PUBLIC_URL |
56 | | ingress.enabled | bool | `false` | |
57 | | ingress.hosts[0] | object | `{"host":"chart-example.local","paths":[{"path":"/","pathType":"Prefix"}]}` | Hostname to expose. You should create CNAME DNS record with this hostname to redirect to ALB DNS name |
58 | | ingress.tls | list | `[]` | |
59 | | initContainers | list | `[]` | Init Containers for Directus pod |
60 | | livenessProbe.enabled | bool | `true` | |
61 | | livenessProbe.httpGet.path | string | `"/"` | |
62 | | livenessProbe.httpGet.port | string | `"http"` | |
63 | | mysql.auth.database | string | `"directus_mysql"` | |
64 | | mysql.auth.existingSecret | string | `"directus-mysql-secret"` | |
65 | | mysql.auth.username | string | `"directus_mysql"` | |
66 | | mysql.enableInstallation | bool | `true` | The switch to switch off the installation of the mysql The rest of the settings are being used during the installation and for DB connection Link to the values.yaml file in bitnami repo - https://github.com/bitnami/charts/blob/main/bitnami/mysql/values.yaml |
67 | | mysql.mysqlPort | string | `""` | |
68 | | mysql.mysqlURL | string | `""` | |
69 | | nameOverride | string | `""` | Helm name override in Chart.yaml. This name is being used for resource naming |
70 | | nodeSelector | object | `{}` | |
71 | | podAnnotations | object | `{}` | |
72 | | podSecurityContext | object | `{}` | |
73 | | postgresql.auth.database | string | `"directus_postgres"` | |
74 | | postgresql.auth.existingSecret | string | `"directus-postgresql-secret"` | |
75 | | postgresql.auth.username | string | `"directus_postgres"` | |
76 | | postgresql.enableInstallation | bool | `false` | The switch to switch off the installation of the postgresql The rest of the settings are being used during the installation and for DB connection Link to the values.yaml file in bitnami repo - https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml |
77 | | postgresql.postgresqlPort | string | `""` | |
78 | | postgresql.postgresqlURL | string | `""` | |
79 | | readinessProbe.enabled | bool | `true` | |
80 | | readinessProbe.httpGet.path | string | `"/"` | |
81 | | readinessProbe.httpGet.port | string | `"http"` | |
82 | | redis.auth.existingSecret | string | `""` | Existing secret name with Redis password |
83 | | redis.auth.existingSecretPasswordKey | string | `""` | The key in the secret with password |
84 | | redis.enabled | bool | `true` | Switch to enable Redis |
85 | | redis.replica.replicaCount | int | `0` | Amount of Redis replicas |
86 | | replicaCount | int | `1` | |
87 | | resources | object | `{}` | |
88 | | securityContext | object | `{}` | |
89 | | service.port | int | `80` | |
90 | | service.type | string | `"ClusterIP"` | |
91 | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
92 | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created |
93 | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
94 | | sidecar.command | list | `["/bin/sh","-c","sleep 3600;"]` | Command to run in sidecar docker image |
95 | | sidecar.enabled | bool | `false` | Sidecars for Directus pod |
96 | | sidecar.pullPolicy | string | `"Always"` | |
97 | | sidecar.repository | string | `"busybox"` | |
98 | | sidecar.securityContext | object | `{}` | |
99 | | sidecar.tag | string | `"latest"` | |
100 | | sidecars | list | `[]` | Sidecars for Directus pod |
101 | | startupProbe.enabled | bool | `false` | |
102 | | startupProbe.httpGet.path | string | `"/"` | |
103 | | startupProbe.httpGet.port | string | `"http"` | |
104 | | tolerations | list | `[]` | |
105 |
106 |
--------------------------------------------------------------------------------
/charts/directus/templates/NOTES.txt:
--------------------------------------------------------------------------------
1 | 1. Get the application URL by running these commands:
2 | {{- if .Values.ingress.enabled }}
3 | {{- range $host := .Values.ingress.hosts }}
4 | {{- range .paths }}
5 | http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6 | {{- end }}
7 | {{- end }}
8 | {{- else if contains "NodePort" .Values.service.type }}
9 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "directus.fullname" . }})
10 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11 | echo http://$NODE_IP:$NODE_PORT
12 | {{- else if contains "LoadBalancer" .Values.service.type }}
13 | NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "directus.fullname" . }}'
15 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "directus.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16 | echo http://$SERVICE_IP:{{ .Values.service.port }}
17 | {{- else if contains "ClusterIP" .Values.service.type }}
18 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "directus.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19 | export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20 | echo "Visit http://127.0.0.1:8080 to use your application"
21 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22 | {{- end }}
23 |
--------------------------------------------------------------------------------
/charts/directus/templates/_helpers.tpl:
--------------------------------------------------------------------------------
1 | {{/*
2 | Expand the name of the chart.
3 | */}}
4 | {{- define "directus.name" -}}
5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6 | {{- end }}
7 |
8 | {{/*
9 | Create a default fully qualified app name.
10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11 | If release name contains chart name it will be used as a full name.
12 | */}}
13 | {{- define "directus.fullname" -}}
14 | {{- if .Values.fullnameOverride }}
15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16 | {{- else }}
17 | {{- $name := default .Chart.Name .Values.nameOverride }}
18 | {{- if contains $name .Release.Name }}
19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }}
20 | {{- else }}
21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22 | {{- end }}
23 | {{- end }}
24 | {{- end }}
25 |
26 | {{/*
27 | Create chart name and version as used by the chart label.
28 | */}}
29 | {{- define "directus.chart" -}}
30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31 | {{- end }}
32 |
33 | {{/*
34 | Common labels
35 | */}}
36 | {{- define "directus.labels" -}}
37 | helm.sh/chart: {{ include "directus.chart" . }}
38 | {{ include "directus.selectorLabels" . }}
39 | {{- if .Chart.AppVersion }}
40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41 | {{- end }}
42 | app.kubernetes.io/managed-by: {{ .Release.Service }}
43 | {{- end }}
44 |
45 | {{/*
46 | Selector labels
47 | */}}
48 | {{- define "directus.selectorLabels" -}}
49 | app.kubernetes.io/name: {{ include "directus.name" . }}
50 | app.kubernetes.io/instance: {{ .Release.Name }}
51 | {{- end }}
52 |
53 | {{/*
54 | Create the name of the service account to use
55 | */}}
56 | {{- define "directus.serviceAccountName" -}}
57 | {{- if .Values.serviceAccount.create }}
58 | {{- default (include "directus.fullname" .) .Values.serviceAccount.name }}
59 | {{- else }}
60 | {{- default "default" .Values.serviceAccount.name }}
61 | {{- end }}
62 | {{- end }}
63 |
64 | {{/*
65 | Renders a value that contains template perhaps with scope if the scope is present.
66 | Usage:
67 | {{ include "directus.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
68 | {{ include "directus.render" ( dict "value" .Values.path.to.the.Value "context" $ "scope" $app ) }}
69 | */}}
70 | {{- define "directus.render" -}}
71 | {{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
72 | {{- if contains "{{" (toJson .value) }}
73 | {{- if .scope }}
74 | {{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
75 | {{- else }}
76 | {{- tpl $value .context }}
77 | {{- end }}
78 | {{- else }}
79 | {{- $value }}
80 | {{- end }}
81 | {{- end -}}
82 |
--------------------------------------------------------------------------------
/charts/directus/templates/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: {{ include "directus.fullname" . }}-configmap
5 | labels:
6 | app.kubernetes.io/name: {{ include "directus.name" . }}
7 | app.kubernetes.io/instance: {{ .Release.Name }}
8 | app.kubernetes.io/managed-by: {{ .Release.Service }}
9 | helm.sh/chart: {{ include "directus.chart" . }}
10 | data:
11 | DB_CLIENT: {{ .Values.databaseEngine }}
12 | DB_HOST: {{- if eq .Values.databaseEngine "mysql" }} {{- if .Values.mysql.mysqlURL }} "{{ .Values.mysql.mysqlURL }}" {{- else }} "{{ .Release.Name }}-mysql.{{ .Release.Namespace }}.svc.cluster.local" {{- end }} {{- else if eq .Values.databaseEngine "postgresql" }} {{- if .Values.postgresql.postgresqlURL }} "{{ .Values.postgresql.postgresqlURL }}" {{- else }} "{{ .Release.Name }}-postgresql.{{ .Release.Namespace }}.svc.cluster.local" {{- end }} {{- end }}
13 | DB_PORT: {{ if eq .Values.databaseEngine "mysql" }}{{ default "3306" .Values.mysql.mysqlPort | quote }}{{ else if eq .Values.databaseEngine "postgresql" }}{{ default "5432" .Values.postgresql.postgresqlPort | quote }}{{ end }}
14 | DB_DATABASE: {{- if eq .Values.databaseEngine "mysql" }} {{ .Values.mysql.auth.database }} {{- else if eq .Values.databaseEngine "postgresql" }} {{ .Values.postgresql.auth.database }} {{- else }} "" {{- end }}
15 | DB_USER: {{- if eq .Values.databaseEngine "mysql" }} {{ .Values.mysql.auth.username }} {{- else if eq .Values.databaseEngine "postgresql" }} {{ .Values.postgresql.auth.username }} {{- else }} "" {{- end }}
16 | ADMIN_EMAIL: "{{ .Values.adminEmail }}"
17 | REDIS_ENABLED: {{- if .Values.redis.enabled }} "true" {{- else }} "false" {{- end }}
18 | {{- if .Values.redis.enabled}}
19 | REDIS_HOST: {{ .Release.Name }}-redis-master
20 | REDIS_PORT: "6379"
21 | REDIS_USERNAME: "default"
22 | {{- end}}
23 |
--------------------------------------------------------------------------------
/charts/directus/templates/deployment.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: apps/v1
2 | kind: Deployment
3 | metadata:
4 | name: {{ include "directus.fullname" . }}
5 | labels:
6 | {{- include "directus.labels" . | nindent 4 }}
7 | spec:
8 | {{- if not .Values.autoscaling.enabled }}
9 | replicas: {{ .Values.replicaCount }}
10 | {{- end }}
11 | selector:
12 | matchLabels:
13 | {{- include "directus.selectorLabels" . | nindent 6 }}
14 | template:
15 | metadata:
16 | {{- with .Values.podAnnotations }}
17 | annotations:
18 | {{- toYaml . | nindent 8 }}
19 | {{- end }}
20 | labels:
21 | {{- include "directus.selectorLabels" . | nindent 8 }}
22 | spec:
23 | {{- with .Values.imagePullSecrets }}
24 | imagePullSecrets:
25 | {{- toYaml . | nindent 8 }}
26 | {{- end }}
27 | serviceAccountName: {{ include "directus.serviceAccountName" . }}
28 | securityContext:
29 | {{- toYaml .Values.podSecurityContext | nindent 8 }}
30 | {{- if .Values.initContainers }}
31 | initContainers:
32 | {{- include "directus.render" ( dict "value" .Values.initContainers "context" $ ) | nindent 8 }}
33 | {{- end }}
34 | containers:
35 | - name: {{ .Chart.Name }}
36 | securityContext:
37 | {{- toYaml .Values.securityContext | nindent 12 }}
38 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
39 | imagePullPolicy: {{ .Values.image.pullPolicy }}
40 | envFrom:
41 | {{- range $val := .Values.attachExistingSecrets }}
42 | - secretRef:
43 | name: {{ $val }}
44 | {{- end }}
45 | - configMapRef:
46 | name: {{ include "directus.fullname" . }}-configmap
47 | env:
48 | {{- if eq .Values.databaseEngine "mysql" }}
49 | - name: DB_PASSWORD
50 | valueFrom:
51 | secretKeyRef:
52 | name: {{ .Values.mysql.auth.existingSecret }}
53 | key: mysql-password
54 | {{- else if eq .Values.databaseEngine "postgresql" }}
55 | - name: DB_PASSWORD
56 | valueFrom:
57 | secretKeyRef:
58 | name: {{ .Values.postgresql.auth.existingSecret }}
59 | key: password
60 | {{- end }}
61 | - name: ADMIN_PASSWORD
62 | valueFrom:
63 | secretKeyRef:
64 | name: {{ .Values.applicationSecretName }}
65 | key: ADMIN_PASSWORD
66 | - name: SECRET
67 | valueFrom:
68 | secretKeyRef:
69 | name: {{ .Values.applicationSecretName }}
70 | key: SECRET
71 | - name: KEY
72 | valueFrom:
73 | secretKeyRef:
74 | name: {{ .Values.applicationSecretName }}
75 | key: KEY
76 | {{- if .Values.ingress.enabled }}
77 | - name: PUBLIC_URL
78 | value: http{{ if .Values.ingress.enableTLS }}s{{ end }}://{{(index .Values.ingress.hosts 0).host }}
79 | {{- end }}
80 | {{- if .Values.redis.enabled}}
81 | - name: REDIS_PASSWORD
82 | valueFrom:
83 | secretKeyRef:
84 | name: {{- if .Values.redis.auth.existingSecret}} {{ .Values.redis.auth.existingSecret }} {{- else }} {{ .Release.Name }}-redis {{- end }}
85 | key: {{- if .Values.redis.auth.existingSecretPasswordKey }} {{ .Values.redis.auth.existingSecretPasswordKey }} {{- else }} redis-password {{- end }}
86 | {{- end }}
87 | {{- if .Values.extraEnvVars }}
88 | {{- tpl (toYaml .Values.extraEnvVars) $ | nindent 12 }}
89 | {{- end }}
90 | ports:
91 | - name: http
92 | containerPort: 8055
93 | protocol: TCP
94 | {{- if .Values.livenessProbe.enabled }}
95 | livenessProbe:
96 | {{- toYaml (omit .Values.livenessProbe "enabled") | nindent 12 }}
97 | {{- end }}
98 | {{- if .Values.readinessProbe.enabled }}
99 | readinessProbe:
100 | {{- toYaml (omit .Values.readinessProbe "enabled") | nindent 12 }}
101 | {{- end }}
102 | {{- if .Values.startupProbe.enabled }}
103 | startupProbe:
104 | {{- toYaml (omit .Values.startupProbe "enabled") | nindent 12 }}
105 | {{- end }}
106 | resources:
107 | {{- toYaml .Values.resources | nindent 12 }}
108 | volumeMounts:
109 | {{- toYaml .Values.extraVolumeMounts | nindent 12 }}
110 | {{- if .Values.sidecars }}
111 | {{- include "directus.render" ( dict "value" .Values.sidecars "context" $ ) | nindent 8 }}
112 | {{- end }}
113 | {{- if .Values.sidecar.enabled }}
114 | - name: {{ .Chart.Name }}-sidecar
115 | image: "{{ .Values.sidecar.repository }}:{{ .Values.sidecar.tag }}"
116 | imagePullPolicy: {{ .Values.sidecar.pullPolicy }}
117 | {{- with .Values.sidecar.command }}
118 | command:
119 | {{- toYaml . | nindent 12 }}
120 | {{- end }}
121 | securityContext:
122 | {{- toYaml .Values.sidecar.securityContext | nindent 12 }}
123 | {{- end }}
124 | {{- with .Values.nodeSelector }}
125 | nodeSelector:
126 | {{- toYaml . | nindent 8 }}
127 | {{- end }}
128 | {{- with .Values.affinity }}
129 | affinity:
130 | {{- toYaml . | nindent 8 }}
131 | {{- end }}
132 | {{- with .Values.tolerations }}
133 | tolerations:
134 | {{- toYaml . | nindent 8 }}
135 | {{- end }}
136 | {{- with .Values.extraVolumes }}
137 | volumes:
138 | {{- toYaml . | nindent 8 }}
139 | {{- end }}
140 |
--------------------------------------------------------------------------------
/charts/directus/templates/hpa.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.autoscaling.enabled }}
2 | apiVersion: autoscaling/v2
3 | kind: HorizontalPodAutoscaler
4 | metadata:
5 | name: {{ include "directus.fullname" . }}
6 | labels:
7 | {{- include "directus.labels" . | nindent 4 }}
8 | spec:
9 | scaleTargetRef:
10 | apiVersion: apps/v1
11 | kind: Deployment
12 | name: {{ include "directus.fullname" . }}
13 | minReplicas: {{ .Values.autoscaling.minReplicas }}
14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15 | metrics:
16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17 | - type: Resource
18 | resource:
19 | name: cpu
20 | targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
21 | {{- end }}
22 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
23 | - type: Resource
24 | resource:
25 | name: memory
26 | targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
27 | {{- end }}
28 | {{- end }}
29 |
--------------------------------------------------------------------------------
/charts/directus/templates/ingress.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.ingress.enabled -}}
2 | {{- $fullName := include "directus.fullname" . -}}
3 | {{- $svcPort := .Values.service.port -}}
4 | {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5 | {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
6 | {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
7 | {{- end }}
8 | {{- end }}
9 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10 | apiVersion: networking.k8s.io/v1
11 | {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12 | apiVersion: networking.k8s.io/v1beta1
13 | {{- else -}}
14 | apiVersion: extensions/v1beta1
15 | {{- end }}
16 | kind: Ingress
17 | metadata:
18 | name: {{ $fullName }}
19 | labels:
20 | {{- include "directus.labels" . | nindent 4 }}
21 | {{- with .Values.ingress.annotations }}
22 | annotations:
23 | {{- toYaml . | nindent 4 }}
24 | {{- end }}
25 | spec:
26 | {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27 | ingressClassName: {{ .Values.ingress.className }}
28 | {{- end }}
29 | {{- if .Values.ingress.tls }}
30 | tls:
31 | {{- range .Values.ingress.tls }}
32 | - hosts:
33 | {{- range .hosts }}
34 | - {{ . | quote }}
35 | {{- end }}
36 | secretName: {{ .secretName }}
37 | {{- end }}
38 | {{- end }}
39 | rules:
40 | {{- range .Values.ingress.hosts }}
41 | - host: {{ .host | quote }}
42 | http:
43 | paths:
44 | {{- range .paths }}
45 | - path: {{ .path }}
46 | {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47 | pathType: {{ .pathType }}
48 | {{- end }}
49 | backend:
50 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
51 | service:
52 | name: {{ $fullName }}
53 | port:
54 | number: {{ $svcPort }}
55 | {{- else }}
56 | serviceName: {{ $fullName }}
57 | servicePort: {{ $svcPort }}
58 | {{- end }}
59 | {{- end }}
60 | {{- end }}
61 | {{- end }}
62 |
--------------------------------------------------------------------------------
/charts/directus/templates/secrets-application.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.createApplicationSecret}}
2 | apiVersion: v1
3 | kind: Secret
4 | metadata:
5 | name: {{ .Values.applicationSecretName }}
6 | labels:
7 | app.kubernetes.io/name: {{ include "directus.name" . }}
8 | app.kubernetes.io/instance: {{ .Release.Name }}
9 | app.kubernetes.io/managed-by: {{ .Release.Service }}
10 | helm.sh/chart: {{ include "directus.chart" . }}
11 | annotations:
12 | helm.sh/resource-policy: keep
13 | helm.sh/hook: "pre-install"
14 | helm.sh/hook-delete-policy: "before-hook-creation"
15 | type: Opaque
16 | data:
17 | ADMIN_PASSWORD: {{ randAlphaNum 10 | b64enc | quote }}
18 | SECRET: {{ randAlphaNum 10 | b64enc | quote }}
19 | KEY: {{ randAlphaNum 10 | b64enc | quote }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/charts/directus/templates/secrets-mysql.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.createMysqlSecret}}
2 | apiVersion: v1
3 | kind: Secret
4 | metadata:
5 | name: {{ .Values.mysql.auth.existingSecret }}
6 | labels:
7 | app.kubernetes.io/name: {{ include "directus.name" . }}
8 | app.kubernetes.io/instance: {{ .Release.Name }}
9 | app.kubernetes.io/managed-by: {{ .Release.Service }}
10 | helm.sh/chart: {{ include "directus.chart" . }}
11 | annotations:
12 | helm.sh/resource-policy: keep
13 | helm.sh/hook: "pre-install"
14 | helm.sh/hook-delete-policy: "before-hook-creation"
15 | type: Opaque
16 | data:
17 | mysql-root-password: {{ randAlphaNum 10 | b64enc | quote }}
18 | mysql-replication-password: {{ randAlphaNum 10 | b64enc | quote }}
19 | mysql-password: {{ randAlphaNum 10 | b64enc | quote }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/charts/directus/templates/secrets-postgresql.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.createPostgresqlSecret}}
2 | apiVersion: v1
3 | kind: Secret
4 | metadata:
5 | name: {{ .Values.postgresql.auth.existingSecret }}
6 | labels:
7 | app.kubernetes.io/name: {{ include "directus.name" . }}
8 | app.kubernetes.io/instance: {{ .Release.Name }}
9 | app.kubernetes.io/managed-by: {{ .Release.Service }}
10 | helm.sh/chart: {{ include "directus.chart" . }}
11 | annotations:
12 | helm.sh/resource-policy: keep
13 | helm.sh/hook: "pre-install"
14 | helm.sh/hook-delete-policy: "before-hook-creation"
15 | type: Opaque
16 | data:
17 | postgres-password: {{ randAlphaNum 10 | b64enc | quote }}
18 | password: {{ randAlphaNum 10 | b64enc | quote }}
19 | replication-password: {{ randAlphaNum 10 | b64enc | quote }}
20 | {{- end }}
21 |
--------------------------------------------------------------------------------
/charts/directus/templates/service.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Service
3 | metadata:
4 | name: {{ include "directus.fullname" . }}
5 | labels:
6 | {{- include "directus.labels" . | nindent 4 }}
7 | spec:
8 | type: {{ .Values.service.type }}
9 | ports:
10 | - port: {{ .Values.service.port }}
11 | targetPort: 8055
12 | protocol: TCP
13 | name: http
14 | selector:
15 | {{- include "directus.selectorLabels" . | nindent 4 }}
16 |
--------------------------------------------------------------------------------
/charts/directus/templates/serviceaccount.yaml:
--------------------------------------------------------------------------------
1 | {{- if .Values.serviceAccount.create -}}
2 | apiVersion: v1
3 | kind: ServiceAccount
4 | metadata:
5 | name: {{ include "directus.serviceAccountName" . }}
6 | labels:
7 | {{- include "directus.labels" . | nindent 4 }}
8 | {{- with .Values.serviceAccount.annotations }}
9 | annotations:
10 | {{- toYaml . | nindent 4 }}
11 | {{- end }}
12 | {{- end }}
13 |
--------------------------------------------------------------------------------
/charts/directus/templates/tests/test-connection.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: Pod
3 | metadata:
4 | name: "{{ include "directus.fullname" . }}-test-connection"
5 | labels:
6 | {{- include "directus.labels" . | nindent 4 }}
7 | annotations:
8 | "helm.sh/hook": test
9 | spec:
10 | containers:
11 | - name: wget
12 | image: busybox
13 | command: ['wget']
14 | args: ['{{ include "directus.fullname" . }}:{{ .Values.service.port }}']
15 | restartPolicy: Never
16 |
--------------------------------------------------------------------------------
/charts/directus/values.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | # Default values for directus.
3 | # This is a YAML-formatted file.
4 |
5 | replicaCount: 1
6 |
7 | image:
8 | # -- Directus image docker repository
9 | repository: directus/directus
10 | # -- Pull policy for docker image
11 | pullPolicy: IfNotPresent
12 | # -- Overrides the image tag whose default is the chart appVersion.
13 | tag: ""
14 |
15 | # -- Image Pull Secrets in k8s for docker image
16 | imagePullSecrets: []
17 | # -- Helm name override in Chart.yaml. This name is being used for resource naming
18 | nameOverride: ""
19 | # -- Completely overrides Chart name
20 | fullnameOverride: ""
21 |
22 | # -- Init Containers for Directus pod
23 | initContainers: []
24 | # - name: myinitcontainer
25 | # image: alpine:latest
26 | # restartPolicy: Always
27 | # command:
28 | # - sh
29 | # - -c
30 | # - cat /opt/file.txt
31 | # volumeMounts:
32 | # - name: opt
33 | # mountPath: /opt
34 |
35 | # -- Sidecars for Directus pod
36 | sidecars: []
37 | # - name: busybox
38 | # image: busybox:latest
39 | # imagePullPolicy: Always
40 | # command:
41 | # - /bin/sh
42 | # - -c
43 | # - sleep 3600;
44 |
45 | sidecar:
46 | # IMPORTANT! This feature is going to be DEPRECATED in the next release in favour of `sidecars`
47 | # -- Sidecars for Directus pod
48 | enabled: false
49 | repository: busybox
50 | tag: latest
51 | pullPolicy: Always
52 | # -- Command to run in sidecar docker image
53 | command:
54 | - /bin/sh
55 | - -c
56 | - sleep 3600;
57 | securityContext: {}
58 | # allowPrivilegeEscalation: true
59 |
60 | adminEmail: "directus-admin@example.com"
61 |
62 | serviceAccount:
63 | # -- Specifies whether a service account should be created
64 | create: true
65 | # -- Annotations to add to the service account
66 | annotations: {}
67 | # -- The name of the service account to use. If not set and create is true, a name is generated using the fullname template
68 | name: ""
69 |
70 | podAnnotations: {}
71 |
72 | podSecurityContext: {}
73 | # fsGroup: 2000
74 |
75 | securityContext: {}
76 | # capabilities:
77 | # drop:
78 | # - ALL
79 | # readOnlyRootFilesystem: true
80 | # runAsNonRoot: true
81 | # runAsUser: 1000
82 |
83 | service:
84 | type: ClusterIP
85 | port: 80
86 |
87 | ingress:
88 | enabled: false
89 | # -- Enable TLS in PUBLIC_URL
90 | enableTLS: true
91 | className: ""
92 | # -- Ingress annotations. Usually used in cloud environments
93 | annotations: {}
94 | # kubernetes.io/ingress.class: nginx
95 | # kubernetes.io/tls-acme: "true"
96 | hosts:
97 | # -- Hostname to expose. You should create CNAME DNS record with this hostname to redirect to ALB DNS name
98 | - host: chart-example.local
99 | paths:
100 | - path: /
101 | pathType: Prefix
102 | tls: []
103 | # - secretName: chart-example-tls
104 | # hosts:
105 | # - chart-example.local
106 |
107 | extraEnvVars: []
108 |
109 | attachExistingSecrets: []
110 | # - existingSecretInKubernetes
111 |
112 | resources: {}
113 | # We usually recommend not to specify default resources and to leave this as a conscious
114 | # choice for the user. This also increases chances charts run on environments with little
115 | # resources, such as Minikube. If you do want to specify resources, uncomment the following
116 | # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
117 | # limits:
118 | # cpu: 100m
119 | # memory: 128Mi
120 | # requests:
121 | # cpu: 100m
122 | # memory: 128Mi
123 |
124 | autoscaling:
125 | enabled: false
126 | minReplicas: 1
127 | maxReplicas: 100
128 | targetCPUUtilizationPercentage: 80
129 | # targetMemoryUtilizationPercentage: 80
130 |
131 | livenessProbe:
132 | enabled: true
133 | httpGet:
134 | path: /
135 | port: http
136 | readinessProbe:
137 | enabled: true
138 | httpGet:
139 | path: /
140 | port: http
141 | startupProbe:
142 | enabled: false
143 | httpGet:
144 | path: /
145 | port: http
146 |
147 |
148 | nodeSelector: {}
149 |
150 | tolerations: []
151 |
152 | affinity: {}
153 |
154 | extraVolumes: []
155 |
156 | extraVolumeMounts: []
157 |
158 | # -- This setting enables the creation of `ADMIN_PASSWORD`, `KEY`, and `SECRET` variables in k8s secrets
159 | # If it is set to false, you MUST set these variables manually via existing secret resource and set its name below
160 | createApplicationSecret: true
161 |
162 | applicationSecretName: "directus-application-secret"
163 |
164 | # -- Database engine. Could be set to one value from the following list: mysql, postgresql
165 | # Please disable installations for other database engines in this chart
166 | # Please not if you use mariadb server, set databaseEngine to 'mysql' value
167 | # Details are here - https://docs.directus.io/self-hosted/config-options.html#database
168 | databaseEngine: "mysql"
169 |
170 | # -- Create PostgreSQL secret in Directus chart
171 | # If set to enable, postgresql secret with values of `postgres-password`, `password`, and `replication-password` variables will be created
172 | # Please consult the official bitnami postgres values file - https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml#L164
173 | # If set to false, you MUST create a secret resource in k8s for postgresql installation and set the correct value to the `existingSecret` in the postgresql settings setion
174 | createPostgresqlSecret: false
175 |
176 | # -- Create MySQL secret in Directus chart
177 | # If set to enable, mysql secret with values of `mysql-root-password`, `mysql-replication-password` and `mysql-password` variables will be created
178 | # Please consult the official bitnami mysql values file - https://github.com/bitnami/charts/blob/main/bitnami/mysql/values.yaml#L152
179 | # If set to false, you MUST create a secret resource in k8s for mysql installation and set the correct value to the `existingSecret` in the mysql settings section
180 | createMysqlSecret: true
181 |
182 | mysql:
183 | # -- The switch to switch off the installation of the mysql
184 | # The rest of the settings are being used during the installation and for DB connection
185 | # Link to the values.yaml file in bitnami repo - https://github.com/bitnami/charts/blob/main/bitnami/mysql/values.yaml
186 | enableInstallation: true
187 | auth:
188 | existingSecret: "directus-mysql-secret"
189 | database: "directus_mysql"
190 | username: "directus_mysql"
191 | # If you want to use your own mysql or mariadb insance, please provide the URL to the existing instance in `mysqlURL`
192 | # Otherwise leave it empty to use mysql that being installed in the cluster with this chart
193 | # Please note mysql.auth.database will be used as a name of the database
194 | # and mysql.auth.username will be used as username during the connection
195 | mysqlURL: ""
196 | mysqlPort: ""
197 |
198 | postgresql:
199 | # -- The switch to switch off the installation of the postgresql
200 | # The rest of the settings are being used during the installation and for DB connection
201 | # Link to the values.yaml file in bitnami repo - https://github.com/bitnami/charts/blob/main/bitnami/postgresql/values.yaml
202 | enableInstallation: false
203 | auth:
204 | existingSecret: "directus-postgresql-secret"
205 | database: "directus_postgres"
206 | username: "directus_postgres"
207 | # If you want to use your own postgresql, please provide the URL to the existing instance in `postgresqlURL`
208 | # Otherwise leave it empty to use postgresql server that being installed in the cluster with this chart
209 | # Please note postgresql.auth.database will be used as a name of the database
210 | # and postgresql.auth.username will be used as username during the connection
211 | postgresqlURL: ""
212 | postgresqlPort: ""
213 |
214 | redis:
215 | # -- Switch to enable Redis
216 | enabled: true
217 | auth:
218 | # -- Existing secret name with Redis password
219 | existingSecret: ""
220 | # -- The key in the secret with password
221 | existingSecretPasswordKey: ""
222 | replica:
223 | # -- Amount of Redis replicas
224 | replicaCount: 0
225 |
--------------------------------------------------------------------------------