본문 바로가기

728x90

Kubernetes

[kubernetes] kubectl port-forward 명령 kubectl port-forward 명령 Forward one or more local ports to a pod. 사용법 Examples: # Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod kubectl port-forward pod/mypod 5000 6000 # Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in a pod selected by the deployment kubectl port-forward deployment/mydeployment 5000 6000 # Lis.. 더보기
[kubernetes] kubectl exec 명령 kubectl exec 명령 Execute a command in a container. 사용법 Examples: # Get output from running the 'date' command from pod mypod, using the first container by default kubectl exec mypod -- date # Get output from running the 'date' command in ruby-container from pod mypod kubectl exec mypod -c ruby-container -- date # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod .. 더보기
[kubernetes] kubectl delete 명령 kubectl delete 명령 Delete resources by file names, stdin, resources and names, or by resources and label selector. 사용법 Examples: # Delete a pod using the type and name specified in pod.json kubectl delete -f ./pod.json # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml kubectl delete -k dir # Delete a pod based on the type and name in the JSON passed i.. 더보기
[kubernetes] kubectl run 명령 kubectl run 명령 Create and run a particular image in a pod. 사용법 Examples: # Start a nginx pod kubectl run nginx --image=nginx # Start a hazelcast pod and let the container expose port 5701 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 # Start a hazelcast pod and set environment variables "DNS_DOMAIN=cluster" and "POD_NAMESPACE=default" in the container kubectl run hazelcast --imag.. 더보기
[kubernetes] kubectl explain 명령 kubectl explain 명령 List the fields for supported resources. 사용법 Examples: # Get the documentation of the resource and its fields kubectl explain pods # Get the documentation of a specific field of a resource kubectl explain pods.spec.containers Options: --api-version='': Get different explanations for particular API version (API group/version) --recursive=false: Print the fields of fields (Curre.. 더보기
[kubernetes] kubectl get events 명령 kubectl get events 명령 Display one or many resources. 사용법 Examples: # List all pods in ps output format kubectl get pods # List all pods in ps output format with more information (such as node name) kubectl get pods -o wide # List a single replication controller with specified NAME in ps output format kubectl get replicationcontroller web # List deployments in JSON output format, in the "v1" vers.. 더보기
[kubernetes] ReplicationController kubernetes ReplicationController 레플리케이션 컨트롤러 생성 - 레이블 셀렉터 - 파드 템플릿 - 복제본 수 nginx-rc.yaml 편집 vim nginx-rc.yaml apiVersion: v1 kind: ReplicationController metadata: name: nginx-rc spec: replicas: 3 selector: app: webserver env: prod template: metadata: name: nginx-pod labels: app: webserver env: prod spec: containers: - name: nginx-container image: nginx:latest ports: - containerPort: 8080 kubectl.. 더보기
[kubernetes] minikube를 이용한 kubernetes 클러스터 배포 minikube를 이용한 kubernetes 클러스터 배포 minikube - kubernetes cluster 구성 도구 1. KVM install https://help.ubuntu.com/community/KVM/Installation sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils sudo adduser `id -un` libvirt sudo adduser `id -un` kvm sudo adduser `id -un` libvirt-qemu sudo reboot systemctl is-active libvirtd 2. minikube install https://minikube.sigs.k8s.io/d.. 더보기

728x90