Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metabase update #1073

Closed
wants to merge 11 commits into from
6 changes: 5 additions & 1 deletion .github/workflows/sync-remote-helm-charts.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Sync remote charts in PR"
name: 'Sync remote charts in PR'
on:
push:
branches:
Expand All @@ -9,6 +9,10 @@ jobs:
strategy:
matrix:
charts:
- remote_owner: bitnami
remote_repository: charts
remote_directory: bitnami/postgresql
target_directory: addons/postgresql-managed
- remote_owner: aws
remote_repository: eks-charts
remote_directory: stable/aws-cloudwatch-metrics
Expand Down
1 change: 1 addition & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ local_resource(
helm cm-push addons/rds-postgresql local && \
helm cm-push addons/rds-postgresql-aurora local && \
helm cm-push addons/wallarm-ingress local && \
helm cm-push addons/postgresql-managed local && \
helm repo update local
''',
deps=[
Expand Down
29 changes: 2 additions & 27 deletions addons/metabase/form.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@ tabs:
- name: main
label: Main Settings
sections:
- name: network
contents:
- type: heading
label: Network Settings
- type: subtitle
label: For containers that you do not want to expose to external traffic (e.g. databases and add-on's), you may make them accessible only to other internal services running within the same cluster.
- type: checkbox
variable: ingress.enabled
label: Expose to external traffic
settings:
default: true
- name: domain_toggle
show_if: ingress.enabled
contents:
- type: subtitle
label: Assign custom domain to your deployment. You must first create an A/CNAME record in your domain provider that points to your cluster load balancer's IP address for this.
Expand All @@ -30,19 +18,6 @@ tabs:
- type: array-input
variable: ingress.hosts
label: Domain Name
- name: ingress_tls_enabled
show_if: ingress.custom_domain
contents:
- type: checkbox
variable: ingress.tls
label: Enable TLS and automatically create certificates
settings:
default: true
- name: do_wildcard
show_if:
and:
- ingress.custom_domain
- currentCluster.service.is_do
- name: resources
label: Computing resources
sections:
Expand All @@ -57,13 +32,13 @@ tabs:
variable: resources.requests.memory
settings:
unit: Mi
default: 2048
default: 512
- type: number-input
label: CPU
variable: resources.requests.cpu
settings:
unit: m
default: 100
default: 500
- name: env
label: Environment
sections:
Expand Down
4 changes: 2 additions & 2 deletions addons/metabase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ container:

resources:
requests:
cpu: 1000m
memory: 2048Mi
cpu: 500m
memory: 512Mi
21 changes: 21 additions & 0 deletions addons/postgresql-managed/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
6 changes: 6 additions & 0 deletions addons/postgresql-managed/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.13.3
digest: sha256:9a971689db0c66ea95ac2e911c05014c2b96c6077c991131ff84f2982f88fb83
generated: "2023-11-03T20:45:06.276989379Z"
38 changes: 38 additions & 0 deletions addons/postgresql-managed/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

annotations:
category: Database
licenses: Apache-2.0
images: |
- name: os-shell
image: docker.io/bitnami/os-shell:11-debian-11-r91
- name: postgres-exporter
image: docker.io/bitnami/postgres-exporter:0.15.0-debian-11-r2
- name: postgresql
image: docker.io/bitnami/postgresql:16.1.0-debian-11-r15
apiVersion: v2
appVersion: 16.1.0
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
tags:
- bitnami-common
version: 2.x.x
description: PostgreSQL (Postgres) is an open source object-relational database known for reliability and data integrity. ACID-compliant, it supports foreign keys, joins, views, triggers and stored procedures.
home: https://bitnami.com
icon: https://bitnami.com/assets/stacks/postgresql/img/postgresql-stack-220x234.png
keywords:
- postgresql
- postgres
- database
- sql
- replication
- cluster
maintainers:
- name: VMware, Inc.
url: https://github.com/bitnami/charts
name: postgresql-managed
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/postgresql
version: 13.2.23
755 changes: 755 additions & 0 deletions addons/postgresql-managed/README.md

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions addons/postgresql-managed/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
CHART NAME: {{ .Chart.Name }}
CHART VERSION: {{ .Chart.Version }}
APP VERSION: {{ .Chart.AppVersion }}

** Please be patient while the chart is being deployed **

{{- if .Values.diagnosticMode.enabled }}
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:

command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}

Get the list of pods by executing:

kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }}

Access the pod you want to debug by executing

kubectl exec --namespace {{ .Release.Namespace }} -ti <NAME OF THE POD> -- /opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash

In order to replicate the container startup scripts execute this command:

/opt/bitnami/scripts/postgresql/entrypoint.sh /opt/bitnami/scripts/postgresql/run.sh

{{- else }}

{{- $customUser := include "postgresql.v1.username" . }}
{{- $postgresPassword := include "common.secrets.lookup" (dict "secret" (include "common.names.fullname" .) "key" .Values.auth.secretKeys.adminPasswordKey "defaultValue" (ternary .Values.auth.postgresPassword .Values.auth.password (eq $customUser "postgres")) "context" $) -}}
{{- $authEnabled := and (not (or .Values.global.postgresql.auth.existingSecret .Values.auth.existingSecret)) (or $postgresPassword .Values.auth.enablePostgresUser (and (not (empty $customUser)) (ne $customUser "postgres"))) }}
{{- if not $authEnabled }}

WARNING: PostgreSQL has been configured without authentication, this is not recommended for production environments.
{{- end }}

PostgreSQL can be accessed via port {{ include "postgresql.v1.service.port" . }} on the following DNS names from within your cluster:

{{ include "postgresql.v1.primary.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read/Write connection

{{- if eq .Values.architecture "replication" }}

{{ include "postgresql.v1.readReplica.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - Read only connection

{{- end }}

{{- if and (not (empty $customUser)) (ne $customUser "postgres") }}
{{- if .Values.auth.enablePostgresUser }}

To get the password for "postgres" run:

export POSTGRES_ADMIN_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{include "postgresql.v1.adminPasswordKey" .}}}" | base64 -d)
{{- end }}

To get the password for "{{ $customUser }}" run:

export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{include "postgresql.v1.userPasswordKey" .}}}" | base64 -d)
{{- else }}
{{- if .Values.auth.enablePostgresUser }}

To get the password for "{{ default "postgres" $customUser }}" run:

export POSTGRES_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "postgresql.v1.secretName" . }} -o jsonpath="{.data.{{ ternary "password" (include "postgresql.v1.adminPasswordKey" .) (and (not (empty $customUser)) (ne $customUser "postgres")) }}}" | base64 -d)
{{- end }}
{{- end }}

To connect to your database run the following command:
{{- if $authEnabled }}

kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ include "postgresql.v1.image" . }} --env="PGPASSWORD=$POSTGRES_PASSWORD" \
--command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
{{- else }}

kubectl run {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} --image {{ include "postgresql.v1.image" . }} \
--command -- psql --host {{ include "postgresql.v1.primary.fullname" . }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
{{- end }}

> NOTE: If you access the container using bash, make sure that you execute "/opt/bitnami/scripts/postgresql/entrypoint.sh /bin/bash" in order to avoid the error "psql: local user with ID {{ .Values.primary.containerSecurityContext.runAsUser }}} does not exist"

To connect to your database from outside the cluster execute the following commands:

{{- if contains "NodePort" .Values.primary.service.type }}

export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "postgresql.v1.primary.fullname" . }})
{{- if $authEnabled }}
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $NODE_IP --port $NODE_PORT -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
{{- else }}
psql --host $NODE_IP --port $NODE_PORT -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
{{- end }}
{{- else if contains "LoadBalancer" .Values.primary.service.type }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "postgresql.v1.primary.fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "postgresql.v1.primary.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
{{- if $authEnabled }}
PGPASSWORD="$POSTGRES_PASSWORD" psql --host $SERVICE_IP --port {{ include "postgresql.v1.service.port" . }} -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
{{- else }}
psql --host $SERVICE_IP --port {{ include "postgresql.v1.service.port" . }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }}
{{- end }}
{{- else if contains "ClusterIP" .Values.primary.service.type }}

kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "postgresql.v1.primary.fullname" . }} {{ include "postgresql.v1.service.port" . }}:{{ include "postgresql.v1.service.port" . }} &
{{- if $authEnabled }}
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U {{ default "postgres" $customUser }} -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
{{- else }}
psql --host 127.0.0.1 -d {{- if include "postgresql.v1.database" . }} {{ include "postgresql.v1.database" . }}{{- else }} postgres{{- end }} -p {{ include "postgresql.v1.service.port" . }}
{{- end }}
{{- end }}
{{- end }}

WARNING: The configured password will be ignored on new installation in case when previous PostgreSQL release was deleted through the helm command. In that case, old PVC will have an old password, and setting it through helm won't take effect. Deleting persistent volumes (PVs) will solve the issue.

{{- include "postgresql.v1.validateValues" . -}}
{{- include "common.warnings.rollingTag" .Values.image -}}
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
Loading
Loading