EKS-Cluster-Role
AmazonEKS_CNI_Policy
AmazonEC2ContainerRegistryReadOnly
AmazonEKSWorkerNodePolicy
AmazonEKSNodeRole
demo-eks-cluster
one
1
aws eks update-kubeconfig --name demo-eks-cluster
kubectl config get-contexts
kubectl get nodes
aws sts get-caller-identity
kubectl get pods -A
kubectl config use-context arn:aws:eks:us-east-1:211125437318:cluster/demo-eks-cluster
cat > nginx-deployment.yaml << EOF
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80
EOF
kubectl apply -f nginx-deployment.yaml
kubectl get deployments
kubectl get pods
kubectl get services nginx-service
Copy
kubectl delete -f nginx-deployment.yaml