cloud
重新思考云原生时代的开发环境——从 Dev-to-Cloud 到 Dev@Cloud
· ☕ 7 åˆ†é’Ÿ
大背景 滾滾長江東逝水,浪花淘盡英雄。 作为一个一直在底层苦苦挣扎多年程序员,保持一分学习的好奇心,对技术时势的感知,由为重要。因为这最终决定了

记一次 Istio 冲刺调优
· ☕ 5 åˆ†é’Ÿ
为何要调优 如果说,引入一个技术需要兴趣和冲劲,那么,让这个技术上线需要的是坚持和执着。 Cloud Native 如是, Istio 如是。 在上线前的性能测试中,Istio 的使

K8s Custom Resources(CR)
· ☕ 2 åˆ†é’Ÿ
Custom Resource 的入口 请求是这样分发到 api 扩展点的: 例如我们有 (Custom Resource)CR 1 2 3 4 5 6 7 8 apiVersion:cnat.programming-kubernetes.info/v1alpha1kind:Atmetadata:name:example-atspec:schedule:"2019-07-03T02:00:00Z"status:phase:"pending" 相应的 CustomResourceDefinition (CRD) 会是这样: 1 2 3 4 5 6 7 8 9

K8s API 核心对象 —— client-go
· ☕ 3 åˆ†é’Ÿ
API 入口 Client Sets 接收变更通知和缓存(Informers and Caching) Client Sets可以 watch 变更,但一般我们用更高级的 Informers,因为它有缓存

Helm base
· ☕ 1 åˆ†é’Ÿ
Concept umbrella chart you can also create a chart with dependencies to other charts (a.k.a. umbrella chart) which are completely external using the requirements.yaml file. versioning Simple 1-1 versioning Chart versus application versioning 参考 https://codefresh.io/docs/docs/new-helm/helm-best-practices/

Kubernetes extends concept
· ☕ 3 åˆ†é’Ÿ
前言 最近由于工作需要,重新系统回顾 Kubernetes 的编程。发现《Programming Kubernetes》这书写得比较系统。于是边学,边记录一些重点。 Controller

Kubernetes 自动扩缩容
· ☕ 1 åˆ†é’Ÿ
本文状态:草稿 配置例子 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 apiVersion:autoscaling/v2beta2kind:HorizontalPodAutoscalermetadata:name:php-apachespec:scaleTargetRef:apiVersion:apps/v1kind:Deploymentname:php-apacheminReplicas:1maxReplicas:10metrics:- type:Resourceresource:name:cputarget:type:UtilizationaverageUtilization:50 算法 desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )] currentMetricValue 为相关 pod 的 metric 平均数。 If multiple metrics are specified in a HorizontalPodAutoscaler, this calculation is done for each metric, and then

Istio Canary(金丝雀) 上线
· ☕ 1 åˆ†é’Ÿ
按比例分配分配新旧版本流量 VirtualService: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 apiVersion:networking.istio.io/v1alpha3kind:VirtualServicemetadata:name:reviewsspec:hosts:- reviewshttp:- route:- destination:host:reviewssubset:v1weight:75- destination:host:reviewssubset:v2weight:25 DestinationRule : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 apiVersion:networking.istio.io/v1alpha3kind:DestinationRulemetadata:name:bookinfo-ratingsspec:host:reviewstrafficPolicy:loadBalancer:simple:LEAST_CONNsubsets:- name:v1labels:version:v1trafficPolicy:loadBalancer:simple:ROUND_ROBIN- name:v2labels:version:v2trafficPolicy:loadBalancer:simple:ROUND_ROBIN 根据请求源 pod 的

· ☕ 1 åˆ†é’Ÿ
Base cgroup files tasks: list of tasks (by PID) attached to that cgroup. This list is not guaranteed to be sorted. Writing a thread ID into this file moves the thread into this cgroup. cgroup.procs: list of thread group IDs in the cgroup. This list is not guaranteed to be sorted or free of duplicate TGIDs, and userspace should sort/uniquify the list if this property is required.

· ☕ 4 åˆ†é’Ÿ
What are cpusets ? Cpusets provide a mechanism for assigning a set of CPUs and Memory Nodes to a set of tasks. In this document “Memory Node” refers to an on-line node that contains memory. Cpusets constrain the CPU and Memory placement of tasks to only the resources within a task’s current cpuset. They form