[powerdns] flip default to postgres, fix postgres dependent chart (#78)

This commit is contained in:
Ryan Holt 2020-11-28 16:43:54 -05:00 committed by GitHub
parent f2452edfb9
commit dde8baec08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 41 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v4.3.0
description: PowerDNS is a DNS server, written in C++ and licensed under the GPL. It runs on most Unix derivatives. PowerDNS features a large number of different backends ranging from simple BIND style zonefiles to relational databases and load balancing/failover algorithms. A DNS recursor is provided as a separate program.
name: powerdns
version: 2.2.0
version: 2.3.0
home: https://www.powerdns.com/
sources:
- http://www.github.com/PowerDNS/
@ -12,7 +12,7 @@ maintainers:
email: ryan@ryanholt.net
dependencies:
- name: postgresql
version: 9.8.12
version: 10.1.0
repository: https://charts.bitnami.com/bitnami
condition: postgres.enabled
- name: mariadb

View File

@ -35,28 +35,25 @@ spec:
- name: config
mountPath: /etc/pdns/conf.d
env:
{{- if .Values.postgres.enabled }}
{{- if .Values.postgresql.enabled }}
- name: AUTOCONF
value: postgres
- name: PGSQL_HOST
valueFrom:
secretKeyRef:
name: {{ include "powerdns.fullname" . }}
key: postgres_host
- name: PGSQL_PORT
valueFrom:
secretKeyRef:
name: {{ include "powerdns.fullname" . }}
key: postgres_port
- name: PGSQL_USERNAME
- name: PGSQL_USER
valueFrom:
secretKeyRef:
name: {{ include "powerdns.fullname" . }}
key: postgres_username
- name: PGSQL_PASSWORD
- name: PGSQL_PASS
valueFrom:
secretKeyRef:
name: {{ include "powerdns.fullname" . }}
key: postgres_password
- name: PGSQL_DATABASE
- name: PGSQL_DB
valueFrom:
secretKeyRef:
name: {{ include "powerdns.fullname" . }}
@ -65,6 +62,8 @@ spec:
value: {{if (.Values.powerdns.dnssec)}}"yes"{{else}}"no"{{ end }}
{{ end }}
{{- if .Values.mariadb.enabled }}
- name: AUTOCONF
value: mysql
- name: MYSQL_HOST
valueFrom:
secretKeyRef:
@ -95,32 +94,26 @@ spec:
- name: dns-udp
containerPort: 53
protocol: UDP
- name: dns-webserver
containerPort: 8081
protocol: TCP
{{- if .Values.probes.liveness.enabled }}
livenessProbe:
httpGet:
path: /
port: dns-webserver
tcpSocket:
port: dns-tcp
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
{{ end }}
{{- if .Values.probes.readiness.enabled }}
readinessProbe:
httpGet:
path: /
port: dns-webserver
tcpSocket:
port: dns-tcp
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
{{ end }}
{{- if .Values.probes.startup.enabled }}
startupProbe:
httpGet:
path: /
port: dns-webserver
tcpSocket:
port: dns-tcp
failureThreshold: {{ .Values.probes.startup.failureThreshold }}
periodSeconds: {{ .Values.probes.startup.periodSeconds }}
{{ end }}
@ -128,13 +121,13 @@ spec:
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "a=0;while [ $a -lt 200 ];do sleep 5;a=$[a+1];echo 'stage: '$a;if nc -vz {{ .Values.powerdns.mysql.host }} 3306;then (! pdnsutil list-zone {{ .Values.powerdns.domain }} 2>/dev/null) && pdnsutil create-zone {{ .Values.powerdns.domain }};echo 'End Stage';a=200;fi;done"]
command: ["/bin/sh", "-c", "a=0;while [ $a -lt 200 ];do sleep 5;a=$[a+1];echo 'stage: '$a;if nc -vz {{- printf "%s-%s" .Release.Name "mariadb"}} 3306;then (! pdnsutil list-zone {{ .Values.powerdns.domain }} 2>/dev/null) && pdnsutil create-zone {{ .Values.powerdns.domain }};echo 'End Stage';a=200;fi;done"]
{{ end }}
{{- if .Values.postgres.enabled }}
{{- if .Values.postgresql.enabled }}
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "a=0;while [ $a -lt 200 ];do sleep 5;a=$[a+1];echo 'stage: '$a;if nc -vz {{ .Values.powerdns.postgres.host }} 5432;then (! pdnsutil list-zone {{ .Values.powerdns.domain }} 2>/dev/null) && pdnsutil create-zone {{ .Values.powerdns.domain }};echo 'End Stage';a=200;fi;done"]
command: ["/bin/sh", "-c", "a=0;while [ $a -lt 200 ];do sleep 5;a=$[a+1];echo 'stage: '$a;if nc -vz {{- printf "%s-%s" .Release.Name "postgresql"}} 5432;then (! pdnsutil list-zone {{ .Values.powerdns.domain }} 2>/dev/null) && pdnsutil create-zone {{ .Values.powerdns.domain }};echo 'End Stage';a=200;fi;done"]
{{ end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}

View File

@ -6,13 +6,12 @@ metadata:
{{ include "powerdns.labels" . | indent 4 }}
type: Opaque
data:
{{- if .Values.postgres.enabled }}
{{- $postgrestmp := printf "%s-%s" .Release.Name "postgres"}}
{{- if .Values.postgresql.enabled }}
{{- $postgrestmp := printf "%s-%s" .Release.Name "postgresql"}}
postgres_host: "{{ $postgrestmp |b64enc }}"
postgres_port: "{{ .Values.powerdns.postgres.port | toString | b64enc }}"
postgres_username: "{{ .Values.powerdns.postgres.username | b64enc }}"
postgres_password: "{{ .Values.powerdns.postgres.password | toString | b64enc }}"
postgres_database: "{{ .Values.powerdns.postgres.database | b64enc }}"
postgres_username: "{{ .Values.postgresql.postgresqlUsername | b64enc }}"
postgres_password: "{{ .Values.postgresql.postgresqlPassword | toString | b64enc }}"
postgres_database: "{{ .Values.postgresql.postgresqlDatabase | b64enc }}"
{{ end }}
{{- if .Values.mariadb.enabled }}
{{- $mysqltmp := printf "%s-%s" .Release.Name "mariadb"}}

View File

@ -6,8 +6,8 @@ replicaCount: 1
strategyType: Recreate
image:
repository: psitrax/powerdns
tag: v4.3.0
repository: naps/powerdns
tag: 4.3.1
pullPolicy: Always
imagePullSecrets: []
@ -71,8 +71,10 @@ powerdns:
dnssec: true
config: {}
# Enabled mariadb
# ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/mariadb
mariadb:
enabled: true
enabled: false
db:
name: pdns
user: pdns
@ -84,12 +86,19 @@ mariadb:
master:
persistence:
enabled: false
postgres:
enabled: false
global:
postgresqlUsername: pdns
postgresqlPassword: pdnspass
postgresqlDatabase: pdns
# Enabled postgres
# ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/postgresql
postgresql:
enabled: true
postgresqlUsername: pdns
postgresqlPassword: pdnspass
postgresqlPostgresPassword: pdnsadminpass
postgresqlDatabase: pdns
persistence:
enabled: false
# storageClass: ""
# Probes configuration
probes: