Skip to content

Commit

Permalink
feat(viz): add option to add labels to web service (#13305)
Browse files Browse the repository at this point in the history
Problem
There is no option to add labels to the dashboard service (web) specifically
for example, the use case of service mirror the dashboard service to make it accessible in another cluster needs the label:

```
mirror.linkerd.io/exported: 'true'
```

Solution
Add option to add labels to dashboard service only 

Validation
Run helm templates with couple of use cases to verify it adds new properties while not overwrite others.

I agree to the DCO for all the commits in this PR.

Signed-off-by: Alex Leong <[email protected]>
Co-authored-by: omer nitzan <[email protected]>
Co-authored-by: Alex Leong <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent 1caf862 commit c16f08c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/linkerd2-cni/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ Kubernetes: `>=1.22.0-0`
| useWaitFlag | bool | `false` | Configures the CNI plugin to use the -w flag for the iptables command |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
3 changes: 2 additions & 1 deletion viz/charts/linkerd-viz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ Kubernetes: `>=1.22.0-0`
| dashboard.resources.memory.limit | string | `nil` | Maximum amount of memory that web container can use |
| dashboard.resources.memory.request | string | `nil` | Amount of memory that the web container requests |
| dashboard.restrictPrivileges | bool | `false` | Restrict the Linkerd Dashboard's default privileges to disallow Tap and Check |
| dashboard.service | object | `{"annotations":{}}` | dashboard service configuration |
| dashboard.service | object | `{"annotations":{},"labels":{}}` | dashboard service configuration |
| dashboard.service.annotations | object | `{}` | Additional annotations to add to dashboard service |
| dashboard.service.labels | object | `{}` | Additional labels to add to dashboard service |
| defaultGID | int | `2103` | GID for all the viz components |
| defaultImagePullPolicy | string | `"IfNotPresent"` | Docker imagePullPolicy for all viz components |
| defaultLogFormat | string | `"plain"` | Log format (`plain` or `json`) for all the viz components. |
Expand Down
1 change: 1 addition & 0 deletions viz/charts/linkerd-viz/templates/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ metadata:
component: web
namespace: {{.Release.Namespace}}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
{{- with .Values.dashboard.service.labels }}{{ toYaml . | trim | nindent 4 }}{{ end }}
annotations:
{{ include "partials.annotations.created-by" . }}
{{ with .Values.dashboard.service.annotations }}{{ toYaml . | trim | nindent 4 }}{{ end }}
Expand Down
2 changes: 2 additions & 0 deletions viz/charts/linkerd-viz/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ dashboard:
service:
# -- Additional annotations to add to dashboard service
annotations: {}
# -- Additional labels to add to dashboard service
labels: {}

namespaceMetadata:
image:
Expand Down

0 comments on commit c16f08c

Please sign in to comment.