《Finding balance between work and play》
k8s中pod、Role、config这些都是 resources
什么场景使用? ensures that all (or some) Nodes run a copy of a Pod.
- running a cluster storage daemon on every node
- running a logs collection daemon on every node
- running a node monitoring daemon on every node
used to store non-confidential data in key-value pairs
- non-confidential
- key-value pairs
- how to use
- Inside a container command and args
- Environment variables for a container
- Add a file in read-only volume, for the application to read
- Write code to run inside the Pod that uses the Kubernetes API to read a ConfigMap
使用ConfigMap避免硬编码。可以认为主要解决配置的问题,比如不同环境的数据库地址。ConfigMap不是用来储存大量的数据(小于1MB)。
怎么直接使用yaml文件+配置文件,all in one的方式
注意事项
Deploy and update secrets and application configuration without rebuilding your image and without exposing secrets in your stack configuration.
Secrets let you store and manage sensitive information, such as passwords, OAuth tokens, and ssh keys.
Event is a report of an event somewhere in the cluster.
- involvedObject <Object> -required- The object that this event is about.
- metadata <Object> -required- Standard object’s metadata.
a Service is an abstraction which defines a logical set of Pods
DNS ingress mesh istio
desired state: controller making the current state come closer to desired state
- 优缺点,如何使用,跨集群如何使用
- k8s的架构非常灵活,基本可以在任何地方通过和API交互做很多control的工作
本身还是挂的pod,pod和container都一样都是1对多。这种特性下,调度需要什么特殊处理?
Scheduler Watches新建未被分配到Node上的pod。 k8s的scheduler 本身也是一个controller,基本方式都一样,watch pod创建,然后binding到Node
- kube-scheduler is default scheduler
- Filtering
- Scoring
include individual and collective resource requirements, hardware / software / policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, and so on.
- 两种方法可以配置调度器的过滤和打分
- Scheduling Policies configure Predicates for filtering and Priorities for scoring.
- Scheduling Profiles configure Plugins:QueueSort, Filter, Score, Bind, Reserve, Permit, and others
a pluggable architecture for Kubernetes Scheduler that makes scheduler customizations easy. 怎么编译、部署? 单独部署还是和原有调度器一起部署
- kubelet
- runtime
- kube-proxy
- assigning a CIDR block to the node
- keeping the node controller’s internal list of nodes up to date
- monitoring the nodes’ health
容量使用
- 包括 kubelet管理的所有pod
- 不包括直接启动的容器和其他程序的占用
CR是Kubernetes API的扩展. operator也是一种CRD
内置的pods,configmap等都是resource。通过API可以操作这些资源对象
现在很多资源对象都是以这种模块化的方式,安装到集群的。
custom resources let you store and retrieve structured data. When you combine a custom resource with a custom controller, custom resources provide a true declarative API.
- running
- restclient.Config
- kubeClient
- InformerFactory(kubeClient, 30s)
- exampleClient 自定义资源的client
- InformerFactory(exampleClient, 30s)
- NewController
- InformerFactory.Start(stopCh)
- controller.RUN
- 不同语言的client
- 通过和API交互对资源对象操作
- status
- events
- conditions
如何跟踪不同的状态
k8s klog
- -v=NUM 的方式设置log level
- -v=4, 展示0-4级别的 -v=X where X is the desired maximum level to log.
- klog level
- ENTRYPOINT
- CMD
- Shell form
- Exec form
https://github.com/kubernetes/community/tree/master/contributors/guide#getting-started
GitHub’s tracker is called Issumes.
- Milestones
- Labels
- Assignees
Orchestration is a broad term that refers to container scheduling, cluster management, and possibly the provisioning of additional hosts.
One of the biggest responsibilities of schedulers is host selection
pod等资源的java对象
vpc Deserialization event
structure
chess
scheduling resource
liveness/readiness/startup probes
A Kubernetes Enhancement Proposal (KEP) is a way to propose, communicate and coordinate on new efforts for the Kubernetes project. You can read the full details of the project in KEP-0000.
imperative/declarative
scaling up/down/out/in
Caas Container as a Service
Storage Capacity Tracking reaches GA in Kubernetes 1.24 Problems we have solved Problems we have not solved
This KEP aims to add a .spec.schedulingGates
field to Pod’s API, to mark a Pod’s schedule readiness. Integrators can mutate this field to signal to scheduler when a Pod is ready for scheduling.
PodGC
kata
kata containers Architecture
kata containers
scheduling. assigning Pods to Nodes
aggregation layer sample-apiserver
KEP:Kubernetes Enhancement Proposals
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
linux-interfaces-for-virtual-networking
what-is-infrastructure-as-code
what-is-infrastructure-as-code
used to model the probability of a certain class or event existing such as pass/fail, win/lose, alive/dead or healthy/sick.
#red #orange #yellow #warm colorhunt
#turquoise#yellow#red colorhunt
python3-libs python3-pip python3-setuptools python3 pypi-python package index
module
Multi-threading links
locks, events, condition variables, and semaphores
也支持Weak References
import weakref, gc
一些其他的集合类