itzg / itzg/minecraft-server-charts

[minecraft] Service Label and Annotations

Open
#235 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Mustache
Stars
406
Forks
164
Avg merge
1h 34m
Merged PRs (30d)
1

Description

It is usually usefull to be able to add `labels` and `annotations` to services. One usecase might be to use `cilium L2LoadbalancerIpPool`, which usually needs `labels` to point to the pool that will hand ips to the service of type `Loadbalancer` and `annotations` such as `io.cilium/lb-ipam-ips` which fix the IP of the loadbalancer.

I tried to use the `serviceLabels: {}` and `serviceAnnotations: {}` fields as it is declared here in the templates:

```
apiVersion: v1
kind: Service
metadata:
name: {{ template "minecraft.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "minecraft.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app.kubernetes.io/name: "{{ .Chart.Name }}"
app.kubernetes.io/instance: {{ template "minecraft.fullname" . }}
app.kubernetes.io/version: "{{ .Chart.Version }}"
{{- if .Values.serviceLabels }}
{{- range $key, $value := .Values.serviceLabels}} #<--------- HERE
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
annotations:
{{ toYaml .Values.serviceAnnotations | indent 4 }} #<--------- HERE
```

But despites my efforts, I cannot add labels and annotations to this service. I managed to fix the bug by patching the service through `kustomize` for know.

I didnt found anyone reporting this. Maybe I am doing something wrong ?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the chart's Service template and the serviceLabels and serviceAnnotations values shown in the issue. Render the chart with those values and inspect the generated Service metadata to determine why the entries are not applied. Done means the rendered Service contains the requested labels and annotations.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.