Kubernetes
쿠버네티스 1
지요미=P
2024. 2. 1. 15:20
728x90
mkdir workspace && cd $_
kubectl get node
kubectl run nginx-pod --image=nginx # pending > ContainerCreating > Running
kubectl get pod
그런데 여기서 ip 이슈로 에러가 뜨는 경우가 생김..
# kubectl delete -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml
# yum install -y wget
# wget https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml
# vi calico.yaml
imagePullSecrets:
- name: dockersecret
# kubectl apply -f calico.yaml
# kubectl create secret docker-registry dockersecret --docker-username=<dockerhub id> --docker-password=<dockerhub password> --docker-email=<email>
# kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.0/manifests/calico.yaml
# kubectl get pod --all-namespaces
kubectl get secrets
kubectl edit sa default
다시 해보자!!
kubectl run nginx-pod --image=nginx
kubectl get pod
kubectl get service
kubectl expose pod nginx-pod --name clusterip --type=ClusterIP --port 80
kubectl expose pod nginx-pod --name nodeport --type=NodePort --port 80
kubectl expose pod nginx-pod --name loadbalancer --type=LoadBalancer --external-ip 192.168.0.29 --port 80
728x90