반응형
파드 실행 해보기
yaml 만들기
$cat <<EOF > simple_pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: new-pod
namespace: myname
labels:
app: web
spec:
containers:
- name: web
image: nginx
EOF
$kubectl create -f ./simple_pod.yaml
$kubectl describe pod new-pod -n myname


curl 확인

노드에서도 확인 가능

파드 컨테이너 안으로 들어가보기
kubectl exec -n myname -it new-pod -- sh

deployment 로 실행하기
cat <<EOF > simple_deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
namespace: myname
spec:
selector:
matchLabels:
app: nginx
replicas: 3
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
EOF
kubectl create -f simple_deployment.yaml

반응형
'쿠버네티스(k8s)' 카테고리의 다른 글
| CNI 에러 문제 ContainerCreating (2) | 2022.11.02 |
|---|---|
| 네임스페이스(namespace) 생성 (0) | 2022.10.05 |
| 5. [쿠버네티스설치] worker node 설정 및 확인 (0) | 2022.09.23 |
| 4. [쿠버네티스설치] control plane Master node 설정 (0) | 2022.09.23 |
| 2.[쿠버네티스 설치] CentOs에 도커 (Docker) 설치 (0) | 2022.09.16 |