05 Devops
05 Devops
7. Docker - Architecture
Components
Docker client
Docker server/host
Docker registry
Architecture
C-S architecture
Docker client talks with docker daemon
Based on images, containes are created in Docker server
Docker also includes registries (dockerhub or private registry) for storing and sharing images
10.Docker - Docker-compose?
Tool to define and run multi-container docker applications
One yaml file has all definitions
One file, multiple images, all in single yaml file
One command all all start/down
Ingress
- API gateway, define routing rule to handle external traffic
Other types
Headless
- No IP or LB properties
- Stable identifiers
Advantages
Easy packaging/installation of yaml/k8s resources
Versioned, easy rollback, go back to any revision
Dynamic provison, placeholders inside yaml, override using values.yaml
Before
E.g. 3 microservices, 3 services file largely similar, except for minor changes in ports/version etc.
Maintain 3 yaml files separately.
User creates separate k8s files describing resources
After
Simplify template management
Get alread created versioned charts charts
Simple flow
helm install mydb bitnami.sql
Load the chart and dependencies
Parse values.yaml to update placeholders
Generate yaml
Parse the generated yaml to kube objetcs anad validate
Generate final yaml to send to kube
Commands
helm install
helm repo list
helm repo add
helm install
helm history
helm rollback
43.Helm - Structure
Helm chart structure.
46.Terraform - How can we retrieve information from external systems e.g. AWS latest AMI?
Datasources
Retrieve data from external systems like AWS/Database/API etc
Use it within terraform configuration
Accessed via special kind of resource “data resource”, declared using a data block
One data block => one data resource
Example
Fetch the latest amazon AMI instead of hardcoding the AMI name in configuration
data "aws_ami" "amz_linux2" {
most_recent = true
owners = ["amazon"]
filter {
name = "name"
values = ["amzn2-ami-kernel-5.10-hvm-*-gp2"]
}