-
Notifications
You must be signed in to change notification settings - Fork 6
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
Trim kf-notebook object names to size #21
Open
samkulkarni20
wants to merge
3
commits into
main
Choose a base branch
from
kf-notebooks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apiVersion: v2 | ||
name: kf-notebooks | ||
description: Helm chart for deploying KubeFlow Notebooks | ||
|
||
# A chart can be either an 'application' or a 'library' chart. | ||
# | ||
# Application charts are a collection of templates that can be packaged into versioned archives | ||
# to be deployed. | ||
# | ||
# Library charts provide useful utilities or functions for the chart developer. They're included as | ||
# a dependency of application charts to inject those utilities and functions into the rendering | ||
# pipeline. Library charts do not define any templates and therefore cannot be deployed. | ||
type: application | ||
|
||
# This is the chart version. This version number should be incremented each time you make changes | ||
# to the chart and its templates, including the app version. | ||
# Versions are expected to follow Semantic Versioning (https://semver.org/) | ||
version: 0.1.1 | ||
|
||
# This is the version number of the application being deployed. This version number should be | ||
# incremented each time you make changes to the application. Versions are not expected to | ||
# follow Semantic Versioning. They should reflect the version the application is using. | ||
# It is recommended to use it with quotes. | ||
appVersion: "v1.9.0" | ||
|
||
keywords: | ||
- kubeflow | ||
- notebooks | ||
- ai-apps | ||
- ai-notebooks | ||
- ai-ml | ||
|
||
sources: | ||
- https://github.com/kubeflow/kubeflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# KF-Notebooks | ||
|
||
A helm chart to deploy the [Kubeflow Notebooks](https://www.kubeflow.org/docs/components/notebooks/) on a Kubernetes cluster. | ||
|
||
## Setup Helm Repository | ||
|
||
```bash | ||
helm repo add infracloud-charts https://infracloudio.github.io/charts | ||
helm repo update | ||
``` | ||
|
||
See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation. | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `kf-notebooks`: | ||
|
||
```bash | ||
helm install kf-notebooks infracloud-charts/kf-notebooks | ||
``` | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall the `kf-notebooks` deployment: | ||
|
||
```bash | ||
helm uninstall kf-notebooks | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Parameters | ||
|
||
The following table lists the configurable parameters of the KF-Notebooks chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
|-----------|-------------|---------| | ||
| `global.storageClassName` | Global storage class name | `""` | | ||
| `nameOverride` | String to partially override kf-notebooks.fullname template | `""` | | ||
| `fullnameOverride` | String to fully override kf-notebooks.fullname template | `""` | | ||
| `service.enabled` | Enable service creation | `true` | | ||
| `service.port` | Service port | `80` | | ||
| `service.type` | Service type | `ClusterIP` | | ||
| `notebooks.jupyter.enabled` | Enable Jupyter notebook | `false` | | ||
| `notebooks.jupyter.name` | Jupyter notebook name | `jupyter-pytorch-cuda` | | ||
| `notebooks.jupyter.image.repository` | Jupyter notebook image repository | `kubeflownotebookswg/jupyter-pytorch-cuda-full` | | ||
| `notebooks.jupyter.image.tag` | Jupyter notebook image tag | `v1.9.0` | | ||
| `notebooks.jupyter.image.pullPolicy` | Jupyter notebook image pull policy | `IfNotPresent` | | ||
| `notebooks.jupyter.resources` | Jupyter notebook resources | See `values.yaml` for defaults | | ||
| `notebooks.jupyter.storage.size` | Jupyter notebook storage size | `5Gi` | | ||
| `notebooks.vscode.enabled` | Enable VSCode notebook | `false` | | ||
| `notebooks.vscode.name` | VSCode notebook name | `codeserver-python` | | ||
| `notebooks.vscode.image.repository` | VSCode notebook image repository | `kubeflownotebookswg/codeserver-python` | | ||
| `notebooks.vscode.image.tag` | VSCode notebook image tag | `v1.9.0` | | ||
| `notebooks.vscode.image.pullPolicy` | VSCode notebook image pull policy | `IfNotPresent` | | ||
| `notebooks.vscode.resources` | VSCode notebook resources | See `values.yaml` for defaults | | ||
| `notebooks.vscode.storage.size` | VSCode notebook storage size | `5Gi` | | ||
|
||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Thank you for installing {{ .Chart.Name }}. | ||
|
||
Your release is named {{ .Release.Name }}. | ||
|
||
To learn more about the release, try: | ||
|
||
$ helm status {{ .Release.Name }} | ||
$ helm get all {{ .Release.Name }} | ||
|
||
{{- if not (.Capabilities.APIVersions.Has "kubeflow.org/v1") }} | ||
WARNING: The Notebook custom resource is not available in your cluster. | ||
Please make sure Kubeflow is installed properly before using this chart. | ||
{{- else }} | ||
The following Notebooks have been created: | ||
|
||
{{- if .Values.notebooks.jupyter.enabled }} | ||
- Jupyter Notebook: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.jupyter.name }} | ||
{{- end }} | ||
{{- if .Values.notebooks.vscode.enabled }} | ||
- VSCode Notebook: {{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.vscode.name }} | ||
{{- end }} | ||
|
||
{{- if .Values.service.enabled }} | ||
To access the notebooks, use port-forwarding: | ||
|
||
{{- if .Values.notebooks.jupyter.enabled }} | ||
$ kubectl port-forward svc/{{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.jupyter.name }} {{ .Values.service.port }}:{{ .Values.service.port }} | ||
{{- end }} | ||
{{- if .Values.notebooks.vscode.enabled }} | ||
$ kubectl port-forward svc/{{ include "kf-notebooks.fullname" . }}-{{ .Values.notebooks.vscode.name }} {{ .Values.service.port }}:{{ .Values.service.port }} | ||
{{- end }} | ||
|
||
Then open your browser and navigate to http://localhost:{{ .Values.service.port }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "kf-notebooks.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "kf-notebooks.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $name := default .Chart.Name .Values.nameOverride }} | ||
{{- if contains $name .Release.Name }} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create a default name for notebook pvc. | ||
*/}} | ||
|
||
{{- define "kf-notebooks.notebooks.jupyter.pvc.name.base" -}} | ||
{{- printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.jupyter.name | trunc 53 | trimSuffix "-" -}} | ||
{{- end }} | ||
|
||
{{- define "kf-notebooks.notebooks.vscode.pvc.name.base" -}} | ||
{{- printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.vscode.name | trunc 53 | trimSuffix "-" -}} | ||
{{- end }} | ||
|
||
{{- define "kf-notebooks.notebooks.jupyter.pvc.name" -}} | ||
{{- printf "%s-%s" (include "kf-notebooks.notebooks.jupyter.pvc.name.base" .) "workspace" -}} | ||
{{- end }} | ||
|
||
{{- define "kf-notebooks.notebooks.vscode.pvc.name" -}} | ||
{{- printf "%s-%s" (include "kf-notebooks.notebooks.vscode.pvc.name.base" .) "workspace" -}} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "kf-notebooks.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "kf-notebooks.labels" -}} | ||
helm.sh/chart: {{ include "kf-notebooks.chart" . }} | ||
{{ include "kf-notebooks.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "kf-notebooks.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "kf-notebooks.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Check if Notebook CRD is installed | ||
*/}} | ||
{{- define "kf-notebooks.checkNotebookCRD" -}} | ||
{{- if not (.Capabilities.APIVersions.Has "kubeflow.org/v1") -}} | ||
{{- fail "Notebook CRD is not installed in the cluster. Please install Kubeflow first." -}} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{- range $key, $notebook := .Values.notebooks }} | ||
{{- if $notebook.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kf-notebooks.fullname" $) $notebook.name | trunc 53 | trimSuffix "-" }}-workspace | ||
labels: | ||
{{- include "kf-notebooks.labels" $ | nindent 4 }} | ||
app: {{ $notebook.name }} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ $notebook.storage.size }} | ||
{{- if $.Values.global.storageClassName }} | ||
storageClassName: {{ $.Values.global.storageClassName }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- if .Values.notebooks.jupyter.enabled }} | ||
{{- include "kf-notebooks.checkNotebookCRD" . }} | ||
apiVersion: kubeflow.org/v1 | ||
kind: Notebook | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.jupyter.name | trunc 41 | trimSuffix "-" }} | ||
labels: | ||
{{- include "kf-notebooks.labels" . | nindent 4 }} | ||
app: {{ .Values.notebooks.jupyter.name }} | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: {{ .Values.notebooks.jupyter.name }} | ||
image: "{{ .Values.notebooks.jupyter.image.repository }}:{{ .Values.notebooks.jupyter.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.notebooks.jupyter.image.pullPolicy }} | ||
resources: | ||
{{- toYaml .Values.notebooks.jupyter.resources | nindent 10 }} | ||
volumeMounts: | ||
- mountPath: /dev/shm | ||
name: dshm | ||
- mountPath: /home/jovyan | ||
name: workspace | ||
volumes: | ||
- emptyDir: | ||
medium: Memory | ||
name: dshm | ||
- name: workspace | ||
persistentVolumeClaim: | ||
claimName: {{ include "kf-notebooks.notebooks.jupyter.pvc.name" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{- if .Values.service.enabled }} | ||
{{- range $key, $notebook := .Values.notebooks }} | ||
{{- if $notebook.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kf-notebooks.fullname" $) $notebook.name | trunc 41 | trimSuffix "-" }} | ||
labels: | ||
{{- include "kf-notebooks.labels" $ | nindent 4 }} | ||
app: {{ $notebook.name }} | ||
spec: | ||
type: {{ $.Values.service.type }} | ||
ports: | ||
- port: {{ $.Values.service.port }} | ||
targetPort: 8888 | ||
protocol: TCP | ||
selector: | ||
app: {{ $notebook.name }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{{- if .Values.notebooks.vscode.enabled }} | ||
{{- include "kf-notebooks.checkNotebookCRD" . }} | ||
apiVersion: kubeflow.org/v1 | ||
kind: Notebook | ||
metadata: | ||
name: {{ printf "%s-%s" (include "kf-notebooks.fullname" .) .Values.notebooks.vscode.name | trunc 41 | trimSuffix "-" }} | ||
labels: | ||
{{- include "kf-notebooks.labels" . | nindent 4 }} | ||
app: {{ .Values.notebooks.vscode.name }} | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: {{ .Values.notebooks.vscode.name }} | ||
image: "{{ .Values.notebooks.vscode.image.repository }}:{{ .Values.notebooks.vscode.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.notebooks.vscode.image.pullPolicy }} | ||
resources: | ||
{{- toYaml .Values.notebooks.vscode.resources | nindent 10 }} | ||
volumeMounts: | ||
- mountPath: /dev/shm | ||
name: dshm | ||
- mountPath: /home/jovyan | ||
name: workspace | ||
volumes: | ||
- emptyDir: | ||
medium: Memory | ||
name: dshm | ||
- name: workspace | ||
persistentVolumeClaim: | ||
claimName: {{ include "kf-notebooks.notebooks.vscode.pvc.name" . }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Global settings | ||
global: | ||
storageClassName: "" | ||
|
||
# Common settings | ||
commonLabels: {} | ||
commonAnnotations: {} | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
# Service settings | ||
service: | ||
enabled: true | ||
port: 80 | ||
type: ClusterIP | ||
|
||
# Notebook settings | ||
notebooks: | ||
jupyter: | ||
enabled: false | ||
name: jupyter | ||
image: | ||
repository: kubeflownotebookswg/jupyter-pytorch-cuda-full | ||
tag: "" | ||
pullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: "0.6" | ||
memory: 1.2Gi | ||
nvidia.com/gpu: "1" | ||
requests: | ||
cpu: "0.5" | ||
memory: 1Gi | ||
storage: | ||
size: 5Gi | ||
|
||
vscode: | ||
enabled: false | ||
name: vscode | ||
image: | ||
repository: kubeflownotebookswg/codeserver-python | ||
tag: "" | ||
pullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: "0.6" | ||
memory: 1.2Gi | ||
requests: | ||
cpu: "0.5" | ||
memory: 1Gi | ||
storage: | ||
size: 5Gi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
name
field is duplicated in themetadata
section. You should remove one of the name definitions to fix the error.