Skip to content
Snippets Groups Projects
Commit f45cd26f authored by SAVCHENKO Denys's avatar SAVCHENKO Denys
Browse files

add chart to repo

parent 744ef409
No related branches found
No related tags found
No related merge requests found
Pipeline #396664 passed
......@@ -124,7 +124,7 @@ example-chart
## Creation du chart Jupyter
Nous allons suivre la structure de l'exemple pour créer notre propre charte d'application jupyter.
Nous allons suivre la structure de l'exemple pour créer notre propre charte d'application jupyter.
```bash
mkdir -p jupyter-chart/templates
......@@ -176,7 +176,7 @@ version: 0.1.0
# 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: "7.3.2"
appVersion: "4.0.7" # <-- on a mis la version de jupyterlab ici
```
Même qu'il ne soit pas configurable, c'est déjà un chart Helm valide et installable.
......@@ -208,5 +208,7 @@ TEST SUITE: None
helm ls
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-jupyter tuto 1 2025-03-12 19:38:02.264727617 +0100 CET deployed jupyter-chart-0.1.0 7.3.2
my-jupyter tuto 1 2025-03-12 19:38:02.264727617 +0100 CET deployed jupyter-chart-0.1.0 4.0.7
```
Le chart a ce stade est disponible [ici](https://gitlab.in2p3.fr/si-apc/tp-kubernetes-si/-/tree/main/files/charts/step0/jupyter-chart).
\ No newline at end of file
apiVersion: v2
name: jupyter-chart
description: A Helm chart for Kubernetes
# 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.0
# 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: "4.0.7"
apiVersion: v1
data:
initpwd.py: |
#!/usr/bin/env python
from jupyter_server.auth import passwd
import os
import json
if os.getenv('JUPYTER_PWD') is not None:
pwd = passwd(os.getenv('JUPYTER_PWD'))
cfg_dir = os.path.join(os.getenv('HOME'), '.jupyter')
os.makedirs(cfg_dir, exist_ok=True)
cfg_json = os.path.join(cfg_dir, 'jupyter_server_config.json')
with open(cfg_json, 'w') as fd:
json.dump({"IdentityProvider": {"hashed_password": pwd}}, fd)
else:
print("JUPYTER_PWD environment variable is not set.")
kind: ConfigMap
metadata:
creationTimestamp: null
name: initscript
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jupyter
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: jupyter
port:
number: 8888
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
io.kompose.service: jupyter-claim0
name: jupyter-claim0
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose --file compose.yaml convert
kompose.version: 1.35.0 (9532ceef3)
labels:
io.kompose.service: jupyter
name: jupyter
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: jupyter
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose --file compose.yaml convert
kompose.version: 1.35.0 (9532ceef3)
labels:
io.kompose.service: jupyter
spec:
containers:
- image: jupyter/base-notebook
name: jupyter
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
cpu: "1"
memory: 1024Mi
ports:
- containerPort: 8888
protocol: TCP
env:
- name: JUPYTER_PORT
value: "8888"
livenessProbe:
exec:
command:
- /etc/jupyter/docker_healthcheck.py
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 10
failureThreshold: 3
volumeMounts:
- mountPath: /home/jovyan/work/local
name: jupyter-claim0
- name: jupyter-confdir
mountPath: /home/jovyan/.jupyter
initContainers:
- image: jupyter/base-notebook
name: pwd-init
command:
- python
- /initpwd.py
volumeMounts:
- name: initscript
mountPath: /initpwd.py
subPath: initpwd.py
- name: jupyter-confdir
mountPath: /home/jovyan/.jupyter
env:
- name: JUPYTER_PWD
valueFrom:
secretKeyRef:
name: jupyter-pwd
key: password
restartPolicy: Always
volumes:
- name: jupyter-claim0
persistentVolumeClaim:
claimName: jupyter-claim0
- name: initscript
configMap:
name: initscript
- name: jupyter-confdir
emptyDir: {}
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose --file compose.yaml convert
kompose.version: 1.35.0 (9532ceef3)
labels:
io.kompose.service: jupyter
name: jupyter
spec:
ports:
- name: "8888"
port: 8888
targetPort: 8888
selector:
io.kompose.service: jupyter
apiVersion: v1
data:
password: dmVyeV9zZWN1cmVfanVweXRlcl9wd2Q=
kind: Secret
metadata:
creationTimestamp: null
name: jupyter-pwd
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment