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

Cluster V1: added feature gates & admission controllers at kubernetes options #55

Merged
merged 2 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 12 additions & 6 deletions pkg/v1/cluster/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ Example of creating a new cluster

Example of updating an existing cluster

updateOpts := &cluster.UpdateOpts{
MaintenanceWindowStart: "07:00:00",
KubernetesOptions: &cluster.KubernetesOptions{
EnablePodSecurityPolicy: false,
},
}
updateOpts := &cluster.UpdateOpts{
kolsean marked this conversation as resolved.
Show resolved Hide resolved
MaintenanceWindowStart: "07:00:00",
KubernetesOptions: &cluster.KubernetesOptions{
EnablePodSecurityPolicy: false,
FeatureGates: []string{
"BoundServiceAccountTokenVolume",
},
AdmissionControllers: []string{
"NamespaceLifecycle",
},
},
}
mksCluster, _, err := cluster.Update(ctx, mksClient, clusterID, updateOpts)
if err != nil {
log.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/v1/cluster/requests_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type CreateOpts struct {
Zonal *bool `json:"zonal,omitempty"`

// KubernetesOptions represents additional k8s options such as pod security policy,
// feature gates and etc.
// feature gates (Alpha stage only) and admission controllers.
KubernetesOptions *KubernetesOptions `json:"kubernetes_options,omitempty"`
}

Expand All @@ -67,6 +67,6 @@ type UpdateOpts struct {
EnablePatchVersionAutoUpgrade *bool `json:"enable_patch_version_auto_upgrade,omitempty"`

// KubernetesOptions represents additional k8s options such as pod security policy,
// feature gates and etc.
// feature gates (Alpha stage only) and admission controllers.
KubernetesOptions *KubernetesOptions `json:"kubernetes_options,omitempty"`
}
8 changes: 6 additions & 2 deletions pkg/v1/cluster/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type View struct {
Zonal bool `json:"zonal"`

// KubernetesOptions represents additional k8s options such as pod security policy,
// feature gates and etc.
// feature gates (Alpha stage only) and admission controllers.
KubernetesOptions *KubernetesOptions `json:"kubernetes_options,omitempty"`
}

Expand Down Expand Up @@ -150,9 +150,13 @@ func (result *View) UnmarshalJSON(b []byte) error {
}

// KubernetesOptions represents additional k8s options such as pod security policy,
// feature gates and etc.
// feature gates (Alpha stage only) and admission controllers.
type KubernetesOptions struct {
// EnablePodSecurityPolicy indicates if PodSecurityPolicy admission controller
// must be turned on/off.
EnablePodSecurityPolicy bool `json:"enable_pod_security_policy"`
// FeatureGates represents feature gates that should be enabled.
kolsean marked this conversation as resolved.
Show resolved Hide resolved
FeatureGates []string `json:"feature_gates"`
// AdmissionControllers represents admission controllers that should be enabled.
AdmissionControllers []string `json:"admission_controllers"`
}
Loading