- display information about cluster
kubectl cluster-info
- connect to cluster
aws eks update-kubeconfig --name [cluster_name] --region eu-west-1
- fix for permissions: open iam and add eks access
- multiple contexts
- kubectl config use-context [context]
- pods
kubectl get pods
- aws credentials C:\Users\ USERNAME . aws\credentials
[default]
aws_access_key_id =
aws_secret_access_key =
[github]
aws_access_key_id =
aws_secret_access_key =
- aws auth
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapUsers: |
- userarn: [USER-ARN]
username: github-ci
groups:
- system:masters
kubectl apply -f eks/aws-auth.yml
kubectl get service
kubectl get pods
kubectl apply -f eks/deployment.yml
kubectl apply -f eks/service.yml
kubectl apply -f eks/ingress.yml
- :ns [enter] (namespace)
- :service [enter]
- :pods [enter]
- :cj [enter] (cronjobs)
- :configmap [enter]
- d (describe on aws-auth)
- :quit [enter] (exit k9s)
apiVersion: apps/v1
kind: Deployment
metadata:
name: [OBJECT_NAME]
labels:
app: [APP_NAME]
spec:
replicas: 1 (number of pods)
selector:
matchLabels:
app: [APP_NAME]
template:
metadata:
labels:
app: [APP_NAME]
spec:
containers:
- name: [APP_NAME]
image: [URI_IMAGE]
ports:
- containerPort: 8080 (same as in dockerfile?)
-
deploy
kubectl apply -f eks/deployment.yml
-
check errors
- kubectl logs -f [POD_NAME]
-
service
apiVersion: v1
kind: Service
metadata:
name: me-warehouse-api-service
spec:
selector:
app: me-warehouse-api
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancer
-
deploy service
kubectl apply -f eks/service.yml
-
kubectl latest
https://storage.googleapis.com/kubernetes-release/release/stable.txt