This commit is contained in:
root 2025-06-13 18:15:36 +09:00
parent f8c5838554
commit 270c3983ee
12 changed files with 337 additions and 2 deletions

38
gateway.yaml Normal file
View File

@ -0,0 +1,38 @@
# Gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: ssh2-gateway
namespace: default
spec:
# The selector matches the ingress gateway pod labels.
# If you installed Istio using Helm following the standard documentation, this would be "istio=ingress"
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: TCP
hosts:
- ssh2.nhngpuaas.com
---
# virtual-service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test-2
namespace: default
spec:
hosts:
- "ssh2.nhngpuaas.com"
gateways:
- ssh2-gateway
tcp:
- match:
- port: 8080
route:
- destination:
port:
number: 2222
host: ssh-service-2

38
gateway2.yaml Normal file
View File

@ -0,0 +1,38 @@
# Gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: ssh-gateway
namespace: org1
spec:
# The selector matches the ingress gateway pod labels.
# If you installed Istio using Helm following the standard documentation, this would be "istio=ingress"
selector:
istio: ingressgateway
servers:
- port:
number: 32222
name: http
protocol: TCP
hosts:
- ssh1.nhngpuaas.com
---
# virtual-service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test
namespace: org1
spec:
hosts:
- "ssh1.nhngpuaas.com"
gateways:
- ssh-gateway
tcp:
- match:
- port: 32222
route:
- destination:
port:
number: 2222
host: ssh-service

View File

@ -4,7 +4,7 @@ metadata:
name: test-claim
namespace: istio-system
spec:
storageClassName: nfs-client
storageClassName: user-nas
accessModes:
- ReadWriteMany
resources:

View File

@ -0,0 +1,9 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: user-nas
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
parameters:
archiveOnDelete: "false"
onDelete: Retain
reclaimPolicy: Retain

View File

@ -0,0 +1,110 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tf-notebook-pvc-istio
namespace: sample-istio
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: nfs-client
---
apiVersion: v1
kind: Service
metadata:
name: tf-notebook-istio
namespace: sample-istio
labels:
app: tf-notebook-istio
spec:
type: ClusterIP
ports:
- port: 80
name: http
targetPort: 8888
selector:
app: tf-notebook-istio
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tf-notebook-istio
namespace: sample-istio
spec:
replicas: 1
selector:
matchLabels:
app: tf-notebook-istio
template:
metadata:
labels:
app: tf-notebook-istio
spec:
nodeSelector:
nodegroup: gpu
containers:
- name: tf-notebook
image: tensorflow/tensorflow:2.16.2-gpu-jupyter
resources:
limits:
nvidia.com/gpu: 1
ports:
- containerPort: 8888
name: notebook
volumeMounts:
- name: notebook-storage
mountPath: /sample
volumes:
- name: notebook-storage
persistentVolumeClaim:
claimName: tf-notebook-pvc-istio
---
# Gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: tf-istio-gateway
namespace: sample-istio
spec:
# The selector matches the ingress gateway pod labels.
# If you installed Istio using Helm following the standard documentation, this would be "istio=ingress"
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- tf-istio.nhngpuaas.com
tls:
httpsRedirect: true # sends 301 redirect for http requests
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- tf-istio.nhngpuaas.com
tls:
mode: SIMPLE # enables HTTPS on this port
credentialName: nhngpuaas-ssl
---
# virtual-service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: test
namespace: sample-istio
spec:
hosts:
- "tf-istio.nhngpuaas.com"
gateways:
- tf-istio-gateway
http:
- route:
- destination:
port:
number: 80
host: tf-notebook-istio

22
monitoring/fail.yaml Normal file
View File

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: a1-failed-deploy
namespace: org1
spec:
replicas: 1
selector:
matchLabels:
app: fail-app
template:
metadata:
labels:
app: fail-app
spec:
nodeSelector:
nodegroup: gpu
containers:
- name: fail-container
image: busybox
command: ["sh", "-c", "exit 1"] # 실행하자마자 실패

26
monitoring/pending.yaml Normal file
View File

@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: a1-pending-deploy
namespace: org1
spec:
replicas: 1
selector:
matchLabels:
app: pending-app
template:
metadata:
labels:
app: pending-app
spec:
nodeSelector:
nodegroup: warkj
containers:
- name: pending-container
image: busybox
command: ["sleep", "3600"]
resources:
requests:
memory: "50000Gi" # 과도한 리소스 요청으로 스케줄링 불가
cpu: "100000"

View File

@ -2,7 +2,7 @@
# 변수 정의
NAMESPACE="org1" # 예: org1
POD_NAME="a7-tf-notebook-5b5ddb5f7-mmlqv" # 예: tf-notebook-abcdef
POD_NAME="a7-tf-notebook-7987c576c6-d2jx8" # 예: tf-notebook-abcdef
LOCAL_FILE="./unlimit.py" # 예: ./config.json
TARGET_PATH="/tf" # 예: /app/config/

13
svc.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: ssh-service
spec:
selector:
app: ssh-server
type: ClusterIP
ports:
- protocol: TCP
port: 2222
targetPort: 2222

13
svc2.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: ssh-service-2
spec:
selector:
app: ssh-server-2
type: ClusterIP
ports:
- protocol: TCP
port: 2222
targetPort: 2222

33
test.yaml Normal file
View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ssh-server
spec:
replicas: 1
selector:
matchLabels:
app: ssh-server
template:
metadata:
labels:
app: ssh-server
spec:
containers:
- name: ssh-server
image: linuxserver/openssh-server
env:
- name: PUID
value: "1000"
- name: PGID
value: "1000"
- name: TZ
value: "Asia/Seoul"
- name: PASSWORD_ACCESS
value: "true"
- name: USER_PASSWORD
value: "yourpassword" # 사용자 비밀번호 설정
- name: USER_NAME
value: "testuser" # 사용자 이름 설정
ports:
- containerPort: 2222 # ssh는 기본적으로 22번 포트지만 이 이미지는 2222 사용

33
test2.yaml Normal file
View File

@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ssh-server-2
spec:
replicas: 1
selector:
matchLabels:
app: ssh-server-2
template:
metadata:
labels:
app: ssh-server-2
spec:
containers:
- name: ssh-server
image: linuxserver/openssh-server
env:
- name: PUID
value: "1000"
- name: PGID
value: "1000"
- name: TZ
value: "Asia/Seoul"
- name: PASSWORD_ACCESS
value: "true"
- name: USER_PASSWORD
value: "1111" # 사용자 비밀번호 설정
- name: USER_NAME
value: "testuser" # 사용자 이름 설정
ports:
- containerPort: 2222 # ssh는 기본적으로 22번 포트지만 이 이미지는 2222 사용