Skip to content

Commit

Permalink
toggle ha
Browse files Browse the repository at this point in the history
  • Loading branch information
qrnvttrl committed Sep 24, 2024
1 parent 579573c commit a5ccd92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cmd/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func newClusterCmd(c *config) *cobra.Command {
clusterCreateCmd.Flags().StringSlice("kube-apiserver-acl-allowed-cidrs", []string{}, "comma-separated list of external CIDRs allowed to connect to the kube-apiserver (e.g. \"212.34.68.0/24,212.34.89.0/27\")")
clusterCreateCmd.Flags().Bool("enable-kube-apiserver-acl", false, "restricts access from outside to the kube-apiserver to the source ip addresses set by --kube-apiserver-acl-allowed-cidrs [optional].")
clusterCreateCmd.Flags().String("network-isolation", "", "defines restrictions to external network communication for the cluster, can be one of baseline|restricted|isolated. baseline sets no special restrictions to external networks, restricted by default only allows external traffic to explicitly allowed destinations, forbidden disallows communication with external networks except for a limited set of networks. Please consult the documentation for detailed descriptions of the individual modes as these cannot be altered anymore after creation. [optional]")
clusterCreateCmd.Flags().Bool("high-availability", false, "enables a high availability control plane for the cluster, cannot be disabled again")

genericcli.Must(clusterCreateCmd.MarkFlagRequired("name"))
genericcli.Must(clusterCreateCmd.MarkFlagRequired("project"))
Expand Down Expand Up @@ -336,6 +337,7 @@ func newClusterCmd(c *config) *cobra.Command {
clusterUpdateCmd.Flags().StringSlice("kube-apiserver-acl-add-to-allowed-cidrs", []string{}, "comma-separated list of external CIDRs to add to the allowed CIDRs to connect to the kube-apiserver (e.g. \"212.34.68.0/24,212.34.89.0/27\")")
clusterUpdateCmd.Flags().StringSlice("kube-apiserver-acl-remove-from-allowed-cidrs", []string{}, "comma-separated list of external CIDRs to be removed from the allowed CIDRs to connect to the kube-apiserver (e.g. \"212.34.68.0/24,212.34.89.0/27\")")
clusterUpdateCmd.Flags().Bool("enable-kube-apiserver-acl", false, "restricts access from outside to the kube-apiserver to the source ip addresses set by --kube-apiserver-acl-* [optional].")
clusterUpdateCmd.Flags().Bool("high-availability", false, "enables a high availability control plane for the cluster, cannot be disabled again")

genericcli.Must(clusterUpdateCmd.RegisterFlagCompletionFunc("version", c.comp.VersionListCompletion))
genericcli.Must(clusterUpdateCmd.RegisterFlagCompletionFunc("workerversion", c.comp.VersionListCompletion))
Expand Down Expand Up @@ -447,6 +449,7 @@ func (c *config) clusterCreate() error {
encryptedStorageClasses := strconv.FormatBool(viper.GetBool("encrypted-storage-classes"))
enableNodeLocalDNS := viper.GetBool("enable-node-local-dns")
disableForwardToUpstreamDNS := viper.GetBool("disable-forwarding-to-upstream-dns")
highAvailability := strconv.FormatBool(viper.GetBool("high-availability"))

var cni string
if viper.IsSet("cni") {
Expand Down Expand Up @@ -595,6 +598,7 @@ WARNING: You are going to create a cluster that has no default internet access w
ClusterFeatures: &models.V1ClusterFeatures{
LogAcceptedConnections: &logAcceptedConnections,
DurosStorageEncryption: &encryptedStorageClasses,
HighAvailability: &highAvailability,
},
CustomDefaultStorageClass: customDefaultStorageClass,
Cni: cni,
Expand Down Expand Up @@ -908,6 +912,7 @@ func (c *config) updateCluster(args []string) error {
disableDefaultStorageClass := viper.GetBool("disable-custom-default-storage-class")

encryptedStorageClasses := strconv.FormatBool(viper.GetBool("encrypted-storage-classes"))
highAvailability := strconv.FormatBool(viper.GetBool("high-availability"))

workerlabels, err := helper.LabelsToMap(workerlabelslice)
if err != nil {
Expand Down Expand Up @@ -965,6 +970,9 @@ func (c *config) updateCluster(args []string) error {
if viper.IsSet("logacceptedconns") {
clusterFeatures.LogAcceptedConnections = &logAcceptedConnections
}
if viper.IsSet("high-availabilty") {
clusterFeatures.HighAvailability = &highAvailability
}

workergroupKubernetesVersion := viper.GetString("workerversion")

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.17.0
github.com/fi-ts/accounting-go v0.10.0
github.com/fi-ts/cloud-go v0.28.0
github.com/fi-ts/cloud-go v0.28.1-0.20240924075858-f804e87599af
github.com/gardener/gardener v1.91.0
github.com/gardener/machine-controller-manager v0.53.1
github.com/go-openapi/runtime v0.28.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ github.com/fi-ts/accounting-go v0.10.0 h1:vbPgTWq1iicyBWFRajX0bawZ1ADbhKGuJyNEtX
github.com/fi-ts/accounting-go v0.10.0/go.mod h1:ARKouuFYUV44xUKytAlczpzoti/S+o+PnXCN5BQA6nQ=
github.com/fi-ts/cloud-go v0.28.0 h1:MAg5Vsac9XYxCCL73USnceLtry1pvJovcNjwvqrv0lU=
github.com/fi-ts/cloud-go v0.28.0/go.mod h1:R7JMkC92eGvxkkMO1oP6lEevBH86DFiO9H9mo7YD5Sw=
github.com/fi-ts/cloud-go v0.28.1-0.20240924075858-f804e87599af h1:sORzXOAxqKObLnsmhn3GHlsfWRcgiZhWo+tAZDGUSqY=
github.com/fi-ts/cloud-go v0.28.1-0.20240924075858-f804e87599af/go.mod h1:R7JMkC92eGvxkkMO1oP6lEevBH86DFiO9H9mo7YD5Sw=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
Expand Down

0 comments on commit a5ccd92

Please sign in to comment.