Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions chart/templates/pgbouncer/pgbouncer-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## Airflow Pgbouncer Ingress
#################################
{{- if and .Values.pgbouncer.enabled .Values.ingress.pgbouncer.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "airflow.fullname" . }}-pgbouncer-ingress
labels:
tier: airflow
component: pgbouncer-ingress
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.pgbouncer.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.pgbouncer.hosts (.Values.ingress.pgbouncer.hosts | first | kindIs "string" | not) }}
{{- $anyTlsHosts := false -}}
{{- range .Values.ingress.pgbouncer.hosts }}
{{- if .tls }}
{{- if .tls.enabled }}
{{- $anyTlsHosts = true -}}
{{- end }}
{{- end }}
{{- end }}
{{- if $anyTlsHosts }}
tls:
{{- range .Values.ingress.pgbouncer.hosts }}
{{- if .tls }}
{{- if .tls.enabled }}
- hosts:
- {{ .name | quote }}
secretName: {{ .tls.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.pgbouncer.hosts | default (list .Values.ingress.pgbouncer.host) }}
- http:
paths:
- backend:
service:
name: {{ $.Release.Name }}-pgbouncer
port:
name: pgb-metrics
{{- if $.Values.ingress.pgbouncer.path }}
path: {{ $.Values.ingress.pgbouncer.path }}
pathType: {{ $.Values.ingress.pgbouncer.pathType }}
{{- end }}
{{- $hostname := . -}}
{{- if . | kindIs "string" | not }}
{{- $hostname = .name -}}
{{- end }}
{{- if $hostname }}
host: {{ tpl $hostname $ | quote }}
{{- end }}
{{- end }}
{{- if .Values.ingress.pgbouncer.ingressClassName }}
ingressClassName: {{ .Values.ingress.pgbouncer.ingressClassName }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion chart/templates/pgbouncer/pgbouncer-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
- name: pgbouncer
protocol: TCP
port: {{ .Values.ports.pgbouncer }}
- name: pgbouncer-metrics
- name: pgb-metrics
protocol: TCP
port: {{ .Values.ports.pgbouncerScrape }}
{{- end }}
87 changes: 87 additions & 0 deletions chart/templates/statsd/statsd-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/}}

################################
## Airflow Statsd Ingress
#################################
{{- if and .Values.statsd.enabled .Values.ingress.statsd.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "airflow.fullname" . }}-statsd-ingress
labels:
tier: airflow
component: statsd-ingress
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.statsd.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.statsd.hosts (.Values.ingress.statsd.hosts | first | kindIs "string" | not) }}
{{- $anyTlsHosts := false -}}
{{- range .Values.ingress.statsd.hosts }}
{{- if .tls }}
{{- if .tls.enabled }}
{{- $anyTlsHosts = true -}}
{{- end }}
{{- end }}
{{- end }}
{{- if $anyTlsHosts }}
tls:
{{- range .Values.ingress.statsd.hosts }}
{{- if .tls }}
{{- if .tls.enabled }}
- hosts:
- {{ .name | quote }}
secretName: {{ .tls.secretName }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.statsd.hosts | default (list .Values.ingress.statsd.host) }}
- http:
paths:
- backend:
service:
name: {{ $.Release.Name }}-statsd
port:
name: statsd-scrape
{{- if $.Values.ingress.statsd.path }}
path: {{ $.Values.ingress.statsd.path }}
pathType: {{ $.Values.ingress.statsd.pathType }}
{{- end }}
{{- $hostname := . -}}
{{- if . | kindIs "string" | not }}
{{- $hostname = .name -}}
{{- end }}
{{- if $hostname }}
host: {{ tpl $hostname $ | quote }}
{{- end }}
{{- end }}
{{- if .Values.ingress.statsd.ingressClassName }}
ingressClassName: {{ .Values.ingress.statsd.ingressClassName }}
{{- end }}
{{- end }}
170 changes: 170 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,176 @@
}
}
}
},
"statsd": {
"description": "Configuration for the Ingress of the statsd Service.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable statsd ingress resource.",
"type": "boolean",
"default": false
},
"annotations": {
"description": "Annotations for the statsd Ingress.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"path": {
"description": "The path for the statsd Ingress.",
"type": "string",
"default": "/metrics"
},
"pathType": {
"description": "The pathType for the statsd Ingress (required for Kubernetes 1.19 and above).",
"type": "string",
"default": "ImplementationSpecific"
},
"host": {
"description": "The hostname for the statsd Ingress. (Deprecated - renamed to `ingress.statsd.hosts`)",
"type": "string",
"default": ""
},
"hosts": {
"description": "The hostnames or hosts configuration for the statsd Ingress.",
"type": "array",
"default": [],
"items": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "The hostname for the web Ingress.",
"type": "string",
"default": ""
},
"tls": {
"description": "Configuration for web Ingress TLS.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable TLS termination for the web Ingress.",
"type": "boolean",
"default": false
},
"secretName": {
"description": "The name of a pre-created Secret containing a TLS private key and certificate.",
"type": "string",
"default": ""
}
}
}
},
"required": [
"name"
]
},
{
"type": "string",
"default": "",
"$comment": "Deprecated by object above"
}
]
}
},
"ingressClassName": {
"description": "The Ingress Class for the statsd Ingress.",
"type": "string",
"default": ""
}
}
},
"pgbouncer": {
"description": "Configuration for the Ingress of the PgBouncer Service.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable PgBouncer ingress resource.",
"type": "boolean",
"default": false
},
"annotations": {
"description": "Annotations for the PgBouncer Ingress.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"path": {
"description": "The path for the PgBouncer Ingress.",
"type": "string",
"default": "/metrics"
},
"pathType": {
"description": "The pathType for the PgBouncer Ingress (required for Kubernetes 1.19 and above).",
"type": "string",
"default": "ImplementationSpecific"
},
"host": {
"description": "The hostname for the PgBouncer Ingress. (Deprecated - renamed to `ingress.pgbouncer.hosts`)",
"type": "string",
"default": ""
},
"hosts": {
"description": "The hostnames or hosts configuration for the PgBouncer Ingress.",
"type": "array",
"default": [],
"items": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "The hostname for the web Ingress.",
"type": "string",
"default": ""
},
"tls": {
"description": "Configuration for web Ingress TLS.",
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"description": "Enable TLS termination for the web Ingress.",
"type": "boolean",
"default": false
},
"secretName": {
"description": "The name of a pre-created Secret containing a TLS private key and certificate.",
"type": "string",
"default": ""
}
}
}
},
"required": [
"name"
]
},
{
"type": "string",
"default": "",
"$comment": "Deprecated by object above"
}
]
}
},
"ingressClassName": {
"description": "The Ingress Class for the PgBouncer Ingress.",
"type": "string",
"default": ""
}
}
}
}
},
Expand Down
Loading