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 nodepool: allow specifying kubelet image gc parameters on creation #586

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

tgrondier
Copy link
Member

@tgrondier tgrondier commented Apr 4, 2024

Description

Adds the following flags:

On SKS Cluster creation:

  • nodepool-image-gc-low-threshold
  • nodepool-image-gc-high-threshold
  • nodepool-image-gc-min-age

The equivalent on SKS Nodepool add:

  • image-gc-low-threshold
  • image-gc-high-threshold
  • image-gc-min-age

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing


# creating with custom gc params

➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks create my-test-cluster \                                                                     
    --zone de-muc-1 \
    --service-level starter \
    --nodepool-name my-test-nodepool \
    --nodepool-size 3 \
    --nodepool-security-group sks-security-group --nodepool-image-gc-high-threshold 66 --nodepool-image-gc-low-threshold 33 --nodepool-image-gc-min-age "6m"
 ✔ Creating SKS cluster "my-test-cluster"... 2m3s
 ✔ Adding Nodepool "my-test-nodepool"... 33s
┼───────────────┼──────────────────────────────────────────────────────────────────┼
│  SKS CLUSTER  │                                                                  │
┼───────────────┼──────────────────────────────────────────────────────────────────┼
│ ID            │ f9a80f9c-c51a-4245-93c1-a99bf22f57d7                             │
│ Name          │ my-test-cluster                                                  │
│ Description   │                                                                  │
│ Zone          │ de-muc-1                                                         │
│ Creation Date │ 2024-04-08 08:04:24 +0000 UTC                                    │
│ Auto-upgrade  │ false                                                            │
│ Endpoint      │ https://f9a80f9c-c51a-4245-93c1-a99bf22f57d7.sks-de-muc-1.exo.io │
│ Version       │ 1.29.2                                                           │
│ Service Level │ starter                                                          │
│ CNI           │ calico                                                           │
│ Add-Ons       │ exoscale-cloud-controller                                        │
│               │ metrics-server                                                   │
│ State         │ running                                                          │
│ Labels        │ n/a                                                              │
│ Nodepools     │ edb63168-65ae-4650-a30f-0b2bb479d01e | my-test-nodepool          │
┼───────────────┼──────────────────────────────────────────────────────────────────┼
➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks nodepool show my-test-cluster my-test-nodepool
┼─────────────────────────┼──────────────────────────────────────┼
│      SKS NODEPOOL       │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ ID                      │ edb63168-65ae-4650-a30f-0b2bb479d01e │
│ Name                    │ my-test-nodepool                     │
│ Description             │                                      │
│ Creation Date           │ 2024-04-08 08:06:28 +0000 UTC        │
│ Instance Pool ID        │ 8b386584-117d-44f2-aa32-575b045abf01 │
│ Instance Prefix         │ pool                                 │
│ Instance Type           │ medium                               │
│ Template                │ sks-node-1.29.jammy                  │
│ Disk Size               │ 50                                   │
│ Anti Affinity Groups    │ n/a                                  │
│ Security Groups         │ sks-security-group                   │
│ Private Networks        │ n/a                                  │
│ Version                 │ 1.29.2                               │
│ Size                    │ 3                                    │
│ State                   │ running                              │
│ Taints                  │ n/a                                  │
│ Labels                  │ n/a                                  │
│ Add Ons                 │ n/a                                  │
│ Image GC Min            │ 6m                                   │
│ Image Gc Low Threshold  │ 33                                   │
│ Image Gc High Threshold │ 66                                   │
┼─────────────────────────┼──────────────────────────────────────┼


# creating with default values
➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks create my-test-cluster \                          
    --zone de-muc-1 \
    --service-level starter \
    --nodepool-name my-test-nodepool \
    --nodepool-size 1 \
    --nodepool-security-group sks-security-group                                                                                                            
 ✔ Creating SKS cluster "my-test-cluster"... 2m0s
 ✔ Adding Nodepool "my-test-nodepool"... 24s
┼───────────────┼──────────────────────────────────────────────────────────────────┼
│  SKS CLUSTER  │                                                                  │
┼───────────────┼──────────────────────────────────────────────────────────────────┼
│ ID            │ 7f55fe93-d0ea-494c-ab80-e798e3291404                             │
│ Name          │ my-test-cluster                                                  │
│ Description   │                                                                  │
│ Zone          │ de-muc-1                                                         │
│ Creation Date │ 2024-04-08 07:59:42 +0000 UTC                                    │
│ Auto-upgrade  │ false                                                            │
│ Endpoint      │ https://7f55fe93-d0ea-494c-ab80-e798e3291404.sks-de-muc-1.exo.io │
│ Version       │ 1.29.2                                                           │
│ Service Level │ starter                                                          │
│ CNI           │ calico                                                           │
│ Add-Ons       │ exoscale-cloud-controller                                        │
│               │ metrics-server                                                   │
│ State         │ running                                                          │
│ Labels        │ n/a                                                              │
│ Nodepools     │ c7fcd079-29eb-490a-96a0-0444e1875c6d | my-test-nodepool          │
┼───────────────┼──────────────────────────────────────────────────────────────────┼

➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks nodepool show my-test-cluster my-test-nodepool                                                                                     
┼─────────────────────────┼──────────────────────────────────────┼
│      SKS NODEPOOL       │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ ID                      │ c7fcd079-29eb-490a-96a0-0444e1875c6d │
│ Name                    │ my-test-nodepool                     │
│ Description             │                                      │
│ Creation Date           │ 2024-04-08 08:01:43 +0000 UTC        │
│ Instance Pool ID        │ a2a738e0-3708-45a4-af1c-d02f67f0bffb │
│ Instance Prefix         │ pool                                 │
│ Instance Type           │ medium                               │
│ Template                │ sks-node-1.29.jammy                  │
│ Disk Size               │ 50                                   │
│ Anti Affinity Groups    │ n/a                                  │
│ Security Groups         │ sks-security-group                   │
│ Private Networks        │ n/a                                  │
│ Version                 │ 1.29.2                               │
│ Size                    │ 1                                    │
│ State                   │ running                              │
│ Taints                  │ n/a                                  │
│ Labels                  │ n/a                                  │
│ Add Ons                 │ n/a                                  │
│ Image GC Min            │ 2m                                   │
│ Image Gc Low Threshold  │ 80                                   │
│ Image Gc High Threshold │ 85                                   │
┼─────────────────────────┼──────────────────────────────────────┼

# adding nodepool with custom gc params
➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks nodepool add my-test-cluster my-test-bar --size 1 --image-gc-high-threshold 90 --image-gc-low-threshold 70 --image-gc-min-age "3m" 
 ✔ Adding Nodepool "my-test-bar"... 24s
┼─────────────────────────┼──────────────────────────────────────┼
│      SKS NODEPOOL       │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ ID                      │ 8536338b-f865-41fa-a2b6-bb075161de8c │
│ Name                    │ my-test-bar                          │
│ Description             │                                      │
│ Creation Date           │ 2024-04-08 08:02:45 +0000 UTC        │
│ Instance Pool ID        │ 37ec10e5-7465-480a-b1ec-00eb0634f4f9 │
│ Instance Prefix         │ pool                                 │
│ Instance Type           │ medium                               │
│ Template                │ sks-node-1.29.jammy                  │
│ Disk Size               │ 50                                   │
│ Anti Affinity Groups    │ n/a                                  │
│ Security Groups         │ n/a                                  │
│ Private Networks        │ n/a                                  │
│ Version                 │ 1.29.2                               │
│ Size                    │ 1                                    │
│ State                   │ running                              │
│ Taints                  │ n/a                                  │
│ Labels                  │ n/a                                  │
│ Add Ons                 │ n/a                                  │
│ Image GC Min            │ 3m                                   │
│ Image Gc Low Threshold  │ 70                                   │
│ Image Gc High Threshold │ 90                                   │
┼─────────────────────────┼──────────────────────────────────────┼

# adding nodepool with default params

➜  ~/exo/cli git:(tgrondier/sc-66948/cli) go run . compute sks nodepool add my-test-cluster my-test-bar --size 1 
 ✔ Adding Nodepool "my-test-bar"... 27s
┼─────────────────────────┼──────────────────────────────────────┼
│      SKS NODEPOOL       │                                      │
┼─────────────────────────┼──────────────────────────────────────┼
│ ID                      │ 10e64207-8d67-4372-affd-f5cf4338f746 │
│ Name                    │ my-test-bar                          │
│ Description             │                                      │
│ Creation Date           │ 2024-04-08 08:07:59 +0000 UTC        │
│ Instance Pool ID        │ 0d324d1f-a870-4216-9d43-66bae836b4c9 │
│ Instance Prefix         │ pool                                 │
│ Instance Type           │ medium                               │
│ Template                │ sks-node-1.29.jammy                  │
│ Disk Size               │ 50                                   │
│ Anti Affinity Groups    │ n/a                                  │
│ Security Groups         │ n/a                                  │
│ Private Networks        │ n/a                                  │
│ Version                 │ 1.29.2                               │
│ Size                    │ 1                                    │
│ State                   │ running                              │
│ Taints                  │ n/a                                  │
│ Labels                  │ n/a                                  │
│ Add Ons                 │ n/a                                  │
│ Image GC Min            │ 2m                                   │
│ Image Gc Low Threshold  │ 80                                   │
│ Image Gc High Threshold │ 85                                   │
┼─────────────────────────┼──────────────────────────────────────┼


Copy link

cmd/sks_create.go Show resolved Hide resolved
cmd/sks_nodepool_add.go Outdated Show resolved Hide resolved
@tgrondier tgrondier marked this pull request as ready for review April 8, 2024 08:32
@tgrondier tgrondier merged commit 6ab3291 into master Apr 8, 2024
1 check passed
@tgrondier tgrondier deleted the tgrondier/sc-66948/cli branch April 8, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants