-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
- Loading branch information
Showing
8 changed files
with
304 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
{{- $configName := default (include "pomerium.fullname" .) .Values.config.existingConfig }} | ||
{{- $secretName := default (include "pomerium.fullname" .) .Values.config.existingSecret }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ template "pomerium.cache.name" . }} | ||
helm.sh/chart: {{ template "pomerium.chart" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/component: cache | ||
name: {{ template "pomerium.cache.fullname" . }} | ||
annotations: | ||
{{- if .Values.cache.deployment.annotations }} | ||
{{- range $key, $value := .Values.cache.deployment.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- else if .Values.annotations }} | ||
{{- range $key, $value := .Values.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
replicas: {{ default .Values.replicaCount .Values.cache.replicaCount }} | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ template "pomerium.cache.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
annotations: | ||
{{- /* policy is already covered by hot-reloading */}} | ||
checksum/config: {{ print .Values.config.extraOpts | sha256sum }} | ||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} | ||
{{- if .Values.podAnnotations }} | ||
{{ toYaml .Values.podAnnotations | indent 8 }} | ||
{{- end }} | ||
labels: | ||
app.kubernetes.io/name: {{ template "pomerium.cache.name" . }} | ||
helm.sh/chart: {{ template "pomerium.chart" . }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- if .Values.podLabels }} | ||
{{ toYaml .Values.podLabels | indent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.priorityClassName }} | ||
priorityClassName: {{ .Values.priorityClassName }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
args: | ||
{{- if or .Values.config.existingConfig .Values.config.policy }} | ||
- --config=/etc/pomerium/config.yaml | ||
{{- end }} | ||
{{- range $key, $value := .Values.extraArgs }} | ||
{{- if $value }} | ||
- --{{ $key }}={{ $value }} | ||
{{- else }} | ||
- --{{ $key }} | ||
{{- end }} | ||
{{- end }} | ||
env: | ||
- name: SERVICES | ||
value: cache | ||
- name: SHARED_SECRET | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ $secretName }} | ||
key: shared-secret | ||
{{- /* TODO in future: Remove legacy logic */ -}} | ||
{{- if .Values.config.existingLegacyTLSSecret }} | ||
- name: CERTIFICATE | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "pomerium.cache.tlsSecret.name" . }} | ||
key: {{ template "pomerium.cache.tlsSecret.certName" . }} | ||
- name: CERTIFICATE_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "pomerium.cache.tlsSecret.name" . }} | ||
key: {{ template "pomerium.cache.tlsSecret.keyName" . }} | ||
- name: CERTIFICATE_AUTHORITY | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "pomerium.caSecret.name" . }} | ||
key: {{ template "pomerium.caSecret.certName" . }} | ||
{{- else }} | ||
- name: CERTIFICATE_FILE | ||
value: "/pomerium/cert.pem" | ||
- name: CERTIFICATE_KEY_FILE | ||
value: "/pomerium/privkey.pem" | ||
- name: CERTIFICATE_AUTHORITY_FILE | ||
value: "/pomerium/ca.pem" | ||
{{- end }} | ||
{{- range $name, $value := .Values.extraEnv }} | ||
- name: {{ $name }} | ||
value: {{ quote $value }} | ||
{{- end }} | ||
ports: | ||
- containerPort: 443 | ||
name: https | ||
protocol: TCP | ||
- containerPort: {{ .Values.metrics.port }} | ||
name: metrics | ||
protocol: TCP | ||
livenessProbe: | ||
tcpSocket: | ||
port: https | ||
initialDelaySeconds: 15 | ||
readinessProbe: | ||
tcpSocket: | ||
port: https | ||
resources: | ||
{{ toYaml .Values.resources | indent 10 }} | ||
volumeMounts: | ||
{{- if or .Values.config.existingConfig .Values.config.policy }} | ||
- mountPath: /etc/pomerium/ | ||
name: config | ||
{{- end }} | ||
{{- /* TODO in future: Remove legacy logic */ -}} | ||
{{- if not .Values.config.existingLegacyTLSSecret }} | ||
- mountPath: /pomerium/cert.pem | ||
name: service-tls | ||
subPath: {{ template "pomerium.cache.tlsSecret.certName" . }} | ||
- mountPath: /pomerium/privkey.pem | ||
name: service-tls | ||
subPath: {{ template "pomerium.cache.tlsSecret.keyName" . }} | ||
- mountPath: /pomerium/ca.pem | ||
name: ca-tls | ||
subPath: {{ template "pomerium.caSecret.certName" . }} | ||
{{- end }} | ||
volumes: | ||
{{- if or .Values.config.existingConfig .Values.config.policy }} | ||
- name: config | ||
configMap: | ||
name: {{ $configName }} | ||
{{- end }} | ||
{{- /* TODO in future: Remove legacy logic */ -}} | ||
{{- if not .Values.config.existingLegacyTLSSecret }} | ||
- name: service-tls | ||
secret: | ||
secretName: {{ template "pomerium.cache.tlsSecret.name" . }} | ||
- name: ca-tls | ||
secret: | ||
secretName: {{ template "pomerium.caSecret.name" . }} | ||
{{- end }} | ||
{{- if .Values.extraVolumes }} | ||
volumes: | ||
{{- toYaml .Values.extraVolumes | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{ toYaml .Values.imagePullSecrets | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.nodeSelector }} | ||
nodeSelector: | ||
{{ toYaml .Values.nodeSelector | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.tolerations }} | ||
tolerations: | ||
{{ toYaml .Values.tolerations | indent 8 }} | ||
{{- end }} | ||
{{- if .Values.affinity }} | ||
affinity: | ||
{{ toYaml .Values.affinity | indent 8 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "pomerium.cache.fullname" . }} | ||
labels: | ||
app.kubernetes.io/name: {{ template "pomerium.cache.name" . }} | ||
helm.sh/chart: {{ template "pomerium.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
app.kubernetes.io/component: cache | ||
{{- if .Values.service.labels }} | ||
{{ toYaml .Values.service.labels | indent 4 }} | ||
{{- end }} | ||
annotations: | ||
{{- if .Values.cache.service.annotations }} | ||
{{- range $key, $value := .Values.cache.service.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- else if .Values.service.annotations }} | ||
{{- range $key, $value := .Values.service.annotations }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
spec: | ||
{{- if .Values.service.cache.headless }} | ||
clusterIP: None | ||
type: ClusterIP | ||
{{- else }}} | ||
type: {{ .Values.service.type }} | ||
{{- end }} | ||
ports: | ||
- port: {{ .Values.service.externalPort }} | ||
targetPort: https | ||
protocol: TCP | ||
name: https | ||
- name: metrics | ||
port: {{ .Values.metrics.port }} | ||
protocol: TCP | ||
targetPort: metrics | ||
{{- if hasKey .Values.service "nodePort" }} | ||
nodePort: {{ .Values.service.nodePort }} | ||
{{- end }} | ||
selector: | ||
app.kubernetes.io/name: {{ template "pomerium.cache.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters