label test

This commit is contained in:
irteam su-account 2025-06-26 16:04:59 +09:00
parent 3f94def624
commit b748f26fff
3 changed files with 58 additions and 46 deletions

View File

@ -20,10 +20,12 @@ spec:
selector:
matchLabels:
app: tf-notebook
user: user
template:
metadata:
labels:
app: tf-notebook
user: user
spec:
nodeSelector:
nodegroup: gpu
@ -52,6 +54,7 @@ metadata:
name: tf-notebook
labels:
app: tf-notebook
user: user
spec:
type: ClusterIP
ports:
@ -60,3 +63,4 @@ spec:
targetPort: 8888
selector:
app: tf-notebook
user: user

View File

@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tf-notebook
spec:
replicas: 2
selector:
matchLabels:
app: tf-notebook
user: user1
template:
metadata:
labels:
app: tf-notebook
user: user1
spec:
nodeSelector:
nodegroup: gpu
containers:
- name: tf-notebook
image: tensorflow/tensorflow:2.16.2-gpu-jupyter
resources:
limits:
cpu: "4"
memory: 16Gi
nvidia.com/gpu: 2
ports:
- containerPort: 8888
name: notebook
volumeMounts:
- name: notebook-storage
mountPath: /sample
volumes:
- name: notebook-storage
persistentVolumeClaim:
claimName: tf-notebook-pvc
---
apiVersion: v1
kind: Service
metadata:
name: tf-notebook
labels:
app: tf-notebook
user: user1
spec:
type: ClusterIP
ports:
- port: 80
name: http
targetPort: 8888
selector:
app: tf-notebook
user: user1

View File

@ -1,46 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: a1-tf-notebook-pvc
namespace: org2
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: nfs-client
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: a1-tf-notebook
namespace: org2
spec:
replicas: 1
selector:
matchLabels:
app: tf-notebook
template:
metadata:
labels:
app: tf-notebook
spec:
containers:
- image: tensorflow/tensorflow:2.16.2-gpu-jupyter
name: tf-notebook
ports:
- containerPort: 8888
name: notebook
resources:
limits:
nvidia.com/gpu: 1
volumeMounts:
- mountPath: /sample
name: notebook-storage
nodeSelector:
nodegroup: gpu
volumes:
- name: notebook-storage
persistentVolumeClaim:
claimName: a1-tf-notebook-pvc