diff --git a/applications/mlflow/charts/postgres-support/Chart.yaml b/applications/mlflow/charts/postgres-support/Chart.yaml new file mode 100644 index 00000000..105f3b2c --- /dev/null +++ b/applications/mlflow/charts/postgres-support/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +name: postgres-support +description: Support bundle specs for CloudnativePG PostgreSQL +type: application +version: 0.1.0 diff --git a/applications/mlflow/charts/postgres-support/templates/_supportbundle.tpl b/applications/mlflow/charts/postgres-support/templates/_supportbundle.tpl new file mode 100644 index 00000000..48b7dfb2 --- /dev/null +++ b/applications/mlflow/charts/postgres-support/templates/_supportbundle.tpl @@ -0,0 +1,70 @@ +{{- define "postgres-support.supportbundle" -}} +apiVersion: troubleshoot.sh/v1beta2 +kind: SupportBundle +metadata: + name: postgres-supportbundle +spec: + collectors: + - logs: + name: cnpg-operator-logs + namespace: {{ .Release.Namespace }} + selector: + - app.kubernetes.io/name=cloudnative-pg + limits: + maxAge: 720h + maxLines: 10000 + - logs: + name: postgres-cluster-logs + namespace: {{ .Release.Namespace }} + selector: + - cnpg.io/cluster + limits: + maxAge: 720h + maxLines: 10000 + - exec: + name: cnpg-cluster-status + namespace: {{ .Release.Namespace }} + selector: + - cnpg.io/cluster + command: ["pg_isready"] + args: ["-U", "postgres"] + timeout: 10s + - clusterResources: + name: cnpg-clusters + - clusterResources: + name: postgres-pvcs + analyzers: + - textAnalyze: + checkName: CloudnativePG Operator Running + fileName: cnpg-operator-logs/*.log + regex: "Starting manager" + outcomes: + - pass: + when: "true" + message: CloudnativePG operator is running + - fail: + when: "false" + message: CloudnativePG operator may not be running — check operator pod logs + - textAnalyze: + checkName: PostgreSQL Cluster Healthy + fileName: postgres-cluster-logs/*.log + regex: "database system is ready to accept connections" + outcomes: + - pass: + when: "true" + message: PostgreSQL cluster is accepting connections + - fail: + when: "false" + message: PostgreSQL cluster may not be healthy — check cluster pod logs + - textAnalyze: + checkName: PostgreSQL Ready Check + fileName: cnpg-cluster-status/*/pg_isready-*.txt + regex: "accepting connections" + outcomes: + - pass: + when: "true" + message: PostgreSQL is accepting connections + - fail: + when: "false" + message: PostgreSQL is not accepting connections +{{- end -}} diff --git a/applications/mlflow/charts/postgres-support/templates/secret-supportbundle.yaml b/applications/mlflow/charts/postgres-support/templates/secret-supportbundle.yaml new file mode 100644 index 00000000..e01972f4 --- /dev/null +++ b/applications/mlflow/charts/postgres-support/templates/secret-supportbundle.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: postgres-supportbundle + labels: + troubleshoot.sh/kind: support-bundle +type: Opaque +stringData: + support-bundle-spec: | +{{ include "postgres-support.supportbundle" . | indent 4 }} diff --git a/applications/mlflow/release/postgres-support-chart.yaml b/applications/mlflow/release/postgres-support-chart.yaml new file mode 100644 index 00000000..bad100a4 --- /dev/null +++ b/applications/mlflow/release/postgres-support-chart.yaml @@ -0,0 +1,12 @@ +apiVersion: kots.io/v1beta2 +kind: HelmChart +metadata: + name: postgres-support +spec: + chart: + name: postgres-support + chartVersion: 0.1.0 + exclude: 'repl{{ ConfigOptionEquals `postgres_type` `external_postgres` }}' + weight: -5 + values: {} + builder: {}