大家好,我在数字海洋中有主节点,在谷歌云中有工作节点,节点使用主节点的公共 IP 连接并且 pod 处于运行状态,但是当我运行 kubectl logs 时,我收到超时错误,我还注意到日志正在使用本地 ip 调用,因此其中没有主机,有人可以帮忙吗?是否有可能使用公共 ip 调用日志?
更新:添加 /etc/kubernetes/manifests/kube-apiserver.yaml
apiVersion:v1 类型:Pod 元数据:注释:kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint:104.248.40.128:6443 creationTimestamp:null 标签:组件:kube-apiserver 层:控制平面名称:kube-apiserver 命名空间:kube-system 规范:容器:
- 命令:
- kube-api服务器
- --广告地址=104.248.40.128
- –允许特权=true
- --authorization-mode =节点,RBAC
- –客户端 ca 文件 = /etc/kubernetes/pki/ca.crt
- --enable-admission-plugins=NodeRestriction
- –启用引导令牌身份验证 = true
- –etcd-cafile = /etc/kubernetes/pki/etcd/ca.crt
- –etcd-certfile = /etc/kubernetes/pki/apiserver-etcd-client.crt
- –etcd-keyfile = /etc/kubernetes/pki/apiserver-etcd-client.key
- --etcd 服务器=https://127.0.0.1:2379
- –kubelet 客户端证书 = /etc/kubernetes/pki/apiserver-kubelet 客户端.crt
- –kubelet 客户端密钥 = /etc/kubernetes/pki/apiserver-kubelet 客户端.key
- --kubelet-preferred-address-types=内部IP,外部IP,主机名
- –proxy-客户端证书文件=/etc/kubernetes/pki/front-proxy-客户端.crt
- –proxy-客户端密钥文件=/etc/kubernetes/pki/front-proxy-客户端.key
- --requestheader-allowed-names=前端代理客户端
- –requestheader-客户端 ca 文件 = /etc/kubernetes/pki/front-proxy-ca.crt
- –requestheader-extra-headers-prefix=X-Remote-Extra-
- –requestheader-group-headers = X-Remote组
- –requestheader-用户名-headers=X-Remote-User
- –安全端口=6443
- –服务帐户发行者=https://kubernetes.default.svc.cluster.local
- –服务帐户密钥文件=/etc/kubernetes/pki/sa.pub
- –服务帐户签名密钥文件=/etc/kubernetes/pki/sa.key
- –服务集群 IP 范围=10.96.0.0/12
- --tls-cert-file=/etc/kubernetes/pki/apiserver.crt
- --tls-private-key-file=/etc/kubernetes/pki/apiserver.key 镜像:registry.k8s.io/kube-apiserver:v1.26.3 imagePullPolicy:IfNotPresent livenessProbe:failureThreshold:8 httpGet:主机:104.248.40.128 路径:/livez 端口:6443 方案:HTTPS initialDelaySeconds:10 periodSeconds:10 timeoutSeconds:15 名称:kube-apiserver readinessProbe:failureThreshold:3 httpGet:主机:104.248.40.128 路径:/readyz 端口:6443 方案:HTTPS periodSeconds:1 timeoutSeconds:15 资源:请求:cpu:250m startupProbe:failureThreshold:24 httpGet:主机: 104.248.40.128 路径:/livez 端口:6443 方案:HTTPS initialDelaySeconds:10 periodSeconds:10 timeoutSeconds:15 volumeMounts:
- mountPath:/etc/ssl/certs 名称:ca-certs readOnly:true
- mountPath:/etc/pki 名称:etc-pki readOnly:true
- mountPath:/etc/kubernetes/pki 名称:k8s-certs readOnly:true hostNetwork:true priorityClassName:system-node-critical securityContext:seccompProfile:类型:RuntimeDefault 卷:
- hostPath:路径:/etc/ssl/certs 类型:DirectoryOrCreate 名称:ca-certs
- hostPath:路径:/etc/pki 类型:DirectoryOrCreate 名称:etc-pki
- hostPath:路径:/etc/kubernetes/pki 类型:DirectoryOrCreate 名称:k8s-certs 状态:{}
kubectl get endpoints 给出以下 NAME ENDPOINTS AGE kubernetes 104.248.40.128:6443 34h webserver-simple-service 10.244.1.7:8000,10.244.1.8:8000 33h