Minikube

Kubernetes unknown field “behavior”

情到浓时终转凉″ 提交于 2020-05-17 06:41:27
问题 I'm creating a HorizontalPodAutoscaler in Kubernetes and I need to configure the downscale stabilization window to be smaller than the default. The code used and error are below: apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: busy-autoscaler spec: behavior: scaleDown: stabilizationWindowSeconds: 10 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: busy-worker minReplicas: 1 maxReplicas: 2 metrics: - type: Resource resource: name: cpu target: type:

On Windows Setup, how can I get docker image from local machine

自古美人都是妖i 提交于 2020-05-08 09:47:19
问题 I could understand, different ways to access docker image from local machine to Minikube VM. (Kubernetes + Minikube) can't get docker image from local registry All these examples are for Mac/Linux user. I'm looking for an equivalent suggestion for Windows user. What's windows equivalent to -> eval $(minikube docker-env) 回答1: I found relatively easy way to point docker client(docker-machine) to minikube’s docker environment by running below commands in PowerShell -> PS C:\Users\ABC> minikube

spring-cloud-kubernetes与k8s的configmap

ぃ、小莉子 提交于 2020-05-07 13:58:53
本文是《spring-cloud-kubernetes实战系列》的第六篇,主要内容是在kubernetes上部署一个java web应用,该应用使用了spring-cloud-kubernetes框架,可以使用kubernetes的configmap; 系列文章列表 《spring-cloud-kubernetes官方demo运行实战》 《你好spring-cloud-kubernetes》 《spring-cloud-kubernetes背后的三个关键知识点》 《spring-cloud-kubernetes的服务发现和轮询实战(含熔断)》 《spring-cloud-kubernetes与SpringCloud Gateway》 《spring-cloud-kubernetes与k8s的configmap》 《spring-cloud-kubernetes自动同步k8s的configmap更新》 关于SpringCloud Config 如果您开发过SpringCloud应用,相信您对SpringCloud Config不会陌生,在微服务环境中,业务应用可以从config server获取所需的配置信息,如下图所示: 关于kubernetes的configmap 这是kubernetes提供的基本服务之一,创建一个configmap资源,对应着一份配置文件

使用minikube在windows构建kubernetes群集

巧了我就是萌 提交于 2020-05-06 03:14:24
只建议在开发环境中使用,不建议在windows下使用docker或者kubernetes。 1. 安装VirtualBox或者Hyper-v(安装步骤略) 2. 下载kubectl和minikube工具 (1)下图显示了kubectl,Hypervisor,minikube和windows之间的关系。 (2)在C盘创建k8s文件夹,如下所示: (3)设置环境变量 (4)下载minikube for windows https://github.com/kubernetes/minikube/releases/download/v0.26.1/minikube-windows-amd64 ,然后把它复制到c:\k8s文件夹,并把名字改变成为minikube.exe. (5)下载kubectl for windows https://storage.googleapis.com/kubernetes-release/release/v1.10.2/bin/windows/amd64/kubectl.exe ,然后把它复制到c:\k8s文件夹。 (6)看到应该如下所示 3. 运行 (1)打开Command Prompt然后输入minikube start,显示如下: (2)minikube下载Linux VM镜像和在Linux VM上搭建kubernetes

Kubernetes的十大使用技巧

|▌冷眼眸甩不掉的悲伤 提交于 2020-05-04 08:47:33
1. bash针对kubectl命令的自动补充 这可能是在使用Kubernetes过程中最容易做的事,但它也是其中一个最有用的。要添加自动补充功能,如果使用bash,只需执行以下命令: echo "source <(kubectl completion bash)" >> ~/.bashrc 它将添加自动补全命令到你的.bashrc文件。因此每个你打开的shell窗口都支持该功能。我发现自动补全对一些长的参数,比如--all-namespaces特别有用。 2. 给每个namespace添加默认的内存和CPU限额 是人就会犯错。我们假定某人写了个应用,他每秒就会打开一个数据库连接,但是不会关闭。这样集群中就有了一个内存泄漏的应用。假定我们把该应用部署到了没有限额设置的集群,那么该应用就会crash掉一个节点。 为了避免这种情况,Kubernetes允许为每个namespace设置默认的限额。要做到这很简单,我们只需创建一个limit range 的 yaml 并应用到特定namespace。以下是一个例子: apiVersion: v1 kind: LimitRange metadata: name: mem-limit- range spec: limits: - default: memory: 512Mi defaultRequest: memory: 256Mi type:

