Kubernetes

kubernetes change PVC from ReadWriteOnce to ReadWriteMany

两盒软妹~` 提交于 2021-02-09 10:54:58
问题 Is it possible to change an existing PVC to ReadWriteMany from ReadWriteOnce without recreating it? I have an existing database pod and the file system has become read only for some reason. I wanted to connect another pod to the PVC to look at it. 回答1: You can do so without changing the PVC. The Once in ReadWriteOnce is not about the number of Pods accessing the PVC but about the number of Nodes accessing it. Create another Pod mounting the same PVC and set nodeSelector (use hostname) so it

《Kubernetes权威指南》基本概念

不打扰是莪最后的温柔 提交于 2021-02-09 09:58:03
一 、基本概念 kubernetes 中的 Node 、 Pod 、 Replication Controller 、 Service 等都是一种“资源对象”,基本都可以通过 kubectl 或者通过API编程调用,执行增删改查操作都保存在ETCD中持久化存储 1.1 Master 作用:每个k8s集群都需要一个mater节点来管理,master一般是单独部署 核心组件: Kubernetes API Server(kube-apiserver),提供HTTP REST 接口的关键服务进程,是k8s里所有资源增删改查 等操作的唯一入口 Kubernetes Controller Manager (kube-controller-manager),k8s所有资源的自动化控制中心。 Kubernetes Scheduler(kube-scheduler),调度(POD)的进程。 ETCD,master节点一般还启动一个ETCD Server进程,所有资源对象的数据全部保存在ETCD中 1.2 Node 除了Master,k8s集群的其他节点都称为Node节点,Node节点是k8s集群中的工作负载节点,当某个Node宕机,骑上的工作负载会被master自动转移到其他节点上 核心组件: kubelet:负责Pod对象的容器创建、启停等任务,同时与Master节点密切协作 kube

Can't access minikube service using NodePort from host on Mac

℡╲_俬逩灬. 提交于 2021-02-09 09:00:27
问题 I'm trying to deploy a single web application to Minikube on my Mac, and then access it in the browser. I'm trying to use the simplest of setups, but it's not working, I just get a "connection refused" error and I can't figure out why. This is what I'm trying: $ minikube start --insecure-registry=docker.example.com:5000 😄 minikube v1.12.3 on Darwin 10.14.6 ✨ Using the docker driver based on existing profile 👍 Starting control plane node minikube in cluster minikube 🔄 Restarting existing

Can't access minikube service using NodePort from host on Mac

拥有回忆 提交于 2021-02-09 08:59:29
问题 I'm trying to deploy a single web application to Minikube on my Mac, and then access it in the browser. I'm trying to use the simplest of setups, but it's not working, I just get a "connection refused" error and I can't figure out why. This is what I'm trying: $ minikube start --insecure-registry=docker.example.com:5000 😄 minikube v1.12.3 on Darwin 10.14.6 ✨ Using the docker driver based on existing profile 👍 Starting control plane node minikube in cluster minikube 🔄 Restarting existing

分布式系统发展史

本秂侑毒 提交于 2021-02-09 00:09:24
分布式系统从最早的数据共享需求,发展到现在的 serverless 架构。它伴随着技术的发展与公司实际需求变化而演进。现在的云服务提供商简化了分布式系统开发的复杂性,让应用开发者只需关注开发,而把基础设施管理交给大型的云服务提供商。回顾分布式系统发展的历史,了解容器技术革新的原动力。 分布式系统(确切地说应该是分布式计算机系统)从它诞生到现在已经过去了很长的时间。在很久以前,一台电脑一次只能完成一项特定的任务。如果我们需要同时完成多项任务,则需要多台计算机并行运行。但是,并行运行并不足以构建真正的分布式系统,因为它需要一种机制来在不同计算机或者那些运行在计算机上的程序之间进行通信。这种在多台计算机之间交换 / 共享数据的需求催生了面向消息通信的想法,即两台计算机使用包含了数据的消息来共享数据。文件共享、数据库共享等其他机制当时还没有出现。 接着,我们进入了多任务操作系统和个人电脑的时代。利用 Windows、Unix、Linux 等操作系统,我们可以在同一台计算机上运行多个任务。这使得分布式系统开发人员能够在一台或者几台通过消息传递连接的计算机内构建和运行整个分布式系统。这催生了面向服务的架构(SOA),其中每个分布式系统可以通过一组集成在一台计算机或多台计算机上运行的服务来构建。我们通过 WSDL(用于 SOAP 协议)或 WADL(用于 REST 协议)等语言适当地定义服务接口

Knative 入门系列4:Eventing 介绍

∥☆過路亽.° 提交于 2021-02-08 23:50:23
作者:Brian McClain & Bryan Friedman 译者:韦世滴 审校:孙海洲、邱世达、王刚、周雨青、宋净超 Knative 是一个基于 Kubernetes 的,用于构建、部署和管理现代 serverless 应用的平台。Getting Started with Knative 是一本由 Pivotal 公司赞助 O’Reilly 出品的电子书,公众号后台回复“ knative ”获取英文版下载地址。本书中文版由 ServiceMesher 社区自发翻译系列文章,这是该系列的第4章。 到目前为止,向应用程序发送基本的 HTTP 请求是一种有效使用 Knative 函数的方式。然而,无服务器的松耦合特性同时也适用于事件驱动架构。也就是说,可能在文件上传到 FTP 服务器时我们需要调用一个函数;又或者,在我们进行物品销售时需要调用一个函数来处理支付和库存更新的操作。与其操心我们的应用程序或函数监听上述事件的逻辑,不如当那些被关注的事件发生时,让 Knative 去处理并通知我们。 如果要自己实现这些功能则需要做很多工作并要编写实现特定功能的代码。幸运的是,Knative 提供了一个抽象层使消费事件变得更容易。Knative 直接提供了一个“事件”,而不需要你写特定的代码来选择消息代理。当事件发生时应用程序根本无需关心它来自哪里或发到哪去,就是这么简单。为实现这一目标

Knative 入门系列7:实战演练

ⅰ亾dé卋堺 提交于 2021-02-08 21:57:00
作者:Brian McClain & Bryan Friedman 译者:张晓鹏 审校:孙海洲、邱世达、宋净超 Knative 是一个基于 Kubernetes 的,用于构建、部署和管理现代 serverless 应用的平台。Getting Started with Knative 是一本由 Pivotal 公司赞助 O’Reilly 出品的电子书,公众号后台回复“ knative ”获取英文版下载地址。本书中文版由 ServiceMesher 社区自发翻译系列文章,这是该系列的第7章。 让我们把我们所学的一切运用起来去创造一些东西吧!我们进行一个演练,它利用了您前面所学到的许多知识,并通过使用美国地质勘探局 (USGS) 地震数据源的数据提供了一个服务,以可视化地展示世界各地的地震活动。您可以在 GitHub 存储库 gswk/earthquakedemo 中找到我们将要介绍的代码。 架构 在深入研究代码之前,让我们先看看应用程序的体系架构,如 图7-1 所示。我们在这里构建三个重要的东西:事件源、服务和前端。 图中 Knative 内部的每一个组件都代表着我们将利用目前所学的知识来构建的内容,包括使用 Kaniko 构建模板的服务和用于轮询数据的自定义事件源: USGS 事件源 我们将构建一个自定义的 ContainerSource 事件源,它将在给定的时间间隔轮询 USGS

Update Node Selector field for PODs on the fly

家住魔仙堡 提交于 2021-02-08 21:49:30
问题 I have been trying different things around k8s these days. I am wondering about the field nodeSelector in the POD specification. As I understand we have to assign some labels to the nodes and these labels can further be used in the nodeSelector field part of the POD specification. Assignment of the node to pods based on nodeSelector works fine. But, after I create the pod, now I want to update/overwrite the nodeSelector field which would deploy my pod to new node based on new nodeSelector

EKS : could not find any suitable subnets for creating the ELB

ぐ巨炮叔叔 提交于 2021-02-08 15:23:36
问题 I am trying to expose a service to the outside world using the loadBalancer type service. For that, i have followed this doc https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/ My loadbalancer.yaml looks like this apiVersion: v1 kind: Service metadata: name: nginx-service spec: type: LoadBalancer selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80 But the load balancer is not creating as expected I am getting the following error Warning

EKS : could not find any suitable subnets for creating the ELB

给你一囗甜甜゛ 提交于 2021-02-08 15:23:05
问题 I am trying to expose a service to the outside world using the loadBalancer type service. For that, i have followed this doc https://aws.amazon.com/premiumsupport/knowledge-center/eks-kubernetes-services-cluster/ My loadbalancer.yaml looks like this apiVersion: v1 kind: Service metadata: name: nginx-service spec: type: LoadBalancer selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80 But the load balancer is not creating as expected I am getting the following error Warning