๐ eksctl create cluster --name sandpit --version 1.14 --region us-east-2 --fargate [โน] eksctl version 0.11.1 [โน] using region us-east-2 [โน] setting availability zones to [us-east-2b us-east-2a us-east-2c] [โน] subnets for us-east-2b - public:192.168.0.0/19 private:192.168.96.0/19 [โน] subnets for us-east-2a - public:192.168.32.0/19 private:192.168.128.0/19 [โน] subnets for us-east-2c - public:192.168.64.0/19 private:192.168.160.0/19 [โน] using Kubernetes version 1.14 [โน] creating EKS cluster "sandpit" in "us-east-2" region with Fargate profile [โน] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-2 --cluster=sandpit' [โน] CloudWatch logging will not be enabled for cluster "sandpit" in "us-east-2" [โน] you can enable it with 'eksctl utils update-cluster-logging --region=us-east-2 --cluster=sandpit' [โน] Kubernetes API endpoint access will use default of {publicAccess=true, privateAccess=false} for cluster "sandpit" in "us-east-2" [โน] 1 task: { create cluster control plane "sandpit" } [โน] building cluster stack "eksctl-sandpit-cluster" [โน] deploying stack "eksctl-sandpit-cluster" [โ] all EKS cluster resources for "sandpit" have been created [โ] saved kubeconfig as "/Users/terrence/.kube/config" [โน] creating Fargate profile "fp-default" on EKS cluster "sandpit" [โน] created Fargate profile "fp-default" on EKS cluster "sandpit" [โน] "coredns" is now schedulable onto Fargate [โน] "coredns" is now scheduled onto Fargate [โน] "coredns" pods are now scheduled onto Fargate [โน] kubectl command should work with "/Users/terrence/.kube/config", try 'kubectl get nodes' [โ] EKS cluster "sandpit" in "us-east-2" region is ready
๐ eksctl create nodegroup --cluster sandpit --name workers --node-type t3a.medium --ssh-access --ssh-public-key aws-us-key --managed [โน] eksctl version 0.11.1 [โน] using region us-east-2 [โน] will use version 1.14 for new nodegroup(s) based on control plane version [โน] using EC2 key pair %!!(MISSING)q(*string=<nil>) [โน] 1 nodegroup (workers) was included (based on the include/exclude rules) [โน] will create a CloudFormation stack for each of 1 managed nodegroups in cluster "sandpit" [โน] 1 task: { 1 task: { create managed nodegroup "workers" } } [โน] building managed nodegroup stack "eksctl-sandpit-nodegroup-workers" [โน] deploying stack "eksctl-sandpit-nodegroup-workers" [โ] created 0 nodegroup(s) in cluster "sandpit" [โน] nodegroup "workers" has 2 node(s) [โน] node "ip-192-168-47-175.us-east-2.compute.internal" is ready [โน] node "ip-192-168-87-98.us-east-2.compute.internal" is ready [โน] waiting for at least 2 node(s) to become ready in "workers" [โน] nodegroup "workers" has 2 node(s) [โน] node "ip-192-168-47-175.us-east-2.compute.internal" is ready [โน] node "ip-192-168-87-98.us-east-2.compute.internal" is ready [โ] created 1 managed nodegroup(s) in cluster "sandpit" [โน] checking security group configuration for all nodegroups [โน] all nodegroups have up-to-date configuration
Kubernetes Dashboard
Install Kubernetes Dashboard in Kubernetes cluster:
๐ kubectl run react-typescript --image=jtech/react-typescript --port 3000 kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead. deployment.apps/react-typescript created
๐ kubectl describe deployments Name: react-typescript Namespace: default CreationTimestamp: Mon, 09 Dec 2019 14:56:09 +1100 Labels: run=react-typescript Annotations: deployment.kubernetes.io/revision: 1 Selector: run=react-typescript Replicas: 1 desired | 1 updated | 1 total | 0 available | 1 unavailable StrategyType: RollingUpdate MinReadySeconds: 0 RollingUpdateStrategy: 25% max unavailable, 25% max surge Pod Template: Labels: run=react-typescript Containers: react-typescript: Image: jtech/react-typescript Port: 3000/TCP Host Port: 0/TCP Environment: <none> Mounts: <none> Volumes: <none> Conditions: Type Status Reason ---- ------ ------ Available False MinimumReplicasUnavailable Progressing True ReplicaSetUpdated OldReplicaSets: <none> NewReplicaSet: react-typescript-867c948446 (1/1 replicas created) Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal ScalingReplicaSet 71s deployment-controller Scaled up replica set react-typescript-867c948446 to 1
๐ kubectl describe pods react-typescript Name: react-typescript-867c948446-qtvrp Namespace: default Priority: 2000001000 PriorityClassName: system-node-critical Node: fargate-ip-192-168-183-250.us-east-2.compute.internal/192.168.183.250 Start Time: Mon, 09 Dec 2019 14:56:59 +1100 Labels: eks.amazonaws.com/fargate-profile=fp-default pod-template-hash=867c948446 run=react-typescript Annotations: kubernetes.io/psp: eks.privileged Status: Running IP: 192.168.183.250 Controlled By: ReplicaSet/react-typescript-867c948446 Containers: react-typescript: Container ID: containerd://2ea5f1ea4fb731eb844f0e267581e9e188d29ab7a639b7b8ca50c83cfb12b4c3 Image: jtech/react-typescript Image ID: docker.io/jtech/react-typescript@sha256:0951fe4d9a24390123c7aa23612c8cdf1d8191a9d8e7d3cbc8bb4d8d763e0ce5 Port: 3000/TCP Host Port: 0/TCP State: Running Started: Mon, 09 Dec 2019 14:57:28 +1100 Ready: True Restart Count: 0 Environment: <none> Mounts: /var/run/secrets/kubernetes.io/serviceaccount from default-token-knpqq (ro) Conditions: Type Status Initialized True Ready True ContainersReady True PodScheduled True Volumes: default-token-knpqq: Type: Secret (a volume populated by a Secret) SecretName: default-token-knpqq Optional: false QoS Class: BestEffort Node-Selectors: <none> Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s node.kubernetes.io/unreachable:NoExecute for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Pulling 76s kubelet, fargate-ip-192-168-183-250.us-east-2.compute.internal Pulling image "jtech/react-typescript" Normal Pulled 49s kubelet, fargate-ip-192-168-183-250.us-east-2.compute.internal Successfully pulled image "jtech/react-typescript" Normal Created 49s kubelet, fargate-ip-192-168-183-250.us-east-2.compute.internal Created container react-typescript Normal Started 49s kubelet, fargate-ip-192-168-183-250.us-east-2.compute.internal Started container react-typescript
eksctl, a simple CLI tool for creating clusters on Amazonโs new managed Kubernetes service for EC2 - EKS. Written in Go, uses CloudFormation, https://eksctl.io/