EKS Deployment 101

|

|

  • by Niro, Kevin Lin
1

Kubernetes Recap

  • Everything in Kubernetes are API objects
    • Master
    • Node
    • Pod
    • Deployment
    • Service
    • Secret
    • ...
2
3
4

Prerequisite

  • Working Dev EKS setup and kubectl cli is required.
  • Refer to https://confluence.global.standardchartered.com/display/Frog/Setting+up+Development+Environment+for+EKS+on+Windows.
5

Deployment with Config Files

Generate Deployment Config File

Kubectl commands can be used to generate yaml files easily.

kubectl create deployment ... --dry-run=client -o yaml
kubectl expose deployment ... --dry-run=client -o yaml
6

Kube Config Example - Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: wealth-api
  name: wealth-api
  namespace: application
spec:
  replicas: 2
  selector:
    matchLabels:
      app: wealth-api
  template:
    metadata:
      labels:
        app: wealth-api
    spec:
      containers:
      - image: artifactory.global.standardchartered.com/frog/frog-wealth-sg:latest
        imagePullPolicy: Always
        name: frog-wealth-sg
        ports:
        - containerPort: 8080
7

Kube Config Example - Service

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"
  labels:
    app: wealth-api-svc
  name: wealth-api-svc
  namespace: application
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 8080
  selector:
    app: wealth-api
  type: LoadBalancer
  loadBalancerSourceRanges:
  - "10.0.0.0/8"
8

Deployment Commands

Create/Update

Destroy/Delete

kubectl -n application apply -f <file path>
kubectl -n application delete -f <file path>
9

Controller Pattern

  • In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed.
  • Each controller tries to move the current cluster state closer to the desired state.
10
11

Deployment Commands - Check Status

kubectl -n application get deployments
kubectl -n application get deployment
kubectl -n application get deployment <deployment name>
kubectl -n application describe deployment
kubectl -n application describe deployment <deployment name>
12

Pod Commands

Check Status & Inspect

Delete

kubectl -n application get pods
kubectl -n application describe pod <pod name>
kubectl -n application delete pod <pod name>
13

Service Commands

Check Status & Inspect

Delete

kubectl -n application get service
kubectl -n application describe service <svc name>
kubectl -n application delete service <svc name>
14

Code Walkthrough

by Niro

15

To be continued

|

Deployemnt using Helm

16

Videos

You can add videos to your slides, and control the layout just like you do with images.

Both local files and YouTube links playback.

17

Control the playback by using:

  • [autoplay] to start playing the video straight away
  • [loop] to loop the video
  • [mute] to mute the video
18