Skip to content

Commit

Permalink
[core] Add Annotations and Labels to VirtualService (#609)
Browse files Browse the repository at this point in the history
It is now possible to add custom annotations and labels to a
VirtualService in the Helm chart.
  • Loading branch information
ricoberger authored Feb 1, 2024
1 parent 886bb38 commit 23567f3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/helm/kobs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: kobs
description: Kubernetes Observability Platform
type: application
version: 0.2.0
version: 0.3.0
appVersion: v0.12.0
7 changes: 7 additions & 0 deletions deploy/helm/kobs/templates/cluster/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ metadata:
labels:
{{- include "kobs.labels" . | nindent 4 }}
app.kubernetes.io/component: cluster
{{- with .Values.cluster.istio.virtualService.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.cluster.virtualService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.cluster.istio.virtualService.hosts }}
hosts:
Expand Down
11 changes: 11 additions & 0 deletions deploy/helm/kobs/templates/hub/virtualservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ metadata:
labels:
{{- include "kobs.labels" . | nindent 4 }}
app.kubernetes.io/component: hub
{{- with .Values.hub.istio.virtualService.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.hub.virtualService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.hub.istio.virtualService.hosts }}
hosts:
Expand All @@ -29,6 +36,10 @@ spec:
port:
number: 15220
timeout: {{ .Values.hub.istio.virtualService.timeout }}
{{- with .Values.hub.istio.virtualService.headers }}
headers:
{{- toYaml . | nindent 8 }}
{{- end }}
- route:
- destination:
host: {{ include "kobs.fullname" . }}-hub.{{ .Release.Namespace }}.svc.cluster.local
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/kobs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ hub:
virtualService:
enabled: false

annotations: {}
labels: {}

gateways: []
# - gateway

Expand Down Expand Up @@ -771,6 +774,9 @@ cluster:
virtualService:
enabled: false

annotations: {}
labels: {}

gateways: []
# - gateway

Expand Down
4 changes: 4 additions & 0 deletions docs/getting-started/installation/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ helm upgrade --install kobs kobs/kobs
| `hub.ingress.hosts` | Hosts to use for the ingress. | `[]` |
| `hub.ingress.tls` | TLS configuration for the ingress. | `[]` |
| `hub.istio.virtualService.enabled` | Specifies whether a VirtualService should be created. | `false` |
| `hub.istio.virtualService.annotations` | Annotations to add to the VirtualService. | `{}` |
| `hub.istio.virtualService.labels` | Labels to add to the VirtualService. | `{}` |
| `hub.istio.virtualService.gateways` | A list of gateways for the VirtualService. | `[]` |
| `hub.istio.virtualService.hosts` | A list of hosts for the VirtualService. | `[]` |
| `hub.istio.virtualService.timeout` | Timeout for API requests. | `300s` |
Expand Down Expand Up @@ -141,6 +143,8 @@ helm upgrade --install kobs kobs/kobs
| `cluster.ingress.hosts` | Hosts to use for the ingress. | `[]` |
| `cluster.ingress.tls` | TLS configuration for the ingress. | `[]` |
| `cluster.istio.virtualService.enabled` | Specifies whether a VirtualService should be created. | `false` |
| `cluster.istio.virtualService.annotations` | Annotations to add to the VirtualService. | `{}` |
| `cluster.istio.virtualService.labels` | Labels to add to the VirtualService. | `{}` |
| `cluster.istio.virtualService.gateways` | A list of gateways for the VirtualService. | `[]` |
| `cluster.istio.virtualService.hosts` | A list of hosts for the VirtualService. | `[]` |
| `cluster.istio.virtualService.timeout` | Timeout for API requests. | `300s` |
Expand Down

0 comments on commit 23567f3

Please sign in to comment.