Skip to content

Instantly share code, notes, and snippets.

@rmichela
Created October 9, 2019 13:57
Show Gist options
  • Save rmichela/8489d16b027543c1ff4af631d1aa967e to your computer and use it in GitHub Desktop.
Save rmichela/8489d16b027543c1ff4af631d1aa967e to your computer and use it in GitHub Desktop.
Notes for exploring Kubernetes on EKS
## Install tools
`brew install`
- `awscli`
- `eksctl`
- `aws-iam-authenticator`
- `kubernetes-cli`
- `k9s`
## Create EKS cluster
```shell
eksctl create cluster \
--name demo-cluster \
--version 1.14 \
--nodegroup-name demo-cluster-workers \
--node-type t3.medium \
--nodes 2 \
--nodes-min 1 \
--nodes-max 3 \
--node-ami auto
kubectl get pods
```
## Create pods and a deployment
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: "hello-service"
spec:
replicas: 2
selector:
matchLabels:
app: "hello-service"
template:
metadata:
labels:
app: "hello-service"
spec:
containers:
- name: "hello-service"
image: "tutum/hello-world"
imagePullPolicy: "IfNotPresent"
ports:
- name: "http"
containerPort: 80
protocol: TCP
```
## Create a service
```yaml
apiVersion: v1
kind: Service
metadata:
name: "hello-service"
spec:
type: LoadBalancer
ports:
- name: "http"
port: 8080
targetPort: 80
protocol: TCP
selector:
app: "hello-service"
```
Then browse to <http://localhost:8080/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment