diff --git a/dremio/Pluralfile b/dremio/Pluralfile new file mode 100644 index 000000000..cda5e5135 --- /dev/null +++ b/dremio/Pluralfile @@ -0,0 +1,6 @@ +REPO dremio +ATTRIBUTES Plural repository.yaml + +TF terraform/* +HELM helm/* +RECIPE plural/recipes/* diff --git a/dremio/helm/dremio/.helmignore b/dremio/helm/dremio/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/dremio/helm/dremio/.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/dremio/helm/dremio/Chart.yaml b/dremio/helm/dremio/Chart.yaml new file mode 100644 index 000000000..43cde317c --- /dev/null +++ b/dremio/helm/dremio/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +name: dremio +description: helm chart for dremio +type: application +version: 0.1.0 +appVersion: "v1.0.0" + +dependencies: +- name: postgres + version: 0.1.5 + repository: https://pluralsh.github.io/module-library +- name: dremio + version: 2.0.0 + repository: https://github.com/dremio/dremio-cloud-tools \ No newline at end of file diff --git a/dremio/helm/dremio/README.md b/dremio/helm/dremio/README.md new file mode 100644 index 000000000..bdc433920 --- /dev/null +++ b/dremio/helm/dremio/README.md @@ -0,0 +1 @@ +A helm chart for dremio \ No newline at end of file diff --git a/dremio/helm/dremio/charts/dremio-2.0.0.tgz b/dremio/helm/dremio/charts/dremio-2.0.0.tgz new file mode 100644 index 000000000..3f6453424 Binary files /dev/null and b/dremio/helm/dremio/charts/dremio-2.0.0.tgz differ diff --git a/dremio/helm/dremio/deps.yaml b/dremio/helm/dremio/deps.yaml new file mode 100644 index 000000000..679942f02 --- /dev/null +++ b/dremio/helm/dremio/deps.yaml @@ -0,0 +1,38 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + application: true + description: Deploys dremio 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: helm + name: postgres + repo: postgres + version: ">= 0.1.6" + + - type: terraform + name: aws + repo: dremio + version: '>= 0.1.0' + optional: true + - type: terraform + name: azure + repo: dremio + version: '>= 0.1.0' + optional: true + - type: terraform + name: gcp + repo: dremio + version: '>= 0.1.0' + optional: true \ No newline at end of file diff --git a/dremio/helm/dremio/templates/NOTES.txt b/dremio/helm/dremio/templates/NOTES.txt new file mode 100644 index 000000000..2d557bddc --- /dev/null +++ b/dremio/helm/dremio/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 "dremio.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "dremio.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "dremio.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 "dremio.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/dremio/helm/dremio/templates/_helpers.tpl b/dremio/helm/dremio/templates/_helpers.tpl new file mode 100644 index 000000000..74c3f464a --- /dev/null +++ b/dremio/helm/dremio/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "dremio.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 "dremio.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 "dremio.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "dremio.labels" -}} +helm.sh/chart: {{ include "dremio.chart" . }} +{{ include "dremio.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "dremio.selectorLabels" -}} +app.kubernetes.io/name: {{ include "dremio.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "dremio.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "dremio.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/dremio/helm/dremio/templates/dashboards.yaml b/dremio/helm/dremio/templates/dashboards.yaml new file mode 100644 index 000000000..1b41e6ece --- /dev/null +++ b/dremio/helm/dremio/templates/dashboards.yaml @@ -0,0 +1,56 @@ +apiVersion: platform.plural.sh/v1alpha1 +kind: Dashboard +metadata: + name: dremio-postgres +spec: + name: postgres # name of the dashboard in the console UI + description: Monitoring for hasura's postgres db # short description + timeslices: [30m, 1h, 2h, 1d] # durations options to allow display for + defaultTime: 30m + labels: # global values to slice the dashboard further + - name: instance + query: + query: pg_stat_database_tup_fetched{namespace="{{ .Release.Namespace }}"} + label: instance + graphs: + - queries: # list of grouped prometheus queries per graph + - query: SUM(pg_stat_database_tup_fetched{instance=~"$instance"}) + legend: tuples fetched + - query: SUM(pg_stat_database_tup_inserted{instance=~"$instance"}) + legend: tuples inserted + - query: SUM(pg_stat_database_tup_updated{instance=~"$instance"}) + legend: tuples updated + name: Storage Performance + - queries: + - query: pg_settings_max_connections{instance="$instance"} + legend: connections + name: Max Connections + - queries: + - query: avg(rate(process_cpu_seconds_total{instance="$instance"}[5m]) * 1000) + legend: seconds + name: CPU time + - queries: + - query: avg(rate(process_resident_memory_bytes{instance="$instance"}[5m])) + legend: resident mem + - query: avg(rate(process_virtual_memory_bytes{instance="$instance"}[5m])) + legend: process mem + format: bytes + name: Memory utilization + - queries: + - query: process_open_fds{instance="$instance"} + legend: fds + name: Open file descriptors + - queries: + - query: pg_settings_max_wal_size_bytes{instance="$instance"} + legend: WAL size + name: Max WAL size + - queries: + - query: irate(pg_stat_database_xact_commit{instance="$instance"}[5m]) + legend: commits + - query: irate(pg_stat_database_xact_rollback{instance="$instance"}[5m]) + legend: rollbacks + name: Transactions + - queries: + - query: pg_stat_database_blks_hit{instance="$instance"} / (pg_stat_database_blks_read{instance="$instance"} + pg_stat_database_blks_hit{instance="$instance"}) + legend: hit rate + name: Cache hit rate \ No newline at end of file diff --git a/dremio/helm/dremio/templates/deployment.yaml b/dremio/helm/dremio/templates/deployment.yaml new file mode 100644 index 000000000..84a7af25d --- /dev/null +++ b/dremio/helm/dremio/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "dremio.fullname" . }} + labels: + {{- include "dremio.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "dremio.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "dremio.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "dremio.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/dremio/helm/dremio/templates/hpa.yaml b/dremio/helm/dremio/templates/hpa.yaml new file mode 100644 index 000000000..e01e2b053 --- /dev/null +++ b/dremio/helm/dremio/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "dremio.fullname" . }} + labels: + {{- include "dremio.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "dremio.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/dremio/helm/dremio/templates/ingress.yaml b/dremio/helm/dremio/templates/ingress.yaml new file mode 100644 index 000000000..390f4fb1c --- /dev/null +++ b/dremio/helm/dremio/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "dremio.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 "dremio.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/dremio/helm/dremio/templates/service.yaml b/dremio/helm/dremio/templates/service.yaml new file mode 100644 index 000000000..3a009ebc0 --- /dev/null +++ b/dremio/helm/dremio/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "dremio.fullname" . }} + labels: + {{- include "dremio.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "dremio.selectorLabels" . | nindent 4 }} diff --git a/dremio/helm/dremio/templates/serviceaccount.yaml b/dremio/helm/dremio/templates/serviceaccount.yaml new file mode 100644 index 000000000..401966f4c --- /dev/null +++ b/dremio/helm/dremio/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "dremio.serviceAccountName" . }} + labels: + {{- include "dremio.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/dremio/helm/dremio/templates/tests/test-connection.yaml b/dremio/helm/dremio/templates/tests/test-connection.yaml new file mode 100644 index 000000000..6349d4934 --- /dev/null +++ b/dremio/helm/dremio/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "dremio.fullname" . }}-test-connection" + labels: + {{- include "dremio.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "dremio.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/dremio/helm/dremio/values.yaml b/dremio/helm/dremio/values.yaml new file mode 100644 index 000000000..ee4402528 --- /dev/null +++ b/dremio/helm/dremio/values.yaml @@ -0,0 +1,101 @@ +# The Dremio image used in the cluster. +# +# It is *highly* recommended to update the version tag to +# the version that you are using. This will ensure that all +# the pods are using the same version of the software. If +# you are directly consuming Dremio's images from Docker Hub, +# when specifying which version to use, it is best to use the +# full version tag in the form X.Y.Z (i.e. 21.1.0), as image +# tags in the form X.Y (i.e. 21.1) are updated with the latest +# patch version released. +# +# Using the image tag latest or in the form X.Y +# will potentially cause Dremio to upgrade versions +# automatically during redeployments and may negatively impact +# the cluster. +image: dremio/dremio-oss +imageTag: 24.2.5 + +# Annotations, labels, node selectors, and tolerations +# +# annotations: Annotations are applied to the StatefulSets that are deployed. +# podAnnotations: Pod annotations are applied to the pods that are deployed. +# labels: Labels operate much like annotations. +# podLabels: Labels that are applied to the pods that are deployed. +# nodeSelector: Target pods to nodes based on labels set on the nodes. For more +# information, see https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector +# tolerations: Tolerations allow the negation of taints that have been applied to some set of nodes +# in the Kubernetes cluster so that pods can be scheduled on those tainted nodes. +annotations: {} +podAnnotations: {} +labels: {} +podLabels: {} +nodeSelector: {} +tolerations: [] + +replicaCount: 1 + +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: "dremio" + +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 + +affinity: {} diff --git a/dremio/helm/dremio/values.yaml.tpl b/dremio/helm/dremio/values.yaml.tpl new file mode 100644 index 000000000..1bbf0745b --- /dev/null +++ b/dremio/helm/dremio/values.yaml.tpl @@ -0,0 +1,8 @@ +dremio: + ingress: + tls: + - hosts: + - { { .Values.hostname } } + secretName: dremio-tls + hosts: + - { { .Values.hostname } } \ No newline at end of file diff --git a/dremio/plural/icons/dremio.png b/dremio/plural/icons/dremio.png new file mode 100644 index 000000000..6a1fe52e4 Binary files /dev/null and b/dremio/plural/icons/dremio.png differ diff --git a/dremio/plural/notes.tpl b/dremio/plural/notes.tpl new file mode 100644 index 000000000..94d32bf2a --- /dev/null +++ b/dremio/plural/notes.tpl @@ -0,0 +1 @@ +Use `plural watch dremio` to track the status of your application \ No newline at end of file diff --git a/dremio/plural/recipes/dremio-aws.yaml b/dremio/plural/recipes/dremio-aws.yaml new file mode 100644 index 000000000..0c3036950 --- /dev/null +++ b/dremio/plural/recipes/dremio-aws.yaml @@ -0,0 +1,26 @@ +name: dremio-aws +description: Installs dremio on an aws eks cluster +provider: AWS +primary: true +dependencies: +- repo: bootstrap + name: aws-k8s + +- repo: ingress-nginx + name: ingress-nginx-aws + + +- repo: postgres + name: aws-postgres + +sections: +- name: dremio + configuration: # Users will be asked to input values for these parameters + - name: hostname + documentation: Fully Qualified Domain Name to use for your hasura installation, eg hasura.topleveldomain.com if topleveldomain.com is the domain you inputed for dns_domain above. + type: DOMAIN + items: + - type: TERRAFORM + name: aws + - type: HELM + name: dremio diff --git a/dremio/plural/recipes/dremio-azure.yaml b/dremio/plural/recipes/dremio-azure.yaml new file mode 100644 index 000000000..f943bfedb --- /dev/null +++ b/dremio/plural/recipes/dremio-azure.yaml @@ -0,0 +1,23 @@ +name: dremio-azure +description: Installs dremio on an aws eks cluster +provider: AZURE +primary: true +dependencies: +- repo: bootstrap + name: azure-k8s + +- repo: ingress-nginx + name: ingress-nginx-azure + + +- repo: postgres + name: azure-postgres + +sections: +- name: dremio + configuration: [] + items: + - type: TERRAFORM + name: azure + - type: HELM + name: dremio diff --git a/dremio/plural/recipes/dremio-gcp.yaml b/dremio/plural/recipes/dremio-gcp.yaml new file mode 100644 index 000000000..cf4a8d2aa --- /dev/null +++ b/dremio/plural/recipes/dremio-gcp.yaml @@ -0,0 +1,23 @@ +name: dremio-gcp +description: Installs dremio on an aws eks cluster +provider: GCP +primary: true +dependencies: +- repo: bootstrap + name: gcp-k8s + +- repo: ingress-nginx + name: ingress-nginx-gcp + + +- repo: postgres + name: gcp-postgres + +sections: +- name: dremio + configuration: [] + items: + - type: TERRAFORM + name: gcp + - type: HELM + name: dremio diff --git a/dremio/repository.yaml b/dremio/repository.yaml new file mode 100644 index 000000000..2698ef0b0 --- /dev/null +++ b/dremio/repository.yaml @@ -0,0 +1,8 @@ +name: dremio +description: dremio deployed on plural +category: DATA +private: true +icon: plural/icons/dremio.png +notes: plural/notes.tpl +contributors: +- jonathon@capitalaudience.com \ No newline at end of file diff --git a/dremio/terraform/aws/deps.yaml b/dremio/terraform/aws/deps.yaml new file mode 100644 index 000000000..9707130c6 --- /dev/null +++ b/dremio/terraform/aws/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: dremio 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/dremio/terraform/aws/main.tf b/dremio/terraform/aws/main.tf new file mode 100644 index 000000000..6a7021b31 --- /dev/null +++ b/dremio/terraform/aws/main.tf @@ -0,0 +1,32 @@ +resource "kubernetes_namespace" "dremio" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "dremio" + + "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.dremio + ] +} diff --git a/dremio/terraform/aws/terraform.tfvars b/dremio/terraform/aws/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/dremio/terraform/aws/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/dremio/terraform/aws/variables.tf b/dremio/terraform/aws/variables.tf new file mode 100644 index 000000000..bb8ac2aa2 --- /dev/null +++ b/dremio/terraform/aws/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "dremio" +} + +variable "cluster_name" { + type = string +} diff --git a/dremio/terraform/azure/deps.yaml b/dremio/terraform/azure/deps.yaml new file mode 100644 index 000000000..752afd554 --- /dev/null +++ b/dremio/terraform/azure/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: dremio 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/dremio/terraform/azure/main.tf b/dremio/terraform/azure/main.tf new file mode 100644 index 000000000..459c6b2cb --- /dev/null +++ b/dremio/terraform/azure/main.tf @@ -0,0 +1,13 @@ +resource "kubernetes_namespace" "dremio" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "dremio" + + "platform.plural.sh/sync-target" = "pg" + + } + } +} + diff --git a/dremio/terraform/azure/terraform.tfvars b/dremio/terraform/azure/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/dremio/terraform/azure/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/dremio/terraform/azure/variables.tf b/dremio/terraform/azure/variables.tf new file mode 100644 index 000000000..bb8ac2aa2 --- /dev/null +++ b/dremio/terraform/azure/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "dremio" +} + +variable "cluster_name" { + type = string +} diff --git a/dremio/terraform/gcp/deps.yaml b/dremio/terraform/gcp/deps.yaml new file mode 100644 index 000000000..07e253d1e --- /dev/null +++ b/dremio/terraform/gcp/deps.yaml @@ -0,0 +1,13 @@ +apiVersion: plural.sh/v1alpha1 +kind: Dependencies +metadata: + description: dremio 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/dremio/terraform/gcp/main.tf b/dremio/terraform/gcp/main.tf new file mode 100644 index 000000000..459c6b2cb --- /dev/null +++ b/dremio/terraform/gcp/main.tf @@ -0,0 +1,13 @@ +resource "kubernetes_namespace" "dremio" { + metadata { + name = var.namespace + labels = { + "app.kubernetes.io/managed-by" = "plural" + "app.plural.sh/name" = "dremio" + + "platform.plural.sh/sync-target" = "pg" + + } + } +} + diff --git a/dremio/terraform/gcp/terraform.tfvars b/dremio/terraform/gcp/terraform.tfvars new file mode 100644 index 000000000..961103ecf --- /dev/null +++ b/dremio/terraform/gcp/terraform.tfvars @@ -0,0 +1,2 @@ +namespace = {{ .Namespace | quote }} +cluster_name = {{ .Cluster | quote }} \ No newline at end of file diff --git a/dremio/terraform/gcp/variables.tf b/dremio/terraform/gcp/variables.tf new file mode 100644 index 000000000..bb8ac2aa2 --- /dev/null +++ b/dremio/terraform/gcp/variables.tf @@ -0,0 +1,8 @@ +variable "namespace" { + type = string + default = "dremio" +} + +variable "cluster_name" { + type = string +}