From b2a55e342163384f03ccec2b56c2bbf280bde285 Mon Sep 17 00:00:00 2001 From: John Gardiner Myers Date: Sun, 10 Oct 2021 16:24:56 -0700 Subject: [PATCH] Remove more non-configurable fields from v1alpha3 componentconfig --- k8s/crds/kops.k8s.io_clusters.yaml | 7 ++--- pkg/apis/kops/componentconfig.go | 4 +-- pkg/apis/kops/v1alpha2/componentconfig.go | 4 +-- pkg/apis/kops/v1alpha3/componentconfig.go | 34 ++++------------------- 4 files changed, 13 insertions(+), 36 deletions(-) diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index f56c72acaf..a52621e1a4 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -3260,10 +3260,9 @@ spec: maxPersistentVolumes: description: 'MaxPersistentVolumes changes the maximum number of persistent volumes the scheduler will scheduler onto the - same node. Only takes into affect if value is positive. This - corresponds to the KUBE_MAX_PD_VOLS environment variable, which - has been supported as far back as Kubernetes 1.7. The default - depends on the version and the cloud provider as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/' + same node. Only takes effect if value is positive. This corresponds + to the KUBE_MAX_PD_VOLS environment variable. The default depends + on the version and the cloud provider as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/' format: int32 type: integer qps: diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index d1ca68951f..7165f845c3 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -698,8 +698,8 @@ type KubeSchedulerConfig struct { // FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` // MaxPersistentVolumes changes the maximum number of persistent volumes the scheduler will scheduler onto the same - // node. Only takes into affect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable, - // which has been supported as far back as Kubernetes 1.7. The default depends on the version and the cloud provider + // node. Only takes effect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable. + // The default depends on the version and the cloud provider // as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/ MaxPersistentVolumes *int32 `json:"maxPersistentVolumes,omitempty"` // Qps sets the maximum qps to send to apiserver after the burst quota is exhausted diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 103fd50b9b..42a2c5d11d 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -697,8 +697,8 @@ type KubeSchedulerConfig struct { // FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` // MaxPersistentVolumes changes the maximum number of persistent volumes the scheduler will scheduler onto the same - // node. Only takes into affect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable, - // which has been supported as far back as Kubernetes 1.7. The default depends on the version and the cloud provider + // node. Only takes effect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable. + // The default depends on the version and the cloud provider // as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/ MaxPersistentVolumes *int32 `json:"maxPersistentVolumes,omitempty"` // Qps sets the maximum qps to send to apiserver after the burst quota is exhausted diff --git a/pkg/apis/kops/v1alpha3/componentconfig.go b/pkg/apis/kops/v1alpha3/componentconfig.go index 38f7947fdd..e4a7ad7f79 100644 --- a/pkg/apis/kops/v1alpha3/componentconfig.go +++ b/pkg/apis/kops/v1alpha3/componentconfig.go @@ -527,8 +527,8 @@ type KubeControllerManagerConfig struct { LogFormat string `json:"logFormat,omitempty" flag:"logging-format" flag-empty:"text"` // LogLevel is the defined logLevel LogLevel int32 `json:"logLevel,omitempty" flag:"v" flag-empty:"0"` - // ServiceAccountPrivateKeyFile is the location of the private key for service account token signing. - ServiceAccountPrivateKeyFile string `json:"serviceAccountPrivateKeyFile,omitempty" flag:"service-account-private-key-file"` + // ServiceAccountPrivateKeyFile is not admin-configurable. + ServiceAccountPrivateKeyFile string `json:"-"` // Image is the docker image to use Image string `json:"image,omitempty"` // CloudProvider is the provider for cloud services. @@ -547,8 +547,8 @@ type KubeControllerManagerConfig struct { Controllers []string `json:"controllers,omitempty" flag:"controllers"` // CIDRAllocatorType specifies the type of CIDR allocator to use. CIDRAllocatorType *string `json:"cidrAllocatorType,omitempty" flag:"cidr-allocator-type"` - // rootCAFile is the root certificate authority will be included in service account's token secret. This must be a valid PEM-encoded CA bundle. - RootCAFile string `json:"rootCAFile,omitempty" flag:"root-ca-file"` + // RootCAFile is not admin-configurable. + RootCAFile string `json:"-"` // LeaderElection defines the configuration of leader election client. LeaderElection *LeaderElectionConfiguration `json:"leaderElection,omitempty"` // ReconcilerSyncLoopPeriod is the amount of time the reconciler sync states loop @@ -695,8 +695,8 @@ type KubeSchedulerConfig struct { // FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` // MaxPersistentVolumes changes the maximum number of persistent volumes the scheduler will scheduler onto the same - // node. Only takes into affect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable, - // which has been supported as far back as Kubernetes 1.7. The default depends on the version and the cloud provider + // node. Only takes effect if value is positive. This corresponds to the KUBE_MAX_PD_VOLS environment variable. + // The default depends on the version and the cloud provider // as outlined: https://kubernetes.io/docs/concepts/storage/storage-limits/ MaxPersistentVolumes *int32 `json:"maxPersistentVolumes,omitempty"` // Qps sets the maximum qps to send to apiserver after the burst quota is exhausted @@ -1031,25 +1031,3 @@ type AWSLoadBalancerControllerConfig struct { // Version is the container image tag used. Version *string `json:"version,omitempty"` } - -// HasAdmissionController checks if a specific admission controller is enabled -func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool { - for _, x := range c.AdmissionControl { - if x == name { - return true - } - } - - for _, x := range c.DisableAdmissionPlugins { - if x == name { - return false - } - } - for _, x := range c.EnableAdmissionPlugins { - if x == name { - return true - } - } - - return false -}