MindMap Gallery Getting started with k8s and practicing microservice projects
Practical mind map for getting started with k8s and microservice projects. Kubernetes is an open source used to manage containerized applications on multiple hosts in the cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and efficient (powerful). Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance.
Edited at 2023-07-24 13:23:28This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
Getting started with k8s and practicing microservice projects
I. Course Introduction
Background introduction
Market demand
technological competitiveness
Industry development direction
Lecturer Profile
Name: Liu Gang
Working experience: 7 years
work experience:
Senior Lecturer Ke Dinglang
Former head of technical department
Well-known IoT company in Shenzhen Team Leader
Familiar with technical fields: microservices, Internet of Things, cloud native, etc.
Teaching style: continuous high-energy technical point output,
Course Interpretation
For the crowd
Operation and Maintenance Engineer
Java development
Architect
technical manager
pre-learning
must
Basic Linux commands
Docker
Optional
Java microservice development
Redis
Elasticsearch
Prometheus
Jenkins
Module interpretation
Course objectives
In-depth understanding of k8s major resource objects and best practices
Proficient in using various k8s scheduling strategies
Master k8s network principles and applications
Proficient in pod controllers and application scenarios
Proficient in k8s microservice DevOps practice
summary
II. Core Concepts
Get to know Kubernetes
What is Kubernetes?
Why do you need Kubernetes?
Three major stages of application deployment
Traditional deployment
Virtualization deployment
Containerized deployment
Features of k8s
Self-healing
Elastic scaling
Automatic deployment and rollback
Service discovery and load balancing
Confidentiality and configuration management
storage orchestration
Batch processing
Enterprise-level container scheduling platform
Apache Mesos
basic concept
Advantage
Docker Swarm
basic concept
Advantage
Google Kubernetes
basic concept
Advantage
Cluster architecture and components
Related components
Control Panel Component (Master)
kube-apiserver
kube-controller-manager
cloud-controller-manager
kube-scheduler
etcd
node component
kubelet
kube-proxy
container runtime
add-ons
kube-dns
Ingress Controller
Prometheus
Dashboard
Federation
Fluentd-elasticsearch
layered architecture
ecosystem
interface layer
Management
Application layer
core layer
Core concepts and terminology
Classification of services
no status
Represent application
Nginx
Apache
Advantages: Transparent to the client, no dependencies, and can efficiently achieve expansion and migration
Disadvantages: cannot store data, requires additional data service support
Stateful
Represent application
MySQL
Redis
Advantages: Data can be stored independently to achieve data management
Disadvantages: In a cluster environment, it is complicated to implement master-slave, data synchronization, backup, and horizontal expansion.
resources and objects
Classification of resources
Metadata type
Horizontal Pod Autoscaler (HPA)
PodTemplate
LimitRange
cluster level
Namespace
Node
ClusterRole
ClusterRoleBinding
namespace level
workload type
Pod
replicas
controller
Applies to stateless services
ReplicationController(RC)
ReplicaSet(RS)
Label and Selector
Deployment
Create a Replica Set/Pod
Rolling upgrade/rollback
Smooth expansion and contraction
Pause and resume Deployment
Applies to stateful services
StatefulSet
main feature
Stable persistent storage
stable network sign
Orderly deployment and orderly expansion
Orderly shrink, orderly deletion
composition
Headless Service
volumeClaimTemplate
Precautions
Only supported by kubernetes v1.5 and above.
All Pod Volumes must use PersistentVolume or be created by the administrator in advance.
In order to ensure data security, the Volume will not be deleted when deleting the StatefulSet.
StatefulSet requires a Headless Service to define DNS domain, which needs to be created before StatefulSet
daemon
DaemonSet
Task/scheduled task
Job
CronJob
service discovery
Service
Ingress
storage
Volume
CSI
Special type configuration
ConfigMap
Secret
DownwardAPI
other
Role
RoleBinding
Resource list
Object specifications and state
Specification
Status
Microservice project k8s environment demonstration
III. In-depth k8s practical advanced chapter
Build a Kubernetes cluster
Build plan
minikube
kubeadm
Server requirements
3 servers (virtual machines)
k8s-master: 192.168.113.120
k8s-node1: 192.168.113.121
k8s-node2: 192.168.113.122
Minimum configuration: 2 cores, 2G memory, 20G hard drive
It is best to be able to connect to the Internet. If not, you need to have a private warehouse that provides the corresponding image.
Software Environment
Operating system: CentOS 7
Docker:20
k8s:1.23.6
installation steps
1. Initial operation
2. Install basic software (all nodes)
2.1 Install Docker
2.2 Add Alibaba Cloud yum source
2.3 Install kubeadm, kubelet, kubectl
3. Deploy Kubernetes Master
4. Join Kubernetes Node
5. Deploy the CNI network plug-in
7. Test the kubernetes cluster
Binary installation
Command line tools
Command line tool kubectl
Use kubectl on any node
Resource operations
Create object
Display and find resources
Update resources
patch resources
Edit resources
scale resources
Delete resources
Pods and clusters
Interact with running Pods
Interact with nodes and clusters
Resource types and aliases
pods
po
deployments
deploy
services
svc
namespace
ns
nodes
no
Formatted output
Output json format
-o json
Print resource name only
-o name
Output all information in plain text format
-o wide
Output yaml format
-oyaml
API overview
type
Alpha
Beta
Stable
Access control
Certification
Authorize
Deprecated api description
Dive into the pod
Pod configuration file
probe
type
StartupProbe
LivenessProbe
ReadinessProbe
Detection method
ExecAction
TCPSocketAction
HTTPGetAction
Parameter configuration
life cycle
Pod exit process
delete operation
Endpoint deletes the pod's IP address
Pod changes to Terminating state
Execute preStop command
Application of PreStop
Registration center is offline
Data cleaning
Data destruction
Resource Scheduling
Label and Selector
Label
Configuration file
kubectl
Create a label temporarily
Modify existing tags
View label
Selector
Configuration file
kubectl
Deployment
Function
create
rolling update
Multiple rolling updates in parallel
rollback
Expansion and reduction
Pause and resume
Configuration file
StatefulSet
Function
create
Expansion and reduction
Image update
RollingUpdate
Grayscale release
OnDelete
delete
delete pvc
Configuration file
DaemonSet
Configuration file
Specify Node node
nodeSelector
nodeAffinity
podAffinity
rolling update
HPA automatic expansion/shrinking
Enable indicator service
CPU and memory indicator monitoring
Custom metrics
Service release
Service
Definition of Service
Command operation
Endpoint
Agent k8s external service
Unified access names for each environment
Access other services outside the k8s cluster
Project migration
Reverse proxy external domain name
Common types
ClusterIP
ExternalName
NodePort
LoadBalancer
Ingress
Install ingress-nginx
Add helm repository
Download package
Configuration parameters
Create Namespace
Install ingress
Basic use
Create an ingress
Multiple domain name configuration
Configuration and storage
Configuration management
ConfigMap
create
Use ConfigMap
Encrypted data configuration Secret
Use of SubPath
Configuration hot update
Directly modify the configmap through the edit command
Replace via replace
Immutable Secrets and ConfigMap
Persistent storage
Volumes
HostPath
Configuration file
EmptyDir
Configuration file
NFS mount
Install nfs
Configuration file
PV and PVC
life cycle
Construct
static build
dynamic build
binding
use
recycling strategy
Retain
Delete
Recycle
PV
state
Available: idle, not bound
Bound: Already bound by PVC
Released: The PVC is deleted and the resources are recycled, but the PV is not reused.
Failed: Automatic recycling failed
Configuration file
PVC
Pod binding PVC
Configuration file
StorageClass
Provisioner
NFS dynamic preparation case
nfs-provisioner
StorageClass configuration
RBAC configuration
PVC is in Pending status
Configure SelfLink
No need for SelfLink provisioner
PVC test configuration
Advanced scheduling
CronJob scheduled tasks
cron expression
Configuration file
Initialize the container InitContainer
stain and tolerance
Taint
NoSchedule
NoExecute
Toleration
Equal
Exists
Affinity
NodeAffinity
RequiredDuringSchedulingIgnoredDuringExecution
PreferredDuringSchedulingIgnoredDuringExecution
application
match type
In
NotIn
Exists
DoesNotExist
Gt
Lt
Configuration template
PodAffinity
RequiredDuringSchedulingIgnoredDuringExecution
PreferredDuringSchedulingIgnoredDuringExecution
Configuration template
PodAntiAffinity
RequiredDuringSchedulingIgnoredDuringExecution
PreferredDuringSchedulingIgnoredDuringExecution
Identity authentication and permissions
Certification
User Accounts
Service Accounts
Service Account Automation
Service Account Admission Controller
Token Controller
Service Account Controller
Authorization (RBAC)
Role
Configuration file
ClusterRole
RoleBinding
Configuration file
ClusterRoleBinding
IV. Operation and maintenance management
Helm package manager
What is Helm?
Helm architecture
important concepts
chart
config
release
components
Helm client
Helm library
Install Helm
Download binaries
Unzip (tar -zxvf helm-v3.10.2-linux-amd64.tar.gz)
Move the helm program in the decompression directory to usr/local/bin/helm
Add Alibaba Cloud helm warehouse
Helm’s commonly used commands
helm repo
List, add, update, delete chart repositories
helm search
Search charts using keywords
helm pull
Pull the chart from the remote warehouse to the local
helm create
Create a new chart locally
helm dependency
Manage chart dependencies
helm install
Install charts
helm list
List all releases
helm lint
Check whether the chart configuration is incorrect
helm package
Package local chart
helm rollback
Roll back release to historical version
helm uninstall
uninstall release
helm upgrade
upgrade release
Detailed explanation of chart
Directory Structure
Redis chart practice
Modify helm source
Search redis chart
Modify configuration installation
Check the installation status
Upgrades and rollbacks
helm uninstall redis
k8s cluster monitoring
Monitoring plan
Heapster
Weave Scope
Prometheus
Prometheus monitoring k8s
Custom configuration
Create a ConfigMap configuration
Deploy Prometheus
Configure access permissions
Service discovery configuration
System time synchronization
Monitor k8s cluster
Get node container resource usage from kubelet
Exporter monitors resource usage
Network detection for Ingress and Service
Grafana visualization
basic concept
Data Source
Dashboard
Organizations and users
Integrate Grafana
Deploy Grafana
service discovery
Configure the Grafana panel
kube-prometheus
Replace domestic mirror
Modify access entry
Install
Configure Ingress
uninstall
ELK log management
ELK composition
Elasticsearch
Filebeat
Logstash
Kibana
Integrated ELK
Deploy es search service
Deploy logstash data cleaning
Deploy filebeat data collection
Deploy kibana visual interface
Kibana configuration
Kubernetes visual interface
Kubernetes Dashboard
Install
Configure all permission accounts
Dashboard usage
kubesphere
Locally stored dynamic PVC
Install
Enable pluggable components
Rancher
Kuboard
V. Spring Cloud Alibaba microservice DevOps practice
DevOps environment setup
Gitlab
Install GitLab
Page configuration
Configure Secret
Configure webhooks for your project
uninstall
Harbor
Install Harbor
Configure Secret
SonarQube
Install SonarQube
Generate service token
Create a webhook service
Create project
Jenkins
Build jenkins image with maven environment
Install Jenkins
Install plugin
Build Authorization Token Root
Gitlab
SonarQube Scanner
Node and Label parameters
Kubernetes
Config File Provider
Git Parameter
Create gitlab access credentials
Case: SpringBoot project CICD
Configure node labels
Create pipeline project
Webhook build trigger
Pipeline script configuration
Check/create relevant credentials
Harbor mirror warehouse credentials
Gitlab access credentials
kubeconfig file id
SonarQube credentials
Add SonarQube Webhook
Project build
Microservice DevOps in practice
Project build
Project environment
MySQL
Nacos
Redis
MongoDB
Elasticsearch
RocketMQ
Serve
API gateway
User service
Goods and Services
flash sale service
Front-end service
JenkinsCICD
Create pipeline project
Extended Choice Parameter
Kubesphere DevOps
Turn on DevOps
Integrate SonarQube
Update settings.xml
Deployment project
Spring Boot project
project
ks-cicd-demo
Configuration file
harbor-secret
Microservice project
project
ks-shop-dev
ks-shop-flashsale
Configuration file
harbor-secret
DevOps projects
Spring Boot project
assembly line
cicd-demo
Configuration
gitlab-user-pass
harbor-user-pass
kubeconfig-id
Build parameters
branch
version number
Microservice project
assembly line
flashsale-cicd
Configuration
gitlab-user-pass
harbor-user-pass
kubeconfig-id
Build parameters
Serve
frontend-server
shop-parent/api-gateway
shop-parent/shop-uaa
shop-parent/shop-provider/flashsale-server
shop-parent/shop-provider/product-server
Namespaces
snapshots
releases
Number of copies
1
3
5
7
version number
branch