connect to existing Cluster
To update existing kubectl cluster To local kubeconfig For Connecting
aws eks update-kubeconfig --name <cluster-name> --profile
```
```bash
aws eks update-kubeconfig --name seeding --profile seeding --region us-east-1
To Get Service
eksctl create cluster --name selenium --region ap-south-1
```
```bash
eksctl create cluster "selenium" --zones us-east-1a,us-east-1b,us-east-1c,us-east-1d,us-east-1f
```
```bash
eksctl register cluster --name selenium --provider other --region us-east-1
```
```bash
aws eks update-kubeconfig --region us-east-1 --name selenium
To delete existing kubectl config
rm ~/.kube/config
helm install selenium-grid docker-selenium/selenium-grid
kubectl get all -n selenium-grid
kubectl get services
To connect to internal network using busybox
For centos pod
To get all resource details
To delete the deployment
To Describe Events In Running Pods
To Force Delete A Pod
kubectl delete pod selenium-chrome-node --grace-period=0 --force
kubectl delete pod selenium-edge-node --grace-period=0 --force
kubectl delete pod selenium-firefox-node --grace-period=0 --force
kubectl delete pod selenium-hub-c6c94c6c4-h558k --grace-period=0 --force
To get status of kube system
To scale pod replicaset
kubectl scale --replicas=5 replicaset/selenium-chrome-node-7bf4f8dc77
kubectl scale deployment.apps/selenium-node-chrome-node --replicas=1
scale deployment
To get the value replicaset
kubectl get rs selenium-chrome-node-5f44bffc9b -o jsonpath="{.status.replicas} {.status.availableReplicas}"
To get replica status
Run the following command to forward a local port to the service:
To get running resource to yaml
If CRD unable to Delete remove the crd using kubectl edit
link-to-delete-crd[https://learn.microsoft.com/en-us/answers/questions/602466/custom-crds-not-getting-deleted-in-aks-cluster-how]
eks cluster with command
working with fargate,image is downloading & running
seeding Next: allow 80 port in security group for loadbalancer accessTo get metric server
To Find which Namespce if metric in
kubectl get scaledobject selenium-chrome-scaledobject -n default -o jsonpath={.status.externalMetricNames}
describe scaledobject
To create node group
eksctl create nodegroup --cluster=seeding \
--name=node2 \
--node-type=c5.2xlarge \
--nodes=3 \
--nodes-min=3 \
--nodes-max=3 \
--node-volume-size=20 \
--ssh-access \
--ssh-public-key=6548652153 \
--managed \
--region ap-south-1
```
### To delete node group
```bash
eksctl delete nodegroup --cluster=seeding --region ap-south-1
eksctl delete --cluster=seeding --region ap-south-1
To Proxypass service
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
kubectl kubernetes port-forward service/kubernetes 9090
To connect to ssh to pod
Field selector
To delete all pods
Getting Specific Evicted is not working
If above not working using --previous=false
k get events -n {namespace} --field-selector involvedobject.name={pod_name} --sort-by='.metadata.creationTimestamp'
Get the count of the pods
scale replica
Delete pods where status is Evicted
kubectl delete pod $(kubectl get pods --field-selector=status.phase=Failed -o jsonpath='{.items[?(@.status.reason=="Evicted")].metadata.name}')
rollout deployment
get_the status of container_restart count
Related Pages
- [[basics]]
- [[CheatSheet]]
- [[Tips]]
- [[AWS/EC2]]
- [[kube-errors/conf.refuse]]