During local development with Kubernetes/minikube, how should I connect to postgres database running on localhost?

前提是你 提交于 2020-04-29 11:52:43
问题 I've set up an application stack running on Google Kubernetes Engine + Google Cloud SQL. When developing locally, I would like my application to connect to a postgres database server running outside the cluster to simulate the production environment. It seems that the way to do this is by defining an external endpoint as described here: Minikube expose MySQL running on localhost as service Unfortunately, I am not able to specify "127.0.0.1" as the Endpoint IP address: kubectl apply -f

Kubernetes share a directory from your local system to kubernetes container

99封情书 提交于 2020-04-29 09:36:11
问题 Is there any way to share the directory/files to kubernetes container from your local system? I have a deployment yaml file. I want to share the directory without using kubectl cp . I tried with configmap but I later came to know that configmap can not have the whole directory but only a single file. If anyone has any idea please share. Please note: I do not want to host the file into minikube but I want to push the directory directly to container 回答1: I found a way. We can specify the

Kubernetes share a directory from your local system to kubernetes container

岁酱吖の 提交于 2020-04-29 09:35:10
问题 Is there any way to share the directory/files to kubernetes container from your local system? I have a deployment yaml file. I want to share the directory without using kubectl cp . I tried with configmap but I later came to know that configmap can not have the whole directory but only a single file. If anyone has any idea please share. Please note: I do not want to host the file into minikube but I want to push the directory directly to container 回答1: I found a way. We can specify the

mac+docker+jenkins+gitlab+k8s+springboot从0搭建cicd

点点圈 提交于 2020-04-25 01:38:46
本文采用brew安装的jenkins;docker利用镜像安装的gitlab;利用docker利用镜像搭建的本地私有镜像仓库,利用k8s搭建了一套jenkins流水线来实现本地提交代码触发微服务部署的一套流水线。 1. jenkins的安装 jenkins安装的方式有很多种,可以在mac系统上利用brew install jenkins来安装,也可以利用docker image的方式安装,当然也可以采用k8s的方式来安装; homebrew的方式: brew install jenkins #安装 brew services start jenkins #启动 在浏览器输入http://localhost:8080/或者http://本机ip:8080/即可验证jenkins是否ok,会弹出一个让你输入密码的页面,密码在这个地方查找: cat secrets/initialAdminPassword 在Jenkins->Manage jenkins->Avaiable->search搜索框输入pipeline,来安装pipeline插件和gitlab插件,也可以再多安装一个blue ocean,这样流水线的ui会好看一些,安装插件的时间会比较就一些,需要耐心等待。 插件安装完之后,点击新建一个流水线,图是这样的,这就代表安装jenkins以及插件过程已经完成了。 2

第6章将磁盘挂载到容器

牧云@^-^@ 提交于 2020-04-23 15:29:25
通过卷在容器间共享数据 emptyDir:当pod删除时卷也被删除,用于存放临时数据 pod实例fortune.yaml apiVersion: v1 kind: Pod metadata: name: fortune spec: containers: - image: luksa/fortune name: html-generator volumeMounts: - name: html mountPath: /var/htdocs - image: nginx:alpine name: web-server volumeMounts: - name: html mountPath: /usr/share/nginx/html readOnly: true ports: - containerPort: 80 protocol: TCP volumes: - name: html emptyDir: {} kubectl create -f fortune.yaml kubectl logs fortune html-generator kubectl logs fortune web-server kubectl exec -it fortune -c web-server /bin/sh hostPath:指向节点文件系统的特定目录 [root@mes2 k8study]