# jupyterhub-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: jupyterhub-config
namespace: jupyterhub
data:
jupyterhub_config.py: |
c.JupyterHub.spawner_class = 'kubespawner.KubeSpawner'
# Amazon Cognito 인증
c.JupyterHub.authenticator_class = 'oauthenticator.generic.GenericOAuthenticator'
c.GenericOAuthenticator.oauth_callback_url = 'https://jupyter.example.com/hub/oauth_callback'
c.GenericOAuthenticator.client_id = 'your-cognito-client-id'
c.GenericOAuthenticator.client_secret = 'your-cognito-client-secret'
c.GenericOAuthenticator.authorize_url = 'https://your-domain.auth.us-west-2.amazoncognito.com/oauth2/authorize'
c.GenericOAuthenticator.token_url = 'https://your-domain.auth.us-west-2.amazoncognito.com/oauth2/token'
c.GenericOAuthenticator.userdata_url = 'https://your-domain.auth.us-west-2.amazoncognito.com/oauth2/userInfo'
# 노트북 프로필 정의
c.KubeSpawner.profile_list = [
{
'display_name': 'CPU - 소형 (2 CPU, 4GB RAM)',
'slug': 'cpu-small',
'kubespawner_override': {
'cpu_limit': 2,
'cpu_guarantee': 1,
'mem_limit': '4G',
'mem_guarantee': '2G',
'image': 'jupyter/scipy-notebook:latest',
}
},
{
'display_name': 'CPU - 대형 (8 CPU, 32GB RAM)',
'slug': 'cpu-large',
'kubespawner_override': {
'cpu_limit': 8,
'cpu_guarantee': 4,
'mem_limit': '32G',
'mem_guarantee': '16G',
'image': 'jupyter/tensorflow-notebook:latest',
}
},
{
'display_name': 'GPU - T4 (4 CPU, 16GB RAM, 1x T4)',
'slug': 'gpu-t4',
'kubespawner_override': {
'cpu_limit': 4,
'cpu_guarantee': 2,
'mem_limit': '16G',
'mem_guarantee': '8G',
'image': 'jupyter/tensorflow-notebook:gpu',
'extra_resource_limits': {'nvidia.com/gpu': '1'},
'extra_resource_guarantees': {'nvidia.com/gpu': '1'},
'node_selector': {'nvidia.com/gpu.product': 'Tesla-T4'},
}
},
{
'display_name': 'GPU - A10G (8 CPU, 64GB RAM, 1x A10G)',
'slug': 'gpu-a10g',
'kubespawner_override': {
'cpu_limit': 8,
'cpu_guarantee': 4,
'mem_limit': '64G',
'mem_guarantee': '32G',
'image': 'jupyter/tensorflow-notebook:gpu',
'extra_resource_limits': {'nvidia.com/gpu': '1'},
'extra_resource_guarantees': {'nvidia.com/gpu': '1'},
'node_selector': {'nvidia.com/gpu.product': 'NVIDIA-A10G'},
}
},
{
'display_name': 'GPU - A100 (16 CPU, 128GB RAM, 1x A100 80GB)',
'slug': 'gpu-a100',
'kubespawner_override': {
'cpu_limit': 16,
'cpu_guarantee': 8,
'mem_limit': '128G',
'mem_guarantee': '64G',
'image': 'jupyter/tensorflow-notebook:gpu',
'extra_resource_limits': {'nvidia.com/gpu': '1'},
'extra_resource_guarantees': {'nvidia.com/gpu': '1'},
'node_selector': {'nvidia.com/gpu.product': 'NVIDIA-A100-SXM4-80GB'},
}
},
]
# 노트북용 영구 스토리지
c.KubeSpawner.storage_class = 'efs-sc'
c.KubeSpawner.storage_pvc_ensure = True
c.KubeSpawner.pvc_name_template = 'claim-{username}'
c.KubeSpawner.storage_capacity = '50Gi'
# 공유 읽기 전용 데이터셋 마운트
c.KubeSpawner.volumes = [
{
'name': 'shared-datasets',
'persistentVolumeClaim': {'claimName': 'shared-datasets-pvc'}
},
{
'name': 'shared-models',
'persistentVolumeClaim': {'claimName': 'shared-models-pvc'}
}
]
c.KubeSpawner.volume_mounts = [
{'name': 'shared-datasets', 'mountPath': '/home/jovyan/datasets', 'readOnly': True},
{'name': 'shared-models', 'mountPath': '/home/jovyan/models', 'readOnly': False}
]