diff --git a/directus/Pluralfile b/directus/Pluralfile new file mode 100644 index 000000000..60ddf2678 --- /dev/null +++ b/directus/Pluralfile @@ -0,0 +1,7 @@ +REPO directus +ATTRIBUTES Plural repository.yaml + +TF terraform/* +HELM helm/* +RECIPE plural/recipes/* +TAG plural/tags/**/* diff --git a/directus/helm/directus/.helmignore b/directus/helm/directus/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/directus/helm/directus/.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/directus/helm/directus/Chart.lock b/directus/helm/directus/Chart.lock new file mode 100644 index 000000000..e4083b614 --- /dev/null +++ b/directus/helm/directus/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: postgres + repository: https://pluralsh.github.io/module-library + version: 0.1.16 +digest: sha256:5f04a1841874c3d989726de1b37e36f64403eb56fd509307296abe18f2ffaaf8 +generated: "2023-04-13T19:33:27.264488+02:00" diff --git a/directus/helm/directus/Chart.yaml b/directus/helm/directus/Chart.yaml new file mode 100644 index 000000000..8dfa2c36e --- /dev/null +++ b/directus/helm/directus/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v2 +name: directus +description: helm chart for directus +type: application +version: 0.1.0 +appVersion: 9.25.0 +dependencies: + - name: postgres + version: 0.1.16 + repository: https://pluralsh.github.io/module-library + condition: postgres.enabled \ No newline at end of file diff --git a/directus/helm/directus/README.md b/directus/helm/directus/README.md new file mode 100644 index 000000000..38ecb4aea --- /dev/null +++ b/directus/helm/directus/README.md @@ -0,0 +1 @@ +A helm chart for directus \ No newline at end of file diff --git a/directus/helm/directus/charts/postgres-0.1.16.tgz b/directus/helm/directus/charts/postgres-0.1.16.tgz new file mode 100644 index 000000000..f115c448e Binary files /dev/null and b/directus/helm/directus/charts/postgres-0.1.16.tgz differ diff --git a/directus/helm/directus/deps.yaml b/directus/helm/directus/deps.yaml new file mode 100644 index 000000000..78eb6f234 --- /dev/null +++ b/directus/helm/directus/deps.yaml @@ -0,0 +1,30 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + application: true + description: Deploys directus crafted for the target cloud +spec: + dependencies: + - type: helm + name: bootstrap + repo: bootstrap + version: '>= 0.5.1' + - type: helm + name: ingress-nginx + repo: ingress-nginx + version: ">= 0.1.2" + - type: terraform + name: aws + repo: directus + version: '>= 0.1.0' + optional: true + - type: terraform + name: azure + repo: directus + version: '>= 0.1.0' + optional: true + - type: terraform + name: gcp + repo: directus + version: '>= 0.1.0' + optional: true \ No newline at end of file diff --git a/directus/helm/directus/templates/_helpers.tpl b/directus/helm/directus/templates/_helpers.tpl new file mode 100644 index 000000000..d53c8b208 --- /dev/null +++ b/directus/helm/directus/templates/_helpers.tpl @@ -0,0 +1,66 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "directus-plural.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 "directus-plural.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 "directus-plural.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "directus-plural.labels" -}} +helm.sh/chart: {{ include "directus-plural.chart" . }} +{{ include "directus-plural.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "directus-plural.selectorLabels" -}} +app.kubernetes.io/name: {{ include "directus-plural.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "directus-plural.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "directus-plural.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{- define "directus-plural.secretName" -}} +{{- printf "%s-secret" (include "directus-plural.fullname" .) }} +{{- end }} diff --git a/directus/helm/directus/templates/deployment.yaml b/directus/helm/directus/templates/deployment.yaml new file mode 100644 index 000000000..64b5fef66 --- /dev/null +++ b/directus/helm/directus/templates/deployment.yaml @@ -0,0 +1,81 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "directus-plural.fullname" . }} + labels: + {{- include "directus-plural.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "directus-plural.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "directus-plural.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "directus-plural.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 }} + env: + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + - name: DB_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: directus.plural-postgres-directus.credentials.postgresql.acid.zalan.do + key: dsn + - name: KEY + valueFrom: + secretKeyRef: + name: {{ include "directus-plural.secretName" . }} + key: key + - name: SECRET + valueFrom: + secretKeyRef: + name: {{ include "directus-plural.secretName" . }} + key: secret + ports: + - name: http + containerPort: 8055 + 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/directus/helm/directus/templates/hpa.yaml b/directus/helm/directus/templates/hpa.yaml new file mode 100644 index 000000000..7e14ebc55 --- /dev/null +++ b/directus/helm/directus/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "directus-plural.fullname" . }} + labels: + {{- include "directus-plural.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "directus-plural.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/directus/helm/directus/templates/ingress.yaml b/directus/helm/directus/templates/ingress.yaml new file mode 100644 index 000000000..695a56ced --- /dev/null +++ b/directus/helm/directus/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "directus-plural.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 "directus-plural.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/directus/helm/directus/templates/postgres-secrets.yaml b/directus/helm/directus/templates/postgres-secrets.yaml new file mode 100644 index 000000000..b0ff3169b --- /dev/null +++ b/directus/helm/directus/templates/postgres-secrets.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: directus.plural-postgres-directus.credentials.postgresql.acid.zalan.do + labels: +{{ include "directus-plural.labels" . | indent 4 }} +stringData: + username: directus + password: {{ .Values.postgres.password }} + dsn: {{ .Values.postgres.dsn }} diff --git a/directus/helm/directus/templates/secret.yaml b/directus/helm/directus/templates/secret.yaml new file mode 100644 index 000000000..216dd7bff --- /dev/null +++ b/directus/helm/directus/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "directus-plural.secretName" . }} + labels: +{{ include "directus-plural.labels" . | indent 4 }} +stringData: + key: {{ .Values.directus.key }} + secret: {{ .Values.directus.secret }} diff --git a/directus/helm/directus/templates/service.yaml b/directus/helm/directus/templates/service.yaml new file mode 100644 index 000000000..244542690 --- /dev/null +++ b/directus/helm/directus/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "directus-plural.fullname" . }} + labels: + {{- include "directus-plural.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 8055 + protocol: TCP + name: http + selector: + {{- include "directus-plural.selectorLabels" . | nindent 4 }} diff --git a/directus/helm/directus/templates/serviceaccount.yaml b/directus/helm/directus/templates/serviceaccount.yaml new file mode 100644 index 000000000..258064658 --- /dev/null +++ b/directus/helm/directus/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "directus-plural.serviceAccountName" . }} + labels: + {{- include "directus-plural.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/directus/helm/directus/templates/tests/test-connection.yaml b/directus/helm/directus/templates/tests/test-connection.yaml new file mode 100644 index 000000000..a5a99848b --- /dev/null +++ b/directus/helm/directus/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "directus-plural.fullname" . }}-test-connection" + labels: + {{- include "directus-plural.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "directus-plural.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/directus/helm/directus/values.yaml b/directus/helm/directus/values.yaml new file mode 100644 index 000000000..2a36b3898 --- /dev/null +++ b/directus/helm/directus/values.yaml @@ -0,0 +1,94 @@ +# Default values for directus. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +postgres: + team: plural + user: directus + dbName: directus + ownerChart: directus + infix: '-postgres' + password: REPLACE_ME + +replicaCount: 1 + +image: + repository: dkr.plural.sh/directus/directus/directus + 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: {} + +env: + DB_CLIENT: pg + NODE_TLS_REJECT_UNAUTHORIZED: 0 \ No newline at end of file diff --git a/directus/helm/directus/values.yaml.tpl b/directus/helm/directus/values.yaml.tpl new file mode 100644 index 000000000..438eb5874 --- /dev/null +++ b/directus/helm/directus/values.yaml.tpl @@ -0,0 +1,40 @@ +{{ $hostname := default "example.com" .Values.hostname }} + +{{ $key := dedupe . "directus.env.key" (uuidv4) }} +{{ $secret := dedupe . "directus.env.secret" (uuidv4) }} + +{{ $directusPgPwd := dedupe . "directus.postgres.password" (randAlphaNum 20) }} +{{ $directusPgDsn := default (printf "postgresql://directus:%s@plural-postgres-directus:5432/directus" $directusPgPwd) .Values.directusDsn }} + +global: + application: + links: + - description: directus web ui + url: {{ $hostname }} + +postgres: + password: {{ $directusPgPwd }} + dsn: {{ $directusPgDsn }} + +env: + PUBLIC_URL: https://{{ $hostname }} + +directus: + key: {{ $key }} + secret: {{ $secret }} + +ingress: + enabled: true + className: "nginx" + annotations: + kubernetes.io/tls-acme: "true" + cert-manager.io/cluster-issuer: letsencrypt-prod + hosts: + - host: {{ $hostname }} + paths: + - path: '/' + pathType: ImplementationSpecific + tls: + - secretName: directus-tls + hosts: + - {{ $hostname }} \ No newline at end of file diff --git a/directus/plural/icons/directus-logo-stacked.png b/directus/plural/icons/directus-logo-stacked.png new file mode 100644 index 000000000..8feaa5a14 Binary files /dev/null and b/directus/plural/icons/directus-logo-stacked.png differ diff --git a/directus/plural/notes.tpl b/directus/plural/notes.tpl new file mode 100644 index 000000000..295561ccd --- /dev/null +++ b/directus/plural/notes.tpl @@ -0,0 +1 @@ +Your directus installation is available at https://{{ .Values.hostname }} diff --git a/directus/plural/recipes/directus-aws.yaml b/directus/plural/recipes/directus-aws.yaml new file mode 100644 index 000000000..00821f365 --- /dev/null +++ b/directus/plural/recipes/directus-aws.yaml @@ -0,0 +1,19 @@ +name: directus-aws +description: Installs directus on an aws eks cluster +provider: AWS +dependencies: +- repo: bootstrap + name: aws-k8s +- repo: ingress-nginx + name: ingress-nginx-aws +sections: +- name: directus + configuration: + - name: hostname + documentation: FQDN to use for your directus installation + type: DOMAIN + items: + - type: TERRAFORM + name: aws + - type: HELM + name: directus diff --git a/directus/plural/recipes/directus-azure.yaml b/directus/plural/recipes/directus-azure.yaml new file mode 100644 index 000000000..663fb6845 --- /dev/null +++ b/directus/plural/recipes/directus-azure.yaml @@ -0,0 +1,19 @@ +name: directus-azure +description: Installs directus on an azure aks cluster +provider: AZURE +dependencies: +- repo: bootstrap + name: azure-k8s +- repo: ingress-nginx + name: ingress-nginx-azure +sections: +- name: directus + configuration: + - name: hostname + documentation: FQDN to use for your directus installation + type: DOMAIN + items: + - type: TERRAFORM + name: azure + - type: HELM + name: directus diff --git a/directus/plural/recipes/directus-gcp.yaml b/directus/plural/recipes/directus-gcp.yaml new file mode 100644 index 000000000..959a63c58 --- /dev/null +++ b/directus/plural/recipes/directus-gcp.yaml @@ -0,0 +1,19 @@ +name: directus-gcp +description: Installs directus on an gcp gke cluster +provider: GCP +dependencies: +- repo: bootstrap + name: gcp-k8s +- repo: ingress-nginx + name: ingress-nginx-gcp +sections: +- name: directus + configuration: + - name: hostname + documentation: FQDN to use for your directus installation + type: DOMAIN + items: + - type: TERRAFORM + name: gcp + - type: HELM + name: directus diff --git a/directus/repository.yaml b/directus/repository.yaml new file mode 100644 index 000000000..7497f0d3f --- /dev/null +++ b/directus/repository.yaml @@ -0,0 +1,9 @@ +name: directus +description: directus deployed on plural +category: DATA +private: true +releaseStatus: ALPHA +icon: plural/icons/directus-logo-stacked.png +notes: plural/notes.tpl +contributors: +- walkoss@pm.me \ No newline at end of file diff --git a/directus/terraform/aws/deps.yaml b/directus/terraform/aws/deps.yaml new file mode 100644 index 000000000..9ea1f2dd7 --- /dev/null +++ b/directus/terraform/aws/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: directus aws setup + version: 0.1.0 +spec: + dependencies: + - name: aws-bootstrap + repo: bootstrap + type: terraform + version: '>= 0.1.1' + providers: + - aws \ No newline at end of file diff --git a/directus/terraform/aws/main.tf b/directus/terraform/aws/main.tf new file mode 100644 index 000000000..6bbff89fc --- /dev/null +++ b/directus/terraform/aws/main.tf @@ -0,0 +1,30 @@ +resource "kubernetes_namespace" "directus" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "directus" + "platform.plural.sh/sync-target" = "pg" + } + } +} + + +data "aws_iam_role" "postgres" { + name = "${var.cluster_name}-postgres" +} + +resource "kubernetes_service_account" "postgres" { + metadata { + name = "postgres-pod" + namespace = var.namespace + + annotations = { + "eks.amazonaws.com/role-arn" = data.aws_iam_role.postgres.arn + } + } + + depends_on = [ + kubernetes_namespace.directus + ] +} diff --git a/directus/terraform/aws/terraform.tfvars b/directus/terraform/aws/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/directus/terraform/aws/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/directus/terraform/aws/variables.tf b/directus/terraform/aws/variables.tf new file mode 100644 index 000000000..f3c38ac23 --- /dev/null +++ b/directus/terraform/aws/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "directus" +} + +variable "cluster_name" { + type = string +} diff --git a/directus/terraform/azure/deps.yaml b/directus/terraform/azure/deps.yaml new file mode 100644 index 000000000..b85bf8a40 --- /dev/null +++ b/directus/terraform/azure/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: directus azure setup + version: 0.1.0 +spec: + dependencies: + - name: azure-bootstrap + repo: bootstrap + type: terraform + version: '>= 0.1.1' + providers: + - azure \ No newline at end of file diff --git a/directus/terraform/azure/main.tf b/directus/terraform/azure/main.tf new file mode 100644 index 000000000..111851048 --- /dev/null +++ b/directus/terraform/azure/main.tf @@ -0,0 +1,11 @@ +resource "kubernetes_namespace" "directus" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "directus" + "platform.plural.sh/sync-target" = "pg" + } + } +} + diff --git a/directus/terraform/azure/terraform.tfvars b/directus/terraform/azure/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/directus/terraform/azure/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/directus/terraform/azure/variables.tf b/directus/terraform/azure/variables.tf new file mode 100644 index 000000000..f3c38ac23 --- /dev/null +++ b/directus/terraform/azure/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "directus" +} + +variable "cluster_name" { + type = string +} diff --git a/directus/terraform/gcp/deps.yaml b/directus/terraform/gcp/deps.yaml new file mode 100644 index 000000000..4efd56746 --- /dev/null +++ b/directus/terraform/gcp/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: directus gcp setup + version: 0.1.0 +spec: + dependencies: + - name: gcp-bootstrap + repo: bootstrap + type: terraform + version: '>= 0.1.1' + providers: + - gcp \ No newline at end of file diff --git a/directus/terraform/gcp/main.tf b/directus/terraform/gcp/main.tf new file mode 100644 index 000000000..111851048 --- /dev/null +++ b/directus/terraform/gcp/main.tf @@ -0,0 +1,11 @@ +resource "kubernetes_namespace" "directus" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "directus" + "platform.plural.sh/sync-target" = "pg" + } + } +} + diff --git a/directus/terraform/gcp/terraform.tfvars b/directus/terraform/gcp/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/directus/terraform/gcp/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/directus/terraform/gcp/variables.tf b/directus/terraform/gcp/variables.tf new file mode 100644 index 000000000..f3c38ac23 --- /dev/null +++ b/directus/terraform/gcp/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "directus" +} + +variable "cluster_name" { + type = string +} diff --git a/directus/vendor_images.yaml b/directus/vendor_images.yaml new file mode 100644 index 000000000..e5e2f9c36 --- /dev/null +++ b/directus/vendor_images.yaml @@ -0,0 +1,4 @@ +docker.io: + images: + directus/directus: + - "9.25.0"