Score:0

Multi cloud provider kubernetes cluster pod logs got timeout

ng flag

Hi all i have master node in digital ocean and worker node in google cloud, nodes are connected using public ip of master nodeenter image description here and pods are in running status but when i run kubectl logs i'm getting timeout error , also i noticed log is calling with local ip so there is no host in it , any one help on this ? is there any possible way to call logs using public ip ?

Update: adding /etc/kubernetes/manifests/kube-apiserver.yaml

apiVersion: v1 kind: Pod metadata: annotations: kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 104.248.40.128:6443 creationTimestamp: null labels: component: kube-apiserver tier: control-plane name: kube-apiserver namespace: kube-system spec: containers:

  • command:
    • kube-apiserver
    • --advertise-address=104.248.40.128
    • --allow-privileged=true
    • --authorization-mode=Node,RBAC
    • --client-ca-file=/etc/kubernetes/pki/ca.crt
    • --enable-admission-plugins=NodeRestriction
    • --enable-bootstrap-token-auth=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-servers=https://127.0.0.1:2379
    • --kubelet-client-certificate=/etc/kubernetes/pki/apiserver-kubelet-client.crt
    • --kubelet-client-key=/etc/kubernetes/pki/apiserver-kubelet-client.key
    • --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
    • --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt
    • --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key
    • --requestheader-allowed-names=front-proxy-client
    • --requestheader-client-ca-file=/etc/kubernetes/pki/front-proxy-ca.crt
    • --requestheader-extra-headers-prefix=X-Remote-Extra-
    • --requestheader-group-headers=X-Remote-Group
    • --requestheader-username-headers=X-Remote-User
    • --secure-port=6443
    • --service-account-issuer=https://kubernetes.default.svc.cluster.local
    • --service-account-key-file=/etc/kubernetes/pki/sa.pub
    • --service-account-signing-key-file=/etc/kubernetes/pki/sa.key
    • --service-cluster-ip-range=10.96.0.0/12
  • --tls-cert-file=/etc/kubernetes/pki/apiserver.crt
    • --tls-private-key-file=/etc/kubernetes/pki/apiserver.key image: registry.k8s.io/kube-apiserver:v1.26.3 imagePullPolicy: IfNotPresent livenessProbe: failureThreshold: 8 httpGet: host: 104.248.40.128 path: /livez port: 6443 scheme: HTTPS initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 15 name: kube-apiserver readinessProbe: failureThreshold: 3 httpGet: host: 104.248.40.128 path: /readyz port: 6443 scheme: HTTPS periodSeconds: 1 timeoutSeconds: 15 resources: requests: cpu: 250m startupProbe: failureThreshold: 24 httpGet: host: 104.248.40.128 path: /livez port: 6443 scheme: HTTPS initialDelaySeconds: 10 periodSeconds: 10 timeoutSeconds: 15 volumeMounts:
    • mountPath: /etc/ssl/certs name: ca-certs readOnly: true
    • mountPath: /etc/pki name: etc-pki readOnly: true
    • mountPath: /etc/kubernetes/pki name: k8s-certs readOnly: true hostNetwork: true priorityClassName: system-node-critical securityContext: seccompProfile: type: RuntimeDefault volumes:
    • hostPath: path: /etc/ssl/certs type: DirectoryOrCreate name: ca-certs
    • hostPath: path: /etc/pki type: DirectoryOrCreate name: etc-pki
    • hostPath: path: /etc/kubernetes/pki type: DirectoryOrCreate name: k8s-certs status: {}

kubectl get endpoints gives below NAME ENDPOINTS AGE kubernetes 104.248.40.128:6443 34h webserver-simple-service 10.244.1.7:8000,10.244.1.8:8000 33h

Kranthiveer Dontineni avatar
qa flag
`Thom` can you check whether your public IP got reflected in your config, the following command will help you in finding that **kubectl config view** . If your kube-api-endpoint is pointing to your internal IP you can follow this [blog](https://ystatit.medium.com/deploy-kubernetes-with-specific-public-ip-address-for-control-plane-endpoint-cef1a54b2fbf) written by **Yst@IT** for changing your kube-api-endpoint to public IP.
Thom avatar
ng flag
@KranthiveerDontineni i have checked kubectl config view the server: https://104.248.40.128:6443 it's a public ip and api is working in browser also , but only thing i noticed it's not have valid ssl certificate dose it make problem ?
Kranthiveer Dontineni avatar
qa flag
have you used SSL certificate while creating the kubernetes cluster..? If so then it might cause issues, so you need to use a valid SSL either it might be a self signed one or OpenSSL based one or from some other third party.
Kranthiveer Dontineni avatar
qa flag
also can you provide steps or document that you are following so that we can try to replicate the issue and provide a better solution.
Thom avatar
ng flag
i have followed this article https://dev.to/kcdchennai/create-a-multi-cloud-setup-of-kubernetes-cluster-936
Kranthiveer Dontineni avatar
qa flag
can you try querying the logs by passing the endpoint parameter..? kubectl logs <pod_name> --endpoint=http://104.248.40.128:6443 or change port number to 10250
Thom avatar
ng flag
it says error: unknown flag: --endpoint
Kranthiveer Dontineni avatar
qa flag
can you provide what is available in `/etc/kubernetes/manifests/kube-apiserver.yaml` and also the output of **kubectl get endpoints** command
Thom avatar
ng flag
@KranthiveerDontineni i have updated the yaml and endpoint details in the question , kindly check it
Kranthiveer Dontineni avatar
qa flag
all the kubernetes looks fine can you check the firewall rules for this public IP
Kranthiveer Dontineni avatar
qa flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/144994/discussion-between-kranthiveer-dontineni-and-thom).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.