Open Anghille opened 1 month ago
Please clarify what your values looked like on command line or values file. Also clarify what happened when you tried.
Sure thing:
My values looks like this (using latest 4.23.2 helmRelease):
serviceLabels:
kubernetes.io/type: external
serviceAnnotations:
io.cilium/lb-ipam-ips: x.x.x.x
minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "TRUE"
[...]
# DEPRECATED: use top-level rconServiceAnnotations instead
serviceAnnotations: {}
serviceType: ClusterIP
servicePort: 25565
[...]
I also tried (since the comment says "DEPRECATED: use top-level rconServiceAnnotations instead"):
rconServiceLabels:
kubernetes.io/type: external
rconServiceAnnotations:
io.cilium/lb-ipam-ips: x.x.x.x
minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "TRUE"
[...]
# DEPRECATED: use top-level rconServiceAnnotations instead
serviceAnnotations: {}
serviceType: ClusterIP
servicePort: 25565
[...]
But since no labels nor annotation were applied (a kubectl describe svc minecraftminecraft -n minecraft
yield none of the custom labels and annotations I added).
@eaglesemanation I was wondering if you had any advice about this since the feature was added with #146
Honestly not sure what's the issue here. Just pulled most recent commit from master branch, modified serviceLabels
and serviceAnnotations
in values.yaml without touching anything else, and ran helm template .
. Here is the result:
# Source: minecraft/templates/minecraft-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: release-name-minecraft
labels:
app: release-name-minecraft
chart: "minecraft-4.23.2"
release: "release-name"
heritage: "Helm"
app.kubernetes.io/name: "minecraft"
app.kubernetes.io/instance: release-name-minecraft
app.kubernetes.io/version: "4.23.2"
kubernetes.io/type: "external"
annotations:
io.cilium/lb-ipam-ips: x.x.x.x
spec:
type: ClusterIP
ports:
- name: minecraft
port: 25565
targetPort: minecraft
protocol: TCP
selector:
app: release-name-minecraft
Thanks for checking @eaglesemanation . Yeah, from reviewing the code it seemed like it would have worked fine.
@Anghille rather than inspecting the deployed services, can you confirm using helm template
or dry run of upgrade?
I'm also seeing this as of the current version when attempting to apply similar service annotations for MetalLB BGP.
Nevermind! service annotations just needs to be indented to the same level as minecraftserver and it works.
Sorry if I am not responding to this, I am currently quite busy but I will soon confirm it works and that is was, as expected, a problem between the chair and the keyboard indeed
It is usually usefull to be able to add
labels
andannotations
to services. One usecase might be to usecilium L2LoadbalancerIpPool
, which usually needslabels
to point to the pool that will hand ips to the service of typeLoadbalancer
andannotations
such asio.cilium/lb-ipam-ips
which fix the IP of the loadbalancer.I tried to use the
serviceLabels: {}
andserviceAnnotations: {}
fields as it is declared here in the templates: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 ?