I am trying to add some tolerations for the FluxCD pod, but could not understand the syntax for tolerations
here is how i was trying
flux bootstrap github \
--toleration-keys='name=dedicated,value=Group' \
--components-extra=image-reflector-controller,image-automation-controller \
--owner=mak \
--repository=mu \
--path=yo \
--branch=main \
--version=v2.0.1 \
--token-auth
here is my other helm chart toleration that work for reference
tolerations:
- key: dedicated
operator: "Equal"
effect: "NoSchedule"
value: Group
what tried added above error
✗ Deployment/flux-system/helm-controller dry-run failed, reason: Invalid: Deployment.apps "helm-controller" is invalid: [spec.template.spec.tolerations[0].key: Invalid value: "name=dedicated": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]'), spec.template.spec.tolerations[1].key: Invalid value: "value=Group": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName', or 'my.name', or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')]
You didn't show how you tried to add the toleration to the Flux controllers, but your reference seems correct to me.
Flux controllers can be customized during bootstrap using Kustomize strategic merge patches and JSON patches.
First, create the file structure required by bootstrap, based on your command, it would look like this
Now, modify the patch file to add the toleration that will be added to Flux controllers.
After creating the patch file, let's add it to the Kustomization file.
This will apply the patch to all controllers, because we're targeting all Deployment objects that have the "app.kubernetes.io/part-of=flux" label.
Push the changes
Run the bootstrap command.
That's it, before applying the components, the toleration will be add to the controllers.