-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gateway component to tempo-distributed
Signed-off-by: Daria Zubairova <dariazubairova@gmail.com>
- Loading branch information
1 parent
1b00908
commit 21f7aa2
Showing
16 changed files
with
540 additions
and
7 deletions.
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
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
7 changes: 7 additions & 0 deletions
7
charts/tempo-distributed/templates/distributor/_helpers-distributor.tpl
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
2 changes: 1 addition & 1 deletion
2
charts/tempo-distributed/templates/distributor/deployment-distributor.yaml
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
2 changes: 1 addition & 1 deletion
2
charts/tempo-distributed/templates/distributor/service-distributor.yaml
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
30 changes: 30 additions & 0 deletions
30
charts/tempo-distributed/templates/gateway/_helpers-gateway.tpl
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,30 @@ | ||
{{/* | ||
gateway fullname | ||
*/}} | ||
{{- define "tempo.gatewayFullname" -}} | ||
{{ include "tempo.fullname" . }}-gateway | ||
{{- end }} | ||
|
||
{{/* | ||
gateway common labels | ||
*/}} | ||
{{- define "tempo.gatewayLabels" -}} | ||
{{ include "tempo.labels" . }} | ||
app.kubernetes.io/component: gateway | ||
{{- end }} | ||
|
||
{{/* | ||
gateway selector labels | ||
*/}} | ||
{{- define "tempo.gatewaySelectorLabels" -}} | ||
{{ include "tempo.selectorLabels" . }} | ||
app.kubernetes.io/component: gateway | ||
{{- end }} | ||
|
||
{{/* | ||
gateway image | ||
*/}} | ||
{{- define "tempo.gatewayImage" -}} | ||
{{- $dict := dict "tempo" .Values.tempo.image "service" .Values.gateway.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion -}} | ||
{{- include "tempo.tempoImage" $dict -}} | ||
{{- end }} |
11 changes: 11 additions & 0 deletions
11
charts/tempo-distributed/templates/gateway/configmap-gateway.yaml
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,11 @@ | ||
{{- if .Values.gateway.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "tempo.gatewayFullname" . }} | ||
labels: | ||
{{- include "tempo.gatewayLabels" . | nindent 4 }} | ||
data: | ||
nginx.conf: | | ||
{{- tpl .Values.gateway.nginxConfig.file . | nindent 4 }} | ||
{{- end }} |
89 changes: 89 additions & 0 deletions
89
charts/tempo-distributed/templates/gateway/deployment-gateway.yaml
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,89 @@ | ||
{{- if .Values.gateway.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "tempo.gatewayFullname" . }} | ||
labels: | ||
{{- include "tempo.gatewayLabels" . | nindent 4 }} | ||
spec: | ||
minReadySeconds: 10 | ||
replicas: {{ .Values.gateway.replicas }} | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
{{- include "tempo.gatewaySelectorLabels" . | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/config: {{ include (print .Template.BasePath "/gateway/configmap-gateway.yaml") . | sha256sum }} | ||
{{- with .Values.gateway.podAnnotations }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "tempo.gatewaySelectorLabels" . | nindent 8 }} | ||
spec: | ||
serviceAccountName: {{ include "tempo.serviceAccountName" . }} | ||
terminationGracePeriodSeconds: {{ .Values.gateway.terminationGracePeriodSeconds }} | ||
containers: | ||
- name: nginx | ||
image: {{ include "tempo.gatewayImage" . }} | ||
imagePullPolicy: {{ .Values.gateway.image.pullPolicy }} | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
{{- with .Values.gateway.extraEnv }} | ||
env: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
{{- with .Values.gateway.extraEnvFrom }} | ||
envFrom: | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
readinessProbe: | ||
{{- toYaml .Values.gateway.readinessProbe | nindent 12 }} | ||
volumeMounts: | ||
- name: config | ||
mountPath: /etc/nginx | ||
{{- if .Values.gateway.basicAuth.enabled }} | ||
- name: auth | ||
mountPath: /etc/nginx/secrets | ||
{{- end }} | ||
- name: tmp | ||
mountPath: /tmp | ||
- name: docker-entrypoint-d-override | ||
mountPath: /docker-entrypoint.d | ||
{{- if .Values.gateway.extraVolumeMounts }} | ||
{{- toYaml .Values.gateway.extraVolumeMounts | nindent 12 }} | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.gateway.resources | nindent 12 }} | ||
{{- with .Values.gateway.affinity }} | ||
affinity: | ||
{{- tpl . $ | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.gateway.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.gateway.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: {{ include "tempo.gatewayFullname" . }} | ||
{{- if .Values.gateway.basicAuth.enabled }} | ||
- name: auth | ||
secret: | ||
secretName: {{ include "tempo.gatewayAuthSecret" . }} | ||
{{- end }} | ||
- name: tmp | ||
emptyDir: {} | ||
- name: docker-entrypoint-d-override | ||
emptyDir: {} | ||
{{- if .Values.gateway.extraVolumes }} | ||
{{- toYaml .Values.gateway.extraVolumes | nindent 8 }} | ||
{{- end }} | ||
{{- end }} |
55 changes: 55 additions & 0 deletions
55
charts/tempo-distributed/templates/gateway/ingress-gateway.yaml
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,55 @@ | ||
{{- if .Values.gateway.enabled -}} | ||
{{- if .Values.gateway.ingress.enabled -}} | ||
{{- $ingressApiIsStable := eq (include "tempo.ingress.isStable" .) "true" -}} | ||
{{- $ingressSupportsIngressClassName := eq (include "tempo.ingress.supportsIngressClassName" .) "true" -}} | ||
{{- $ingressSupportsPathType := eq (include "tempo.ingress.supportsPathType" .) "true" -}} | ||
apiVersion: {{ include "tempo.ingress.apiVersion" . }} | ||
kind: Ingress | ||
metadata: | ||
name: {{ include "tempo.gatewayFullname" . }} | ||
labels: | ||
{{- include "tempo.gatewayLabels" . | nindent 4 }} | ||
{{- with .Values.gateway.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if and $ingressSupportsIngressClassName .Values.gateway.ingress.ingressClassName }} | ||
ingressClassName: {{ .Values.gateway.ingress.ingressClassName }} | ||
{{- end -}} | ||
{{- if .Values.gateway.ingress.tls }} | ||
tls: | ||
{{- range .Values.gateway.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
{{- with .secretName }} | ||
secretName: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
{{- range .Values.gateway.ingress.hosts }} | ||
- host: {{ .host | quote }} | ||
http: | ||
paths: | ||
{{- range .paths }} | ||
- path: {{ .path }} | ||
{{- if $ingressSupportsPathType }} | ||
pathType: {{ .pathType }} | ||
{{- end }} | ||
backend: | ||
{{- if $ingressApiIsStable }} | ||
service: | ||
name: {{ include "tempo.gatewayFullname" $ }} | ||
port: | ||
number: {{ $.Values.gateway.service.port }} | ||
{{- else }} | ||
serviceName: {{ include "tempo.gatewayFullname" $ }} | ||
servicePort: {{ $.Values.gateway.service.port }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
13 changes: 13 additions & 0 deletions
13
charts/tempo-distributed/templates/gateway/secret-gateway.yaml
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,13 @@ | ||
{{- with .Values.gateway }} | ||
{{- if and .enabled .basicAuth.enabled (not .basicAuth.existingSecret) }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ include "tempo.gatewayFullname" $ }} | ||
labels: | ||
{{- include "tempo.gatewayLabels" $ | nindent 4 }} | ||
stringData: | ||
.htpasswd: | | ||
{{- tpl .basicAuth.htpasswd $ | nindent 4 }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.