Skip to content

Commit

Permalink
fix: kube-apiserver extra args override
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Witkowski <jwitkowski@zscaler.com>
  • Loading branch information
Jason Witkowski committed Feb 16, 2024
1 parent 6123d9a commit a513c68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion api/v1alpha1/tenantcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ type DeploymentSpec struct {
// (kube-apiserver, controller-manager, and scheduler).
Resources *ControlPlaneComponentsResources `json:"resources,omitempty"`
// ExtraArgs allows adding additional arguments to the Control Plane components,
// such as kube-apiserver, controller-manager, and scheduler.
// such as kube-apiserver, controller-manager, and scheduler. WARNING - This option
// can override existing parameters and cause components to misbehave in unxpected ways.
// Only modify if you know what you are doing.
ExtraArgs *ControlPlaneExtraArgs `json:"extraArgs,omitempty"`
AdditionalMetadata AdditionalMetadata `json:"additionalMetadata,omitempty"`
// AdditionalInitContainers allows adding additional init containers to the Control Plane deployment.
Expand Down
5 changes: 4 additions & 1 deletion config/crd/bases/kamaji.clastix.io_tenantcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6052,7 +6052,10 @@ spec:
extraArgs:
description: ExtraArgs allows adding additional arguments
to the Control Plane components, such as kube-apiserver,
controller-manager, and scheduler.
controller-manager, and scheduler. WARNING - This option
can override existing parameters and cause components to
misbehave in unxpected ways. Only modify if you know what
you are doing.
properties:
apiServer:
items:
Expand Down
2 changes: 1 addition & 1 deletion internal/builders/controlplane/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func (d Deployment) buildKubeAPIServerCommand(tenantControlPlane kamajiv1alpha1.

// Order matters, here: extraArgs could try to overwrite some arguments managed by Kamaji and that would be crucial.
// Adding as first element of the array of maps, we're sure that these overrides will be sanitized by our configuration.
return utilities.MergeMaps(extraArgs, current, desiredArgs)
return utilities.MergeMaps(current, desiredArgs, extraArgs)
}

func (d Deployment) secretProjection(secretName, certKeyName, keyName string) *corev1.SecretProjection {
Expand Down

0 comments on commit a513c68

Please sign in to comment.