Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing kube api-server config for alpha tests #15982

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions tests/e2e/kubetest2-kops/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ type deployer struct {
KopsBaseURL string `flag:"-"`
PublishVersionMarker string `flag:"publish-version-marker" desc:"The GCS path to which the --kops-version-marker is uploaded if the tests pass"`

ClusterName string `flag:"cluster-name" desc:"The FQDN to use for the cluster name"`
CloudProvider string `flag:"cloud-provider" desc:"Which cloud provider to use"`
GCPProject string `flag:"gcp-project" desc:"Which GCP Project to use when --cloud-provider=gce"`
Env []string `flag:"env" desc:"Additional env vars to set for kops commands in NAME=VALUE format"`
CreateArgs string `flag:"create-args" desc:"Extra space-separated arguments passed to 'kops create cluster'"`
KopsBinaryPath string `flag:"kops-binary-path" desc:"The path to kops executable used for testing"`
KubernetesFeatureGates string `flag:"kubernetes-feature-gates" desc:"Feature Gates to enable on Kubernetes components"`
createBucket bool `flag:"-"`
ClusterName string `flag:"cluster-name" desc:"The FQDN to use for the cluster name"`
CloudProvider string `flag:"cloud-provider" desc:"Which cloud provider to use"`
GCPProject string `flag:"gcp-project" desc:"Which GCP Project to use when --cloud-provider=gce"`
Env []string `flag:"env" desc:"Additional env vars to set for kops commands in NAME=VALUE format"`
CreateArgs string `flag:"create-args" desc:"Extra space-separated arguments passed to 'kops create cluster'"`
KopsBinaryPath string `flag:"kops-binary-path" desc:"The path to kops executable used for testing"`
KubernetesFeatureGates string `flag:"kubernetes-feature-gates" desc:"Feature Gates to enable on Kubernetes components"`
KubeAPIServerAdmissionPlugins string `flag:"kube-apiserver-admission-plugins" desc:"A list of API Server Admissions controler to run"`
KubeAPIServerRuntimeConfig string `flag:"kube-apiserver-runtime-config" desc:"RuntimeConfig values"`
createBucket bool `flag:"-"`

// ControlPlaneCount specifies the number of VMs in the control-plane.
ControlPlaneCount int `flag:"control-plane-count" desc:"Number of control-plane instances"`
Expand Down Expand Up @@ -109,9 +111,11 @@ func (d *deployer) Provider() string {
func New(opts types.Options) (types.Deployer, *pflag.FlagSet) {
// create a deployer object and set fields that are not flag controlled
d := &deployer{
commonOptions: opts,
BuildOptions: &builder.BuildOptions{},
boskosHeartbeatClose: make(chan struct{}),
commonOptions: opts,
BuildOptions: &builder.BuildOptions{},
boskosHeartbeatClose: make(chan struct{}),
KubeAPIServerAdmissionPlugins: "NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,StorageObjectInUseProtection,PersistentVolumeClaimResize,RuntimeClass,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota",
KubeAPIServerRuntimeConfig: "extensions/v1beta1=true,scheduling.k8s.io/v1alpha1=true",
}

dir, err := defaultArtifactsDir()
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/kubetest2-kops/deployer/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ func (d *deployer) createCluster(zones []string, adminAccess string, yes bool) e
args = appendIfUnset(args, "--gce-service-account", "default")
args = appendIfUnset(args, "--networking", "kubenet")

// kubeapi server config https://github.com/kubernetes/kubernetes/blob/622509830c1038535e539f7d364f5cd7c3b38791/cluster/gce/gci/configure-kubeapiserver.sh#L106
for _, v := range strings.Split(d.KubeAPIServerAdmissionPlugins, ",") {
args = append(args, "--set", fmt.Sprintf("spec.kubeAPIServer.enableAdmissionPlugins=%s", v))
}
if strings.Contains(d.KubernetesFeatureGates, "AllAlpha") {
d.KubeAPIServerRuntimeConfig = "api/all=true"
}
for _, v := range strings.Split(d.KubeAPIServerRuntimeConfig, ",") {
args = append(args, "--set", fmt.Sprintf("spec.kubeAPIServer.runtimeConfig=%s", v))
}
// We used to set the --vpc flag to split clusters into different networks, this is now the default.
// args = appendIfUnset(args, "--vpc", strings.Split(d.ClusterName, ".")[0])
case "digitalocean":
Expand Down