Skip to content

Commit

Permalink
feat: Add cloud provider specific nodeClaim requirement (#496)
Browse files Browse the repository at this point in the history
**Reason for Change**:
Pass the cloud provider name via helm chart so Kaito can set the cloud
provider specific requirements for the `NodeClaim`.

General updates:
- Add consts for each of sku & gpu across the pkg files.

**Requirements**

- [x] added unit tests and e2e tests (if applicable).

**Issue Fixed**:
<!-- If this PR fixes GitHub issue 4321, add "Fixes #4321" to the next
line. -->

**Notes for Reviewers**:

---------

Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
  • Loading branch information
helayoty authored Jul 3, 2024
1 parent 2e06aff commit 766b944
Show file tree
Hide file tree
Showing 13 changed files with 257 additions and 87 deletions.
41 changes: 21 additions & 20 deletions charts/kaito/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@ helm install workspace ./charts/kaito/workspace \

## Values

| Key | Type | Default | Description |
|------------------------------------------|--------|-----------------------------------|-------------|
| affinity | object | `{}` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/azure/kaito/workspace"` | |
| image.tag | string | `"0.2.0"` | |
| imagePullSecrets | list | `[]` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext.runAsNonRoot | bool | `true` | |
| presetRegistryName | string | `"mcr.microsoft.com/aks/kaito"` | |
| replicaCount | int | `1` | |
| resources.limits.cpu | string | `"500m"` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"10m"` | |
| resources.requests.memory | string | `"64Mi"` | |
| securityContext.allowPrivilegeEscalation | bool | `false` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| tolerations | list | `[]` | |
| webhook.port | int | `9443` | |
| Key | Type | Default | Description |
|------------------------------------------|--------|-----------------------------------|---------------------------------------------------------------|
| affinity | object | `{}` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ghcr.io/azure/kaito/workspace"` | |
| image.tag | string | `"0.2.0"` | |
| imagePullSecrets | list | `[]` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podSecurityContext.runAsNonRoot | bool | `true` | |
| presetRegistryName | string | `"mcr.microsoft.com/aks/kaito"` | |
| replicaCount | int | `1` | |
| resources.limits.cpu | string | `"500m"` | |
| resources.limits.memory | string | `"128Mi"` | |
| resources.requests.cpu | string | `"10m"` | |
| resources.requests.memory | string | `"64Mi"` | |
| securityContext.allowPrivilegeEscalation | bool | `false` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| tolerations | list | `[]` | |
| webhook.port | int | `9443` | |
| cloudProviderName | string | `"azure"` | Karpenter cloud provider name. Values can be "azure" or "aws" |
2 changes: 2 additions & 0 deletions charts/kaito/workspace/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ spec:
fieldPath: metadata.namespace
- name: PRESET_REGISTRY_NAME
value: {{ .Values.presetRegistryName }}
- name: CLOUD_PROVIDER
value: {{ .Values.cloudProviderName }}
ports:
- name: http-metrics
containerPort: 8080
Expand Down
2 changes: 2 additions & 0 deletions charts/kaito/workspace/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ resources:
nodeSelector: {}
tolerations: []
affinity: {}
# Values can be "azure" or "aws"
cloudProviderName: "azure"
17 changes: 10 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.22.0
toolchain go1.22.2

require (
github.com/Azure/karpenter-provider-azure v0.5.0
github.com/aws/karpenter-core v0.29.2
github.com/go-logr/logr v1.4.2
github.com/onsi/ginkgo/v2 v2.19.0
Expand Down Expand Up @@ -39,11 +40,11 @@ require (
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/zapr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobuffalo/flect v1.0.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand All @@ -54,7 +55,7 @@ require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand All @@ -72,16 +73,16 @@ require (
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/prometheus/statsd_exporter v0.24.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand All @@ -100,6 +101,8 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/apiserver v0.30.1 // indirect
k8s.io/cloud-provider v0.29.3 // indirect
k8s.io/csi-translation-lib v0.29.3 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/pod-security-admission v0.0.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
Loading

0 comments on commit 766b944

Please sign in to comment.