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

sks: flag for CSI addon #572

Merged
merged 3 commits into from
Apr 2, 2024
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features
- sks: flag for CSI addon #572

### Improvements
- Instance reset password: remove wrong "rm" alias #583

### Deprecations
Expand Down
27 changes: 14 additions & 13 deletions cmd/sks_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
defaultSKSClusterCNI = "calico"
defaultSKSClusterServiceLevel = "pro"
sksClusterAddonExoscaleCCM = "exoscale-cloud-controller"
sksClusterAddonExoscaleCSI = "exoscale-container-storage-interface"
sksClusterAddonMetricsServer = "metrics-server"
)

Expand All @@ -37,6 +38,7 @@ type sksCreateCmd struct {
NoCNI bool `cli-usage:"do not deploy a default Container Network Interface plugin in the cluster control plane"`
NoExoscaleCCM bool `cli-usage:"do not deploy the Exoscale Cloud Controller Manager in the cluster control plane"`
NoMetricsServer bool `cli-usage:"do not deploy the Kubernetes Metrics Server in the cluster control plane"`
ExoscaleCSI bool `cli-usage:"deploy the Exoscale Container Storage Interface on worker nodes"`
NodepoolAntiAffinityGroups []string `cli-flag:"nodepool-anti-affinity-group" cli-usage:"default Nodepool Anti-Affinity Group NAME|ID (can be specified multiple times)"`
NodepoolDeployTarget string `cli-usage:"default Nodepool Deploy Target NAME|ID"`
NodepoolDescription string `cli-usage:"default Nodepool description"`
Expand Down Expand Up @@ -110,24 +112,23 @@ func (c *sksCreateCmd) cmdRun(_ *cobra.Command, _ []string) error { //nolint:goc
cluster.CNI = nil
}

addOns := map[string]struct{}{
sksClusterAddonExoscaleCCM: {},
sksClusterAddonMetricsServer: {},
}
cluster.AddOns = func() (v *[]string) {
if c.NoExoscaleCCM {
delete(addOns, sksClusterAddonExoscaleCCM)
addOns := make([]string, 0)

if !c.NoExoscaleCCM {
addOns = append(addOns, sksClusterAddonExoscaleCCM)
}

if !c.NoMetricsServer {
addOns = append(addOns, sksClusterAddonMetricsServer)
}
if c.NoMetricsServer {
delete(addOns, sksClusterAddonMetricsServer)

if c.ExoscaleCSI {
addOns = append(addOns, sksClusterAddonExoscaleCSI)
}

if len(addOns) > 0 {
list := make([]string, 0)
for k := range addOns {
list = append(list, k)
}
v = &list
v = &addOns
}
return
}()
Expand Down
Loading