Skip to content

Commit 6aa5e7a

Browse files
committed
Refactored the GW annotations to include all commonAnnotations as well as service annotations. Added the ability to set service specific labels.
1 parent 4c40408 commit 6aa5e7a

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ install-dev-deps: ## Install development dependencies (PostgreSQL, Minio, monit
107107
@echo " Internal : grafana-service.${MONITORING_NAMESPACE}.svc.cluster.local:3000"
108108
@echo " Access Grafana with : $ kubectl port-forward svc/grafana-service -n ${MONITORING_NAMESPACE} 3000:3000"
109109
@echo " Credentials : admin/admin"
110+
@echo "Kafka:"
111+
@echo " Internal : kafka-local-dev.${NAMESPACE}.svc.cluster.local:9092"
110112

111113
# Extended targets
112114
##################

charts/gateway/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ This section specifies external service configuration
113113
| `service.external.type` | Type of load balancer | `ClusterIP` |
114114
| `service.external.ip` | IP to configure | `""` |
115115
| `service.external.annotations` | | `{}` |
116+
| `service.external.labels` | | `{}` |
116117
| `service.external.admin` | Enable admin exposition on external service | `false` |
117118
| `service.external.jmx` | Enable jmx exposition on external service | `false` |
118119

@@ -123,6 +124,7 @@ This section specify internal service configuration
123124
| Name | Description | Value |
124125
| ------------------------------ | ----------- | ----- |
125126
| `service.internal.annotations` | | `{}` |
127+
| `service.internal.labels` | | `{}` |
126128

127129
### Gateway ingress configurations
128130

charts/gateway/templates/service-external.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,26 @@ apiVersion: v1
33
kind: Service
44
metadata:
55
name: {{ include "conduktor-gateway.externalServiceName" . }}
6-
labels: {{ include "conduktor-gateway.labels" . | nindent 4 }}
7-
{{- with .Values.service.external.annotations }}
8-
annotations: {{ toYaml . | nindent 4 }}
6+
namespace: {{ include "common.names.namespace" . | quote }}
7+
labels: {{ include "common.labels.standard" . | nindent 4 }}
8+
app.kubernetes.io/component: conduktor-platform
9+
{{- if .Values.service.external.labels }}
10+
{{- include "common.tplvalues.render" ( dict "value" .Values.service.external.labels "context" $) | nindent 4 }}
11+
{{- end }}
12+
{{- if .Values.commonLabels }}
13+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
14+
{{- end }}
15+
{{- if .Values.metrics.prometheus.enable }}
16+
metrics.conduktor.io/prometheus: {{ .Values.metrics.prometheus.enable | quote }}
17+
{{- end }}
18+
{{- if or .Values.service.external.annotations .Values.commonAnnotations }}
19+
annotations:
20+
{{- if .Values.service.external.annotations }}
21+
{{- include "common.tplvalues.render" ( dict "value" .Values.service.external.annotations "context" $) | nindent 4 }}
22+
{{- end }}
23+
{{- if .Values.commonAnnotations }}
24+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
25+
{{- end }}
926
{{- end }}
1027
spec:
1128
type: {{ .Values.service.external.type }}

charts/gateway/templates/service-internal.yaml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,26 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: {{ include "conduktor-gateway.internalServiceName" . }}
5-
labels: {{ include "conduktor-gateway.labels" . | nindent 4 }}
5+
namespace: {{ include "common.names.namespace" . | quote }}
6+
labels: {{ include "common.labels.standard" . | nindent 4 }}
7+
app.kubernetes.io/component: conduktor-platform
8+
{{- if .Values.service.internal.labels }}
9+
{{- include "common.tplvalues.render" ( dict "value" .Values.service.internal.labels "context" $) | nindent 4 }}
10+
{{- end }}
11+
{{- if .Values.commonLabels }}
12+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
13+
{{- end }}
14+
{{- if .Values.metrics.prometheus.enable }}
615
metrics.conduktor.io/prometheus: {{ .Values.metrics.prometheus.enable | quote }}
7-
{{- with .Values.service.internal.annotations }}
8-
annotations: {{ toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- if or .Values.service.internal.annotations .Values.commonAnnotations }}
18+
annotations:
19+
{{- if .Values.service.internal.annotations }}
20+
{{- include "common.tplvalues.render" ( dict "value" .Values.service.internal.annotations "context" $) | nindent 4 }}
21+
{{- end }}
22+
{{- if .Values.commonAnnotations }}
23+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
24+
{{- end }}
925
{{- end }}
1026
spec:
1127
type: ClusterIP

charts/gateway/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ service:
202202
ip: ""
203203
## @param service.external.annotations
204204
annotations: {}
205+
## @param service.external.labels
206+
labels: {}
205207
# LoadBalancer externaldns gke support by annotation https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/gke.md#verify-using-an-external-load-balancer
206208
# external-dns.alpha.kubernetes.io/hostname: "{{ required "A valid .Values.gateway.domain is required!" .Values.gateway.domain }}"
207209
## @param service.external.admin Enable admin exposition on external service
@@ -215,6 +217,8 @@ service:
215217
internal:
216218
## @param service.internal.annotations
217219
annotations: {}
220+
## @param service.internal.labels
221+
labels: {}
218222

219223
## @section Gateway ingress configurations
220224
## @descriptionStart

0 commit comments

Comments
 (0)