Skip to content

Commit

Permalink
fix: Update helm chart to use Release.Namespace (#322)
Browse files Browse the repository at this point in the history
**Reason for Change**:
Update helm chart to use `Release.Namespace` instead of chart name.

**Requirements**

- [ ] 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 <[email protected]>
  • Loading branch information
helayoty committed Mar 29, 2024
1 parent bfcea8d commit e8ffbd1
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ az-patch-install-helm: ## Update Azure client env vars and settings in helm valu
yq -i '(.image.repository) = "$(REGISTRY)/workspace"' ./charts/kaito/workspace/values.yaml
yq -i '(.image.tag) = "$(IMG_TAG)"' ./charts/kaito/workspace/values.yaml

helm install kaito-workspace ./charts/kaito/workspace
helm install kaito-workspace ./charts/kaito/workspace --namespace $(KAITO_NAMESPACE) --create-namespace

##@ Build

Expand Down Expand Up @@ -219,7 +219,7 @@ gpu-provisioner-helm: ## Update Azure client env vars and settings in helm valu
yq -i '(.workloadIdentity.clientId) = "$(IDENTITY_CLIENT_ID)"' ./charts/kaito/gpu-provisioner/values.yaml
yq -i '(.workloadIdentity.tenantId) = "$(AZURE_TENANT_ID)"' ./charts/kaito/gpu-provisioner/values.yaml

helm install kaito-gpu-provisioner ./charts/kaito/gpu-provisioner
helm install kaito-gpu-provisioner ./charts/kaito/gpu-provisioner --namespace $(GPU_NAMESPACE) --create-namespace

##@ Build Dependencies

Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/gpu-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Helm chart for gpu-provisioner
To install the chart with the release name `gpu-provisioner`:

```bash
helm install gpu-provisioner ./charts/gpu-provisioner
helm install gpu-provisioner ./charts/gpu-provisioner --namespace=gpu-provisioner --create-namespace
```

## Values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: gpu-provisioner
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: gpu-provisioner-config-logging
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/gpu-provisioner/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: gpu-provisioner-global-settings
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
Expand Down
9 changes: 1 addition & 8 deletions charts/kaito/gpu-provisioner/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ .Values.namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gpu-provisioner.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
azure.workload.identity/use: "true"
{{- include "gpu-provisioner.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/gpu-provisioner/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "gpu-provisioner.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
Expand Down
6 changes: 3 additions & 3 deletions charts/kaito/gpu-provisioner/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "gpu-provisioner.fullname" . }}
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
{{- with .Values.additionalAnnotations }}
Expand All @@ -16,7 +16,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: gpu-provisioner
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand All @@ -36,4 +36,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: gpu-provisioner
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
2 changes: 1 addition & 1 deletion charts/kaito/gpu-provisioner/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: gpu-provisioner
namespace: {{ .Values.namespace }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gpu-provisioner.labels" . | nindent 4 }}
annotations:
Expand Down
1 change: 0 additions & 1 deletion charts/kaito/gpu-provisioner/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
namespace: gpu-provisioner
# -- Overrides the chart's name.
nameOverride: ""
# -- Overrides the chart's computed fullname.
Expand Down
4 changes: 3 additions & 1 deletion charts/kaito/workspace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
export REGISTRY=<your_docker_registry>
export IMG_NAME=workspace
export IMG_TAG=0.2.1
helm install workspace ./charts/kaito/workspace --set image.repository=${REGISTRY}/$(IMG_NAME) --set image.tag=$(IMG_TAG)
helm install workspace ./charts/kaito/workspace \
--set image.repository=${REGISTRY}/$(IMG_NAME) --set image.tag=$(IMG_TAG) \
--namespace kaito-workspace --create-namespace
```

## Values
Expand Down
9 changes: 1 addition & 8 deletions charts/kaito/workspace/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
apiVersion: v1
kind: Namespace
metadata:
name: {{ include "kaito.fullname" . }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "kaito.fullname" . }}
namespace: {{ include "kaito.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-device-plugin-daemonset
namespace: {{ include "kaito.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "kaito.fullname" . }}-role
namespace: {{ include "kaito.fullname" .}}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
rules:
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/role_binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "kaito.fullname" . }}-rolebinding
namespace: {{ include "kaito.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/secret-webhook-cert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Secret
metadata:
name: workspace-webhook-cert
namespace: {{ include "kaito.fullname" .}}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
data:
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "kaito.fullname" . }}
namespace: {{ include "kaito.fullname" .}}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/kaito/workspace/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "kaito.fullname" . }}-sa
namespace: {{ include "kaito.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kaito.labels" . | nindent 4 }}
5 changes: 3 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ az aks install-cli
Install the Workspace controller.

```bash
helm install workspace ./charts/kaito/workspace
helm install workspace ./charts/kaito/workspace --namespace kaito-workspace --create-namespace
```

Note that if you have installed another node provisioning controller that supports Karpenter-core APIs, the following steps for installing `gpu-provisioner` can be skipped.
Expand Down Expand Up @@ -105,7 +105,8 @@ settings:
EOF

# install gpu-provisioner using values override file
helm install gpu-provisioner ./charts/kaito/gpu-provisioner -f values.override.yaml
helm install gpu-provisioner ./charts/kaito/gpu-provisioner \
--namespace gpu-provisioner --create-namespace -f values.override.yaml
```

#### Create the federated credential
Expand Down

0 comments on commit e8ffbd1

Please sign in to comment.