cookeem/kubeadm-ha

istio的使用方法

iedwin opened this issue · 11 comments

非常感谢您的项目,很强大,自己摸索着结合项目中1.11和1.9的教程,搭起来了1.11的单master集群。
想请教一下项目主在实际工作中是如何使用istio的。 @cookeem

目前主要是用来做devops升级策略支撑,例如蓝绿发布、ab测试等。后续测试与微服务的集成,这块才是istio的强项。

感谢解答!
在使用istio的时候发现自动注入失败,无法创建Pod,kubectl get events看到sidecar自动注入报错,查了查istio中有人提及但是没有人给出正确的解决方案:

Error creating: Internal error occurred: failed calling admission webhook "sidecar-injector.istio.io": Post https://istio-sidecar-injector.istio-system.svc:443/inject?timeout=30s: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

最终我通过关闭自动注入,采用手动注入后就可以正常注入了,不知道您有没有遇到该问题?(版本和镜像就是用您项目中提供的)

此问题我也在网络组件安装有问题的集群上遇到过,可能跟云服务商提供的网络模式有关。

此问题我也在网络组件安装有问题的集群上遇到过,可能跟云服务商提供的网络模式有关。

我的集群是安装在内网openstack上的,Istio安装采用的是NodePort的方式。
我现在基本都是手动注入了:)。

我们之前用过ucloud的服务商,他们用的就是openstack,kubernetes安装在上边网络组件是有问题,istio自动注入也会失败。应该是openstack的网络和calico容器网络组件存在不兼容问题引起。

您好,我按照你的教程把k8s ha 集群搭建起来了,但是我的metrics-server一直处于创建中,请问有可能是什么原因造成的?
image

看看metrics-server的创建阶段报告?

kubectl -n kube-system describe pod metrics-server-XXX-XXX

Name: metrics-server-55fcc5b88-jtdps
Namespace: kube-system
Priority: 0
PriorityClassName:
Node: k8s-master02/10.211.55.22
Start Time: Tue, 13 Nov 2018 15:43:31 +0800
Labels: k8s-app=metrics-server
pod-template-hash=119771644
Annotations:
Status: Pending
IP:
Controlled By: ReplicaSet/metrics-server-55fcc5b88
Containers:
metrics-server:
Container ID:
Image: gcr.io/google_containers/metrics-server-amd64:v0.2.1
Image ID:
Port:
Host Port:
Command:
/metrics-server
--source=kubernetes.summary_api:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true
--metric-resolution=30s
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Environment:
Mounts:
/etc/localtime from localtime (rw)
/etc/timezone from timezone (rw)
/var/run/secrets/kubernetes.io/serviceaccount from metrics-server-token-5kf6m (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
timezone:
Type: HostPath (bare host directory volume)
Path: /etc/timezone
HostPathType: File
localtime:
Type: HostPath (bare host directory volume)
Path: /usr/share/zoneinfo/Asia/Shanghai
HostPathType: File
metrics-server-token-5kf6m:
Type: Secret (a volume populated by a Secret)
SecretName: metrics-server-token-5kf6m
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message


Warning FailedMount 16m (x20 over 59m) kubelet, k8s-master02 Unable to mount volumes for pod "metrics-server-55fcc5b88-jtdps_kube-system(d16fdc2c-e717-11e8-92c6-001c4292d33b)": timeout expired waiting for volumes to attach or mount for pod "kube-system"/"metrics-server-55fcc5b88-jtdps". list of unmounted volumes=[timezone]. list of unattached volumes=[timezone localtime metrics-server-token-5kf6m]
Warning FailedMount 44s (x38 over 1h) kubelet, k8s-master02 MountVolume.SetUp failed for volume "timezone" : hostPath type check failed: /etc/timezone is not a file

噢,我忘了移除部分环境代码了。我更新一下

好的,感谢

已更新