Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add x509 for faq #533

Merged
merged 6 commits into from
May 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,55 @@ Default 60 seconds, can be changed using `metrics-resolution` flag. We are not r

## Known issues

#### Unable to authenticate the request due to an error: x509: certificate signed by unknown authority

QianChenglong marked this conversation as resolved.
Show resolved Hide resolved
```
E0524 01:37:36.055326 1 authentication.go:65] Unable to authenticate the request due to an error: x509: certificate signed by unknown authority
```

Because Metrics Server is an aggregated server for kube-apiserver. So as an aggregated server need sets `--requestheader-client-ca-file` for validate request which send by kube-apiserver. [headrequest(front-proxy)](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#authenticating-proxy)
QianChenglong marked this conversation as resolved.
Show resolved Hide resolved


For cluster created by kubeadm:

1. Check kube-apiserver front-proxy args(/etc/kubernetes/manifests/kube-apiserver.yaml)
QianChenglong marked this conversation as resolved.
Show resolved Hide resolved

```
- --proxy-client-cert-file=/etc/kubernetes/pki/front-proxy-client.crt
- --proxy-client-key-file=/etc/kubernetes/pki/front-proxy-client.key
```

2. Prepare front-proxy-ca for Metrics Server
QianChenglong marked this conversation as resolved.
Show resolved Hide resolved

```
kubectl -nkube-system create configmap front-proxy-ca --from-file=front-proxy-ca.crt=/etc/kubernetes/pki/front-proxy-ca.crt -o yaml | kubectl -nkube-system replace configmap front-proxy-ca -f -
QianChenglong marked this conversation as resolved.
Show resolved Hide resolved
```

3. Configure your Metrics Server deployment:
QianChenglong marked this conversation as resolved.
Show resolved Hide resolved

```
Copy link
Contributor

@serathius serathius May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Optional) Have you considered using kubectl patch instead?

Copy link
Contributor Author

@QianChenglong QianChenglong May 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, but it seems that patch cannot modify args.

- args:
- --requestheader-client-ca-file=/ca/front-proxy-ca.crt // ADD THIS!
- --cert-dir=/tmp
- --secure-port=4443
- --kubelet-insecure-tls // ignore validate kubelet x509
- --kubelet-preferred-address-types=InternalIP // using InternalIP to connect kubelet

volumeMounts:
- mountPath: /tmp
name: tmp-dir
- mountPath: /ca // ADD THIS!
name: ca-dir

volumes:
- emptyDir: {}
name: tmp-dir
- configMap: // ADD THIS!
defaultMode: 420
name: front-proxy-ca
name: ca-dir
```

#### Network problems

Metrics server needs to contact all nodes in cluster to collect metrics. Problems with network would can be recognized by following symptoms:
Expand Down