Kubernetes

Ingress or Service with type: LoadBalancer

北慕城南 提交于 2021-02-10 14:42:39
问题 Kubernetes has both Ingress (in front of a Service) and Service with type: LoadBalancer. These seem to do identical things: allow public traffic into the pods matching the service's selector. What are the benefits and drawbacks of each? In what scenarios would I choose one over the other? 回答1: Assume that AWS, GCP or Azure is where your infrastructure located Ingress: Only work if you have ingress controller such as nginx-ingress-controller, traefik,... Many services could share the same

Kubernetes pod cannot mount iSCSI volume: failed to get any path for iscsi disk

梦想的初衷 提交于 2021-02-10 14:42:16
问题 I would like to add an iSCSI volume to a pod as in this this example. I have already prepared an iSCSI target on a Debian server and installed open-iscsi on all my worker nodes. I have also confirmed that I can mount the iSCSI target on a worker node with command line tools (i.e. still outside Kubernetes). This works fine. For simplicity, there is no authentication (CHAP) in play yet, and there is already a ext4 file system present on the target. I would now like for Kubernetes 1.14 to mount

Ingress or Service with type: LoadBalancer

吃可爱长大的小学妹 提交于 2021-02-10 14:41:09
问题 Kubernetes has both Ingress (in front of a Service) and Service with type: LoadBalancer. These seem to do identical things: allow public traffic into the pods matching the service's selector. What are the benefits and drawbacks of each? In what scenarios would I choose one over the other? 回答1: Assume that AWS, GCP or Azure is where your infrastructure located Ingress: Only work if you have ingress controller such as nginx-ingress-controller, traefik,... Many services could share the same

Share local directory with Kind Kubernetes Cluster using hostpath

爱⌒轻易说出口 提交于 2021-02-10 14:32:18
问题 I want to share my non-empty local directory with kind cluster. Based on answer here: How to reference a local volume in Kind (kubernetes in docker) I tried few variations of the following: Kind Cluster yaml: kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane extraMounts: - hostPath: /Users/xyz/documents/k8_automation/data/manual/ containerPath: /host_manual extraPortMappings: - containerPort: 30000 hostPort: 10000 Pod yaml: apiVersion: v1 kind: Pod metadata: name:

Share local directory with Kind Kubernetes Cluster using hostpath

前提是你 提交于 2021-02-10 14:31:46
问题 I want to share my non-empty local directory with kind cluster. Based on answer here: How to reference a local volume in Kind (kubernetes in docker) I tried few variations of the following: Kind Cluster yaml: kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane extraMounts: - hostPath: /Users/xyz/documents/k8_automation/data/manual/ containerPath: /host_manual extraPortMappings: - containerPort: 30000 hostPort: 10000 Pod yaml: apiVersion: v1 kind: Pod metadata: name:

How to disable cross communicate between pods which are in 2 different namespaces in kubernetes

余生长醉 提交于 2021-02-10 14:23:30
问题 I have 2 namespaces and 1 pod, 1 service running in each. Example Namespace 1: default Pod: pod1 Service: pod1service Namespace 2: test Pod: pod1 Service: pod1service I can actually make HTTP request from namespace2 pod to namespace1 pod. curl -H "Content-Type: application/json" -X GET http://pod1service.default.svc.cluster.local/some/api How do i disable communication between 2 differet namespaces? 回答1: You need to configure network policies. For that to work you also need to use a network

expose private kubernetes cluster with NodePort type service

心不动则不痛 提交于 2021-02-10 14:19:58
问题 I have created a VPC-native cluster on GKE, master authorized networks disabled on it. I think I did all things correctly but I still can't access to the app externally. Below is my service manifest. apiVersion: v1 kind: Service metadata: annotations: kompose.cmd: kompose convert kompose.version: 1.16.0 (0c01309) creationTimestamp: null labels: io.kompose.service: app name: app spec: ports: - name: '3000' port: 80 targetPort: 3000 protocol: TCP nodePort: 30382 selector: io.kompose.service:

Issue using in-cluster kubernetes configuration with client-go library on google cloud build

扶醉桌前 提交于 2021-02-10 12:23:08
问题 I'm having a bit of a challenge try to build my app which is using the golang client-go library. What the app does is provide and api which then deploys a pod to a kubernetes cluster. Now the app is able to deploy a pod successfully if I use an out of cluster kubernetes(i.e minikube) config which is found in $HOME/.kube/config. See code below that determines which config to use depending on the config path; package kubernetesinterface import ( "log" "os" core "k8s.io/api/core/v1" v1 "k8s.io

降本增效利器!趣头条Spark Remote Shuffle Service最佳实践

自古美人都是妖i 提交于 2021-02-10 11:43:54
作者简介 王振华,趣头条大数据总监,趣头条大数据负责人 曹佳清,趣头条大数据离线团队高级研发工程师,曾就职于饿了么大数据INF团队负责存储层和计算层组件研发,目前负责趣头条大数据计算层组件Spark的建设 范振,花名辰繁,阿里云计算平台EMR高级技术专家,目前主要关注开源大数据技术以及云原生技术 业务场景与现状 趣头条是一家依赖大数据的科技公司,在2018-2019年经历了业务的高速发展,主App和其他创新App的日活增加了10倍以上,相应的大数据系统也从最初的100台机器增加到了1000台以上规模。多个业务线依赖于大数据平台展开业务,大数据系统的高效和稳定成了公司业务发展的基石,在大数据的架构上我们使用了业界成熟的方案,存储构建在HDFS上、计算资源调度依赖Yarn、表元数据使用Hive管理、用Spark进行计算,具体如图1所示: 图1 趣头条离线大数据平台架构图 其中Yarn集群使用了单一大集群的方案,HDFS使用了联邦的方案,同时基于成本因素,HDFS和Yarn服务在ECS上进行了DataNode和NodeManager的混部。 在趣头条每天有6W+的Spark任务跑在Yarn集群上,每天新增的Spark任务稳定在100左右,公司的迅速发展要求需求快速实现,积累了很多治理欠债,种种问题表现出来集群稳定性需要提升,其中Shuffle的稳定性越来越成为集群的桎梏,亟需解决。

01-Kubernetes背景介绍

痴心易碎 提交于 2021-02-10 11:36:13
什么是Kubernetes? Kubernetes产生的背景 Kubernetes的发展历程和应用现状 什么是Kubernetes? 生产级别的 容器 编排 系统 自动化的容器部署、扩展和管理 Kubernetes是用于自动部署,扩展和管理容器化应用程序的开源系统 借鉴Google内部的群集管理系统“Borg”(2014 EuroSys)和“Omega”(15年的生产环境应用经验) Google于2014年开源,捐献给云原生计算基金会(CNCF,Cloud Native Computing Foundation) Kubernetes意思 希腊语 驾驶员(Pivlot)或舵手(Helmsman) 一般简称k8s(K ubernete s) Kubernetes产生背景 我认为是两方面的流行 微服务 容器 容器 什么是容器? 一系列隔离运行的进程,提供了一种轻量操作系统层面的虚拟化技术 每个容器拥有自己的PID,Uscr,UTS,Network栈命名空间等 与传统VM比具有启动块、性能损耗小,更轻量等优点 Docker是目前使用最广,最成熟的容器技术 K8s默认使用Docker引擎 也可使用Rkt(CoreOS),或其他遵循CRI(continer runtime interface)的容器引擎,例如Containerd等 容器化系统面临的挑战 容器解决了应用打包、部署、运行的问题