ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Kubernetes-问题

2022-04-07 02:00:59  阅读:554  来源: 互联网

标签:ingress Kubernetes -- 问题 nginx key go spec


问题1:

  • kube-apiserver: E0309 14:25:24.889084 66289 instance.go:392] Could not construct pre-rendered responses for ServiceAccountIssuerDiscovery endpoints. Endpoints will not be enabled. Error: issuer URL must use https scheme, got: api
  • kube-apiserver: E0309 14:26:21.064219 66289 controller.go:184] Get "https://10.1.1.11:6443/api/v1/namespaces/default/endpoints/kubernetes": dial tcp 10.1.1.11:6443: connect: connection refused

解决问题:

vim /usr/local/k8s/apiserver/conf/apiserver.conf
--service-account-signing-key-file=/usr/local/k8s/ca/ca-key.pem \
--service-account-issuer=https://kubernetes.default.svc.cluster.local \

问题2:

  • Unable to remove old endpoints from kubernetes service: StorageError: key not found, Code: 1, Key: /registry/masterleases/10.1.1.11, ResourceVersion: 0, AdditionalErrorMsg:

解决问题:

  • 可以从下面的图片中看出,停止服务的时候key被删掉了,但启动的时候又要去获取。

问题3:pod中的时间分区和宿主机的不同

解决问题方法一:配置环境变量

apiVersion: apps/v1
kind: Deployment
metadata:
spec:
  template:
    spec:
      containers:
        env:
        - name: TZ    #添加该环境变量
          value: Asia/Shanghai

解决问题方法二:挂载时间文件

apiVersion: apps/v1
kind: Deployment
metadata:
spec:
  template:
    spec:
      containers:
        volumeMounts:
        - name: time-mount
          mountPath: /etc/localtime    #将Asia/Shanghai挂载的容器中
      volumes:
      - name: time-mount
        hostPath:
          path: /usr/share/zoneinfo/Asia/Shanghai

问题4:创建的ingress不正常

问题描述:

  • ingress-nginx-controller-v1.0.4安装正常
    • W0406 16:14:36.130966       6 client_config.go:615] Neither --kubeconfig nor --master was specified.  Using the inCluster报错不用管。
  • 创建的ingress有问题
//ADDRESS没有获取地址
]# kubectl get ingress -o wide
NAME         CLASS    HOSTS       ADDRESS   PORTS   AGE
my-ingress   <none>   localhost             80      118s

//日志开头虽然是I,但是它是有问题的
]# kubectl logs ingress-nginx-controller-5767958868-k9576  -n ingress-nginx
I0407 01:03:50.088521       6 store.go:342] "Ignoring ingress because of error while validating ingress class" ingress="default/my-ingress" error="ingress does not contain a valid IngressClass"

解决问题:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: "nginx"    #加上该注解
spec:

1

#                                                                                                                          #

标签:ingress,Kubernetes,--,问题,nginx,key,go,spec
来源: https://www.cnblogs.com/maiblogs/p/15991998.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有