Kubernetes

jupyter pod _endpoint

sherrylover 2023. 5. 11. 18:45
728x90
반응형

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jupyter-notebook-deployment
  labels:
    app: jupyter-notebook
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jupyter-notebook
  template:
    metadata:
      labels:
        app: jupyter-notebook
    spec:
      containers:
        - name: jupyter-notebook
          image: jupyter/scipy-notebook:latest
          ports:
            - containerPort: 8888
          volumeMounts:
            - name: jupyter-notebook-persistent-storage
              mountPath: /home/jovyan/work
      volumes:
        - name: jupyter-notebook-persistent-storage
          persistentVolumeClaim:
            claimName: jupyter-notebook-pvc
---
apiVersion: v1
kind: Service
metadata:
  name: jupyter-notebook-service
spec:
  selector:
    app: jupyter-notebook
  type: LoadBalancer
  ports:
    - name: http
      port: 8888
      targetPort: 8888
      protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
  name: jupyter-notebook-service
subsets:
  - addresses:
      - ip: <pod IP address>
    ports:
      - name: http
        port: 8888
        protocol: TCP

728x90
반응형