Ran into an issue when initially adding api server args:
Error: "kube-apiserver" does not take any arguments,
got [
"map[audit-policy-file:/etc/kubernetes/audit/policy.yaml]"
"map[audit-webhook-config-file:/etc/kubernetes/audit/sink.yaml]"
]
So I looked closer at the deployment and args to kube-apiserver
kubectl -n hh get deployment/k8s-wed1110-api -o yaml | yq .spec.template.spec.containers.0.command | grep map
- map[audit-policy-file:/etc/kubernetes/audit/policy.yaml]
- map[audit-webhook-config-file:/etc/kubernetes/audit/sink.yaml]
If we look closer at how that deployment is rendered: In https://github.com/loft-sh/vcluster/blob/main/charts/k8s/templates/api-deployment.yaml#L143-L145
It’s looping over each api.extraArgs string value:
{{- range $f := .Values.api.extraArgs }}
- {{ $f | quote }}
{{- end }}
We were providing map types:
extraArgs:
- "audit-policy-file": "/etc/kubernetes/audit/policy.yaml"
- "audit-webhook-config-file: "/etc/kubernetes/audit/sink.yaml"
Instead of a list of strings:
extraArgs:
- "--audit-policy-file=/etc/kubernetes/audit/policy.yaml"
- "--audit-webhook-config-file=/etc/kubernetes/audit/sink.yaml"
Ran into an issue when initially adding api server args:
So I looked closer at the deployment and args to kube-apiserver
If we look closer at how that deployment is rendered: In https://github.com/loft-sh/vcluster/blob/main/charts/k8s/templates/api-deployment.yaml#L143-L145
It’s looping over each api.extraArgs string value:
We were providing map types:
Instead of a list of strings: