文章目录
/etc/haproxy/haproxy.cfg 中配置了绑定 vip ,启动 haproxy 服务时出现绑定失败的错误提示。/etc/sysctl.conf,添加如下内容:net.ipv4.ip_nonlocal_bind=1
然后让变量生效
sysctl -p
接着再次启动haproxy
systemctl restart haproxy
ETCD_DATA_DIR 变量值即为数据存储目录systemctl restart etcdcd /opt
kubectl get namespace 命名空间 -o json > 命名空间.json
修改 命名空间.json 中内容,删除 spec 和 status 对应的值后,然后执行下边命令:
kubectl proxy --port=9988 &
curl -k -H "Content-Type: application/json" -X PUT --data-binary @命名空间.json 127.0.0.1:9988/api/v1/namespaces/${命名空间}/finalize
istio-system jaeger-5994d55ffc-nmhq6 0/1 Terminating 0 13h
istio-system jaeger-5994d55ffc-pjj5m 0/1 Terminating 0 11h
istio-system kiali-64df7bf7cc-29kxl 0/1 Terminating 0 12h
istio-system kiali-64df7bf7cc-2bk77 0/1 Terminating 0 11h
istio-system kiali-64df7bf7cc-4wwhg 0/1 Terminating 0 14h
istio-system kiali-64df7bf7cc-8cfsh 0/1 Terminating 0 13h
istio-system kiali-64df7bf7cc-dks5w 0/1 Terminating 0 15h
istio-system kiali-64df7bf7cc-dkzgc 0/1 Terminating 0 15h
kubectl get pods -n 命名空间 | grep Terminating | awk '{print $1}' | xargs kubectl delete pod -n 命名空间 --force --grace-period=0
如果发现大量的Pod存在这种情况,可通过编写脚本定期执行。
kubectl logs -f PodName 查看日志时提示如下错误信息:Error from server (Forbidden): Forbidden (user=kubernetes, verb=get, resource=nodes, subresource=proxy)
kubectl create clusterrolebinding kube-apiserver:kubelet-apis --clusterrole=system:kubelet-api-admin --user kubernetes
Failed to create pod sandbox: rpc error: code = Unknown desc = failed pulling image "k8s.gcr.io/pause:3.6":
Error response from daemon: Get https://k8s.gcr.io/v2/:
net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.6
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.6 registry.k8s.io/pause:3.6
问题描述
大量的 Pod 状态是 Evicted
解决办法
删除状态为 Evicted 的 Pod
kubectl get pods -A| grep Evicted | awk '{print $2}' | xargs kubectl delete pod -n <namespace>
"Error syncing pod, skipping" err="network is not ready: container runtime network not ready
journalctl -u kubelet --since today |less
0/1 nodes are available: 1 node(s) had untolerated taint {node.kubernetes.io/not-ready: }
k8s 节点不可调度,使用kubectl 工具查看节点状态
kubectl get nodes -o wide
显示结果如下所示:
NAME STATUS ROLES AGE VERSION
k8s-master1 NotReady,SchedulingDisabled <none> 43h v1.24.2
k8s-master2 Ready <none> 4d6h v1.24.2
k8s-node1 NotReady,SchedulingDisabled <none> 44h v1.24.2
# 禁止调度
kubectl cordon 节点名称
# 解除禁用
kubectl uncordon 节点名称
cni-installer/<nil> <nil>: Unable to create token for CNI kubeconfig error=Post
"https://10.255.0.1:443/api/v1/namespaces/kube-system/serviceaccounts/calico-node/token":
dial tcp 10.255.0.1:443: i/o timeout
--service-cluster-ip-range 与 --cluster-cidr 值是否出现了重叠,导致了集群变成了单机环境。calico-node启动失败,在事件信息中出现如下:
Back-off restarting failed container
invalid capacity 0 on image filesystem
Node k8s-node2 status is now: NodeHasNoDiskPressure
Updated Node Allocatable limit across pods
Node k8s-node2 status is now: NodeHasSufficientPID
#: kubectl logs -n kube-system calico-node-wzq2p -c install-cni
#: kubectl describe pod calico-node-wzq2p -n kube-system
#: journalctl -u kubelet -f
提示磁盘空间不足不一定真的是磁盘空间不足导致的calico-node无法启动,需要查看具体的日志信息。可以使用 kubectl logs -n kube-system calico-node-wzq2p -c install-cni查看具体的错误提示,然后分析问题。作者曾经就一直以为是磁盘空间不足导致的 calico-node 无法启动,后来查看了详细日志才发现是 kube-proxy 的配置参数 --cluster-cidr 与 kube-controller-manager、kube-apiserver 中设置的 --service-cluster-ip-range 不匹配。
clusterDNS依赖 CoreDNS 域名服务 IP 地址,当 Kubelet 服务启动时设置的 clusterDNS 参数与 CoreDNS 部署设置的域名服务 IP 地址不一致时,将会导致服务访问超时。cd /opt
git clone https://github.com/coredns/deployment
cd /opt/deployment/kubernetes
./deploy.sh -r 10.255.0.0/16 -i 10.255.0.2 > coredns.yaml
kubectl apply -f coredns.yaml
上边配置中的 -i 既是设置 DNS 域名服务 IP 地址。
unable to proxy Istiod pods.
Make sure your Kubernetes API server has access to the Istio control plane through 8080 port
yum install socat -y
kubectl patch svc -n istio-ingress istio-ingress -p '{"spec": {"type": "NodePort"}}'
helm upgrade --set meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY istiod istio/istiod -n istio-system
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
尝试通过RVM将RubyGems升级到版本1.8.10并出现此错误:$rvmrubygemslatestRemovingoldRubygemsfiles...Installingrubygems-1.8.10forruby-1.9.2-p180...ERROR:Errorrunning'GEM_PATH="/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/ruby-1.9.2-p180@global:/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/rub
我打算为ruby脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub