"Kubectl run"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
22번째 줄: 22번째 줄:
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang='console'>
<syntaxhighlight lang='console'>
# kubectl run tmp --image=busybox --dry-run=client -oyaml
$ kubectl run pod1 --image=nginx --dry-run=client -oyaml
apiVersion: v1
apiVersion: v1
kind: Pod
kind: Pod
28번째 줄: 28번째 줄:
   creationTimestamp: null
   creationTimestamp: null
   labels:
   labels:
     run: tmp
     run: pod1
   name: tmp
   name: pod1
spec:
spec:
   containers:
   containers:
   - image: busybox
   - image: nginx
     name: tmp
     name: pod1
     resources: {}
     resources: {}
   dnsPolicy: ClusterFirst
   dnsPolicy: ClusterFirst

2024년 6월 8일 (토) 22:45 판

1 개요

kubectl run
$ kubectl run redis --image=redis
deployment.apps/redis created
$ kubectl get pod
NAME                    READY     STATUS              RESTARTS   AGE
redis-bb7894d65-4k8tm   0/1       ContainerCreating   0          6s
$ kubectl get pod
NAME                    READY     STATUS    RESTARTS   AGE
redis-bb7894d65-4k8tm   1/1       Running   0          10s
$ kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
deployment.apps/kubernetes-bootcamp created
$ kubectl run kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1 --port=8080
Error from server (AlreadyExists): deployments.apps "kubernetes-bootcamp" already exists
$ kubectl run pod1 --image=nginx --dry-run=client -oyaml
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: pod1
  name: pod1
spec:
  containers:
  - image: nginx
    name: pod1
    resources: {}
  dnsPolicy: ClusterFirst
  restartPolicy: Always
status: {}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}