Many companies have annotations that are required when deploying applications in Kubernetes. It would be helpful if the helm charts supported this without having to customize the charts. In addition to annotations, there are some values that are helpful (or required) in different kubernetes environments.
While customizing the charts is not difficult, it does lead to the possibility of issues when IBM releases new versions of the helm charts. The customizations at that point need to be ported to the new version and can be either incompatible or missed during the merge. This could be helpful to anyone deploying UCD into a Kubernetes environment.
The below example is based on agent relays in EKS, but similar changes should be made to Agents and Servers as well as possible customizations for other Kubernetes technologies.
service.yaml
#Allow annotations as defined by customer
metadata:
{{- if .Values.user.annotations.service }}
annotations:
{{- range $key, $value := .Values.user.annotations.service }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
#Allow class for loadbalancer to be defined (needed for eks at least)
spec:
type: {{ .Values.service.type }}
{{- if .Values.user.loadBalancerClass }}
loadBalancerClass: {{ .Values.user.loadBalancerClass }}
{{- end }}
#Allow custom ranges for load balancers
spec:
{{- if .Values.user.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range .Values.user.loadBalancerSourceRanges }}
- {{ . }}
{{- end }}
{{- end}}
statefulset.yaml
#Allow annotations as defined by customer
metadata:
{{- if .Values.user.annotations.statefulset }}
annotations:
{{- range $key, $value := .Values.user.annotations.statefulset}}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
#allow for topology spread to be defined
#this could use more variables for more customization (e.g. all values below could be variables)
spec:
{{- if .Values.user.topologySpread }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
{{ include "sch.metadata.labels.standard" (list . "rly") | indent 12 }}
{{- end }}
sample section from values.yaml file
user:
loadBalancerClass: service.k8s.aws/nlb
annotations:
service:
external-dns.alpha.kubernetes.io/hostname: ucd-relay-endpoint.user.com
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-type: nlb
statefulset:
somekey: somevalue
loadBalancerSourceRanges:
- x.0.0.0/8
- x.x.0.0/16
- x.x.0.0/16
- x.x.0.0/16
topologySpread: true
We were told that ingress does not work properly at this time, so we haven't spend much time looking at it. At least an annotations section should probably be added there as well as possibly other settings. Although we don't need it at this time, it may be worth allowing custom annotations in every yaml file in the helm charts.
Thanks for submitting this Idea. Our development team has reviewed your request and have started development to support this idea.