 Go Programming Pattern in Kubernetes PhilosophyGo Programming Pattern in Kubernetes Philosophy Harry Zhang @resouer Contents • What I will talk? • Kubernetes basic in 1 min • For Kubernetes developers: • The Golang programming patterns of popular open source projects in this world • Written by, and heavily depends on Golang Again: Why Go? • All about community • A sad story: • https://github.com/google/lmctfy • Now think about a of all Asta Xie instances $ kubectl get astaxie NAME KIND astaxie1 AstaXie.v1.cr.client-go.k8s.io My AstaXie Object & Controller etcd kube-apiserver types register AstaXie Controller0 码力 | 29 页 | 2.12 MB | 1 年前3 Go Programming Pattern in Kubernetes PhilosophyGo Programming Pattern in Kubernetes Philosophy Harry Zhang @resouer Contents • What I will talk? • Kubernetes basic in 1 min • For Kubernetes developers: • The Golang programming patterns of popular open source projects in this world • Written by, and heavily depends on Golang Again: Why Go? • All about community • A sad story: • https://github.com/google/lmctfy • Now think about a of all Asta Xie instances $ kubectl get astaxie NAME KIND astaxie1 AstaXie.v1.cr.client-go.k8s.io My AstaXie Object & Controller etcd kube-apiserver types register AstaXie Controller0 码力 | 29 页 | 2.12 MB | 1 年前3
 Operator Pattern 用 Go 扩展 Kubernetes 的最佳实践Operator Pattern:用 Go 扩展 K8s 的最佳实践 吴学强 ApeCloud KubeBlocks Maintainer & 研发总监 目 录 认识我们 00 什么是 Operator 01 Operator 基础模型 02 Operator 最佳实践 03 我们是谁 云猿生(ApeCloud)是一家提供数据库内核与管理平台的基 础软件开发商. KubeBlocks 熟悉如何生成二级资源(Managed Resource) 6. 熟悉如何写 UT 7. 熟悉如何制作 Helm Chart 课后思考题: 1. 如何不启动 WebHook? 2. API 只要用 Go 写就可以了吗,需要修改对应的 YAML 文件吗? 3. Setup 阶段,用 Watch 函数取代 Owns 并实现同样的目的。 4. Reconcile 函数为什么不区分 Create、Update0 码力 | 21 页 | 3.06 MB | 9 月前3 Operator Pattern 用 Go 扩展 Kubernetes 的最佳实践Operator Pattern:用 Go 扩展 K8s 的最佳实践 吴学强 ApeCloud KubeBlocks Maintainer & 研发总监 目 录 认识我们 00 什么是 Operator 01 Operator 基础模型 02 Operator 最佳实践 03 我们是谁 云猿生(ApeCloud)是一家提供数据库内核与管理平台的基 础软件开发商. KubeBlocks 熟悉如何生成二级资源(Managed Resource) 6. 熟悉如何写 UT 7. 熟悉如何制作 Helm Chart 课后思考题: 1. 如何不启动 WebHook? 2. API 只要用 Go 写就可以了吗,需要修改对应的 YAML 文件吗? 3. Setup 阶段,用 Watch 函数取代 Owns 并实现同样的目的。 4. Reconcile 函数为什么不区分 Create、Update0 码力 | 21 页 | 3.06 MB | 9 月前3
 石墨文档Go在K8S上微服务的实践-彭友顺石墨文档GO在K8S上微服务的实践 彭友顺 石墨文档 基础设施负责人 目 录 1 架构演进 01 2 微服务的生命周期 02 3 如何管理好微服务 03 架构演进 第一部分 架构演进 单体应用时期 垂直应用时期 微服务时期 快速、简单 耦合强 隔离、稳定 复制多 隔离、稳定 复用高 架构演进 组件增多 架构复杂 维护困难 架构演进 传统模式 K8S模式 format、lint、breaking 检查。 CI build 阶段 • 会基于 pb 的注释自动产生文档,并推送至内部的微服务管理系统接口平台中 • 会生成 Go/PHP/Node/Java 桩代码和错误码,推送到指定的仓库 开发阶段 • go get 客户端、服务端的gRPC和错误码的代码 配置 对接 Debug • 配置驱动 • 配置补齐 • 配置工具 • Proto的管理 • 配置补齐 • 配置工具 • Proto的管理 • 错误码管理 • 调试gRPC • 调试信息 • 错误定位 Generate • protoc -I {error proto file} --go-errors_out={output directory} • 实现我们自定义的error类型,方便断言。 • 根据注解的code信息,在错误码中生成对应的grpc status code •0 码力 | 41 页 | 3.20 MB | 1 年前3 石墨文档Go在K8S上微服务的实践-彭友顺石墨文档GO在K8S上微服务的实践 彭友顺 石墨文档 基础设施负责人 目 录 1 架构演进 01 2 微服务的生命周期 02 3 如何管理好微服务 03 架构演进 第一部分 架构演进 单体应用时期 垂直应用时期 微服务时期 快速、简单 耦合强 隔离、稳定 复制多 隔离、稳定 复用高 架构演进 组件增多 架构复杂 维护困难 架构演进 传统模式 K8S模式 format、lint、breaking 检查。 CI build 阶段 • 会基于 pb 的注释自动产生文档,并推送至内部的微服务管理系统接口平台中 • 会生成 Go/PHP/Node/Java 桩代码和错误码,推送到指定的仓库 开发阶段 • go get 客户端、服务端的gRPC和错误码的代码 配置 对接 Debug • 配置驱动 • 配置补齐 • 配置工具 • Proto的管理 • 配置补齐 • 配置工具 • Proto的管理 • 错误码管理 • 调试gRPC • 调试信息 • 错误定位 Generate • protoc -I {error proto file} --go-errors_out={output directory} • 实现我们自定义的error类型,方便断言。 • 根据注解的code信息,在错误码中生成对应的grpc status code •0 码力 | 41 页 | 3.20 MB | 1 年前3
 Putting an Invisible Shield on Kubernetes SecretsKMS Plugin [1] • Address performance & latency concerns • Reduce / minimize remote KMS interactions w/o compromising security • Address security threats • etcd compromise • Host (KMS plugin) compromise compromise Ø leak DEKs Ø leak KEKs [1] KubeCon NA 2019: "TEE-based KMS Plugin for encryption of Kubernetes Secrets”, by Raghu Yeluri & Haidong Xia, Intel Corp. TEE-based KMS Provider • Address security Experience @ Ant Group KMS Plugin • Workflow • Encryption • Decryption • Engineering decisions • apiserver is responsible for • DEK generation • Secret en/decryption • kms-plugin • keeps KEK cache • only0 码力 | 33 页 | 20.81 MB | 1 年前3 Putting an Invisible Shield on Kubernetes SecretsKMS Plugin [1] • Address performance & latency concerns • Reduce / minimize remote KMS interactions w/o compromising security • Address security threats • etcd compromise • Host (KMS plugin) compromise compromise Ø leak DEKs Ø leak KEKs [1] KubeCon NA 2019: "TEE-based KMS Plugin for encryption of Kubernetes Secrets”, by Raghu Yeluri & Haidong Xia, Intel Corp. TEE-based KMS Provider • Address security Experience @ Ant Group KMS Plugin • Workflow • Encryption • Decryption • Engineering decisions • apiserver is responsible for • DEK generation • Secret en/decryption • kms-plugin • keeps KEK cache • only0 码力 | 33 页 | 20.81 MB | 1 年前3
 k8s操作手册 2.3要求docker<=20.10 k8s 1.24及之后版本: kubelet→cri-containerd→containerd→runC 后来cri-containerd重构进containerd中(CRI Plugin),合为一个containerd进程 默认调用的cri-socket: unix:///var/run/containerd/containerd.sock 本小节讲解k8s v1 sandbox_image = "cof-lee.com:5443/k8s/pause:3.9" #和k8s需要的pause镜 像版本保持一致 #如果要启用CRI-Plugin,注释掉其中的 disabled_plugins = ["cri"] #再重启containerd即可有 unix:///run/containerd/containerd.sock 接口 #信 /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ②安装k8s二进制组件 #使用aliyun的源(如果用的是RHEL8系列的系统,也是用的el7的仓库源,因为 k8s组件是用go语言写的,直接二进制文件就可用,不需要特殊的库依赖,于是 和系统弱相关,8或9系列的系统也直接可用这些rpm软件) # cat >> /etc/yum.repos.d/k8s-ali.repo <0 码力 | 126 页 | 4.33 MB | 1 年前3 k8s操作手册 2.3要求docker<=20.10 k8s 1.24及之后版本: kubelet→cri-containerd→containerd→runC 后来cri-containerd重构进containerd中(CRI Plugin),合为一个containerd进程 默认调用的cri-socket: unix:///var/run/containerd/containerd.sock 本小节讲解k8s v1 sandbox_image = "cof-lee.com:5443/k8s/pause:3.9" #和k8s需要的pause镜 像版本保持一致 #如果要启用CRI-Plugin,注释掉其中的 disabled_plugins = ["cri"] #再重启containerd即可有 unix:///run/containerd/containerd.sock 接口 #信 /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ②安装k8s二进制组件 #使用aliyun的源(如果用的是RHEL8系列的系统,也是用的el7的仓库源,因为 k8s组件是用go语言写的,直接二进制文件就可用,不需要特殊的库依赖,于是 和系统弱相关,8或9系列的系统也直接可用这些rpm软件) # cat >> /etc/yum.repos.d/k8s-ali.repo <0 码力 | 126 页 | 4.33 MB | 1 年前3 QCon北京2018/QCon北京2018-《Kubernetes-+面向未来的开发和部署》-Michael+ChenPhysical Infrastructure Containers VMware Hypervisor VMs Docker Containers User Cases 9 •Ready-to-go development •Self-service portal Developer Sandbox • New application development • 12-factor apps vSphere NSX Manager NSX Controllers T1 NSX Edge Cluster Architecture NSX-T • NSX Container Plugin: NCP is a software component provided by VMware in form of a container image, runs in K8s as a standardized interface to the NSX API Network Container Plugin (NCP) NSX Manager Kubernetes Master etcd API-Server Scheduler NSX Container Plugin (NCP) NSX Infra NSX Manager API Client Kubernetes0 码力 | 42 页 | 10.97 MB | 1 年前3 QCon北京2018/QCon北京2018-《Kubernetes-+面向未来的开发和部署》-Michael+ChenPhysical Infrastructure Containers VMware Hypervisor VMs Docker Containers User Cases 9 •Ready-to-go development •Self-service portal Developer Sandbox • New application development • 12-factor apps vSphere NSX Manager NSX Controllers T1 NSX Edge Cluster Architecture NSX-T • NSX Container Plugin: NCP is a software component provided by VMware in form of a container image, runs in K8s as a standardized interface to the NSX API Network Container Plugin (NCP) NSX Manager Kubernetes Master etcd API-Server Scheduler NSX Container Plugin (NCP) NSX Infra NSX Manager API Client Kubernetes0 码力 | 42 页 | 10.97 MB | 1 年前3 秘钥管理秘钥Turtles all the way down - Securely managing Kubernetes SecretsEncryptionConfig uses aescbc with a KMS provider ● Sidecar pod for the KMS plugin Master kube-apiserver etcd kms-plugin SECRETDEK DEKKEK KEK Terminology and Notation DEK Data encryption key KEK kube-apiserver etcd kms-plugin SECRET KMS 1.10 Kube-ApiServer Generates a DEK Master kube-apiserver etcd kms-plugin SECRET KMS 1.10 Kube-ApiServer Sends DEK to Plugin Master kube-apiserver kube-apiserver etcd kms-plugin Encrypt(DEK) SECRET KMS 1.10 Plugin Forwards to KMS Master kube-apiserver etcd kms-plugin Encrypt(DEK) SECRET Encrypt(DEK) KMS 1.10 KMS Encrypts a DEK Master kube-apiserver0 码力 | 52 页 | 2.84 MB | 1 年前3 秘钥管理秘钥Turtles all the way down - Securely managing Kubernetes SecretsEncryptionConfig uses aescbc with a KMS provider ● Sidecar pod for the KMS plugin Master kube-apiserver etcd kms-plugin SECRETDEK DEKKEK KEK Terminology and Notation DEK Data encryption key KEK kube-apiserver etcd kms-plugin SECRET KMS 1.10 Kube-ApiServer Generates a DEK Master kube-apiserver etcd kms-plugin SECRET KMS 1.10 Kube-ApiServer Sends DEK to Plugin Master kube-apiserver kube-apiserver etcd kms-plugin Encrypt(DEK) SECRET KMS 1.10 Plugin Forwards to KMS Master kube-apiserver etcd kms-plugin Encrypt(DEK) SECRET Encrypt(DEK) KMS 1.10 KMS Encrypts a DEK Master kube-apiserver0 码力 | 52 页 | 2.84 MB | 1 年前3 Jib Kubecon 2018 Talkcom/GoogleContainerTools/jib ... Jib Kubecon 2018 Talkcom/GoogleContainerTools/jib ...- <plugin> - com.spotify - dockerfile-maven-plugin - 1.4.8 - io/petclinic-app plugin>- ${project.version} 0 码力 | 90 页 | 2.84 MB | 1 年前3 Amazon Elastic Kubernetes Service (EKS) 初探秘EKS private endpoints - New Amazon EKS Regions: Sao Paulo, Canada Central - Next-generation CNI plugin © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential © All rights reserved. Amazon Confidential 开源与 Amazon EKS Amazon EKS 的主要模块已经开源 • Amazon VPC CNI plugin • AWS IAM authenticator • Amazon EKS AMI AWS团队贡献或管理着超过20个与Kubernetes相关的开源项目 • /kubernetes • 简单安全 GitHub开源 … { } Amazon VPC CNI Plugin 支持 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Amazon VPC CNI plugin Elastic network interface Secondary0 码力 | 39 页 | 1.83 MB | 1 年前3 Amazon Elastic Kubernetes Service (EKS) 初探秘EKS private endpoints - New Amazon EKS Regions: Sao Paulo, Canada Central - Next-generation CNI plugin © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential © All rights reserved. Amazon Confidential 开源与 Amazon EKS Amazon EKS 的主要模块已经开源 • Amazon VPC CNI plugin • AWS IAM authenticator • Amazon EKS AMI AWS团队贡献或管理着超过20个与Kubernetes相关的开源项目 • /kubernetes • 简单安全 GitHub开源 … { } Amazon VPC CNI Plugin 支持 © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential Amazon VPC CNI plugin Elastic network interface Secondary0 码力 | 39 页 | 1.83 MB | 1 年前3 在大规模Kubernetes集群上实现高SLO的方法Deamonset Node should be tainted when critical Daemonset is unhealthy. Case 4: Plugin registry Registration of plugin such as CSI plugin should be checked. Case 5: Capacity The QPS Limit and Capacity Limit should0 码力 | 11 页 | 4.01 MB | 1 年前3 在大规模Kubernetes集群上实现高SLO的方法Deamonset Node should be tainted when critical Daemonset is unhealthy. Case 4: Plugin registry Registration of plugin such as CSI plugin should be checked. Case 5: Capacity The QPS Limit and Capacity Limit should0 码力 | 11 页 | 4.01 MB | 1 年前3
共 32 条
- 1
- 2
- 3
- 4














