Saturday, 24 October 2020

Advanced Kubernetes

  •  Logging
    • Elastic search, FluentD,  Kibana,  LogTrail
  • Authentication
    •  OpenID connect(OIDC), Auth0
  • Authorization
    • Kubernetes RBAC
  • Packaging
    • Helm
  • The job resource
    • Job
  • Scheduling
    • CronJob
  • Deploying on kubernetes
    • Spinnaker
  • Micro services on kubernetes
    • linkerD
  • Federation
    • kubefed
  • Monitoring
    • Prometheus

 Logging

  • It is important to show errors, information and debugging data about application
  • Log Aggregation
    • ELK stack(Elastic search, log stash, Kibana)

Centralized Logging using

  • Fluentd - log forwarding
  • Elastic search - log indexing
  • Kibana - visualization
  • log trail - easy to use UI to show logs

Helm

  • Package manager for kubernetes
  • Makes application deployment easy
  • Helm is a tool that streamlines installing and managing Kubernetes applications
  • Helm uses packaging format called Charts
  • Example chart directory
    • charts/        -> manually managed chart dependencies
    • templates   -> template files like deployment, services and so. These are combined with config values from values.yaml
    • Chart.yaml -> meta data of chart. Also replacement for requirements.yaml going forward
    • requirements.yaml -> chart dependencies
    • values.yaml -> default config values for the chart
    • LICENSE 
    • README.md
  •  Workflow
    • Templates will have files similar to kubernetes files. They have variable interpolation and ability to call funtions within templates. It gets values from values.yaml & funtions from _helper.tpl
  • Create your helm chart
    • helm create mydashboardchart
    • helm lint ./mydashboardchart/
    • helm install --dry-run --debug ./mydashboardchart/ --generate-name
    • change image format, container port in deployment.yaml
    • helm install example ./mydashboardchart/ --set service.type=NodePort
    • minikube service example-mydashboardchart --url
    • helm list
    • helm uninstall example
    • helm template --debug <directory> 
  • Objects
    • Release
    • Charts -> contents of Chart.yaml
    • Files ->provides access to non-special files in a chart
    • Values -> contents of values.yaml
    • Capabilities -> 
    • Template -> info about current template
  • Template Functions and pipelines
    • Function syntax
      • function_name arg1 arg2 ....
      • 60 available funtions
    • Pipelines
      • pipeline |
  • Control structures
    • if-else
    • with
    • range
  • Variables
  • Named Template
    •  

 Jobs

  • non Parallel jobs 
  • kubectl get jobs
  • kubectl create -f yaml file

Scheduling with Cron Job

  • Cronjob schedule format
    • * * * * *
      • minute hour day_of_month month day_of_week
    • kubectl get cronjob

Spinnaker
  • Created at Netflix
  • 2 core set of features
    • Cluster management
    • Deployment management
      • Red/Black
      • rolling red/black
      • canary
Linkerd
  • It is a transparent proxy that adds
    • service discovery
    • routing
      • latency aware load balancing
      • shift traffic to canary deployments
    • failure handling
      • retries, deadlines, circuit breaking
    • visibility
      • using webuis
  • It is run as Daemon set

Federation

  •  
Prometheus
  • Open source monitoring & alerting tool
  • Built at sound cloud
  • It provides multi dimentional data model
  • flexible query language
  • metric collection happens via pull model over http
  •  

No comments:

Post a Comment