50 days from zero to hero with Kubernetes

from zero to hero

Day 1

  • Pods
  • ReplicaSets
  • Secrets
  • Deployments
  • DaemonSets
  • Ingresses
  • CronJobs
  • CRDs(Custom Resource Definitions)

Day 2 Kubernetes basics

video series with Brendan Burns

Scheduler

  • Predicates
    • Memory
    • Node selector
  • Priorities
    • Spreading
    • Prefer

K8s build pipeline

  • Admission controller
    • image: myreg.acr.io/*

Git -> Build pipeline -> ACR -> K8s clusters

How volumes and storage works

  • empty Dir
  • hostPath

  • persistent volume
    • persistent volume claims

Stateful applications in K8s

Secrets management

  • password to the database
  • certificate

Secret is a collection of key/value pairs, stored in etcd.

Problem solving

Make changes on certain resource

1
2
3
kg get job analytics-calculate-dashboard-1635811200 -o json

kg edit job analytics-calculate-dashboard-1635811200 -o json

Container services

Save costs by lifting and shifting your existing applications to containers, and build microservices applications to deliver value to your users faster. Use end-to-end developer and CI/CD tools to develop, update, and deploy your containerized applications. Manage containers at scale with a fully managed Kubernetes container orchestration service that integrates with Azure Active Directory. Wherever you are in your app modernization journey, accelerate your containerized application development while meeting your security requirements.

IF YOU WANT TO… USE THIS
Simplify the deployment, management, and operations of Kubernetes Azure Kubernetes Service (AKS)
Quickly create powerful cloud apps for web and mobile App Service
Easily run containers on Azure without managing servers Container Instances
Cloud-scale job scheduling and compute management Batch
Develop microservices and orchestrate containers on Windows or Linux Service Fabric
Store and manage container images across all types of Azure deployments Container Registry
Run fully managed OpenShift clusters, jointly operated with Red Hat Azure Red Hat OpenShift

MEAN is a development stack for building and hosting web applications. Recall that MEAN is an acronym for its component parts: MongoDB, Express, AngularJS, and Node.js.

In this module, you learned when the MEAN stack is a good choice for web development and when you might want to choose something else. The main reason you might consider MEAN is if you’re familiar with JavaScript.

To see the MEAN stack in action, you created an Ubuntu virtual machine on Azure and installed the MEAN stack on it for web development.

With your MEAN stack in place, you created a basic book inventory web application. To summarize, the web application uses:

  • MongoDB to store information about books.
  • Express to route each HTTP request to the appropriate handler.
  • AngularJS to connect the user interface with the program’s business logic.
  • Node.js to host the server-side application.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
az vm create \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --name MeanStack \
  --image Canonical:UbuntuServer:16.04-LTS:latest \
  --admin-username azureuser \
  --generate-ssh-keys

az vm open-port \
  --port 80 \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --name MeanStack

ipaddress=$(az vm show \
  --name MeanStack \
  --resource-group learn-7df5839a-b8e4-44c7-aa07-cf5a0f405ada \
  --show-details \
  --query [publicIps] \
  --output tsv)

ssh azureuser@$ipaddress

Install MongoDB

1
2
3
4
5
6
7
sudo apt-get install -y mongodb

# check the service status
sudo systemctl status mongodb

# verify the installation
mongod --version

Install Node.js

  1. Register the Node.js repository so the package manager can locate the packages, like this.
1
2
3
4
5
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -

sudo apt-get install -y nodejs

node -v

Create a basic app