This message was deleted.
# general
a
This message was deleted.
c
What do you mean by "add the new listener"?
g
To simplify, my goal is to access
kubectl
from my local machine. The steps I followed are: 1. Exposed the Kubernetes API server. 2. Linked it to a domain. (I achieved this using the Cloudflare, I simply created a tunnel and pointed it to the api-server, as drawn in the screenshot.) 3. Copied the kubeconfig file and updated the
server
value from
127.0.0.1:6443
to
<https://cluster.example.com>
. However, when I run a
kubectl
command like:
Copy code
kubectl get nodes
I receive the following error:
Copy code
E1223 10:45:09.325814   14240 memcache.go:265] couldn't get current server API group list: Get "<https://cluster.example.com/api?timeout=32s>": tls: failed to verify certificate: x509: certificate signed by unknown authority
```"
c
The kubeconfig contains a copy of the cluster CA. When you access the cluster via cloudclare, you get the cloudflare certificate, instead of your cluster certificate. Which is what the error is telling you. You’d need to edit the kubeconfig to contain the correct CA data.
g
Okay, I have tried that, by just exporting the issuer of the certificate using the browser, converting it to base-64, and placing it
certificate-authority-data
here is the final config looks like,
Copy code
apiVersion: v1
clusters:
  - cluster:
      certificate-authority-data: <BASE-64 certificate>
      server: <https://cluster.example.com>
    name: default
contexts:
  - context:
      cluster: default
      user: default
    name: default
current-context: default
kind: Config
preferences: {}
users:
  - name: default
    user:
      client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJrVENDQVRlZ0F3SUJBZ0lJRU5VMTh2bGR5cFF3Q2dZSUtvWkl6ajBFQXdJd0l6RWhNQjhHQTFVRUF3d1kKYXpOekxXTnNhV1Z1ZEMxallVQXhOekkzTnpFNE9EZzJNQjRYRFRJME1Ea3pNREUzTlRRME5sb1hEVEkxTURregpNREUzTlRRME5sb3dNREVYTUJVR0ExVUVDaE1PYzNsemRHVnRPbTFoYzNSbGNuTXhGVEFUQmdOVkJBTVRESE41CmMzUmxiVHBoWkcxcGJqQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDlBd0VIQTBJQUJLL1lmSVlXRlFKcVRxaSsKZHo0RGdEWElBaFBhMzUrUnhrdmF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xR1NNNDkKQXdFSG9VUURRZ0FFcjloOGhoWVZBbmZOaW5kdXZzNEZlZFpqK0wvZWo2NjcyTDhBPT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=
with these change, I am getting this error
Copy code
C:\Users\HP\.kube>kubectl get nodes
E1225 12:30:14.318745   27752 memcache.go:265] couldn't get current server API group list: the server has asked for the client to provide credentials
c
Yeah you really can't terminate ssl on CF like that. Kubectl needs to authenticate with its clients certificate and it can't do that if ssl is terminated externally.
g
Do you have any idea? how we still achieve this.