Skip to content

Commit

Permalink
base64 --decode works across Linux and MacOS
Browse files Browse the repository at this point in the history
Signed-off-by: Dr Nic Williams <[email protected]>
  • Loading branch information
drnic committed Oct 28, 2019
1 parent f120439 commit c1f1c06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Unable to connect to the server: x509: certificate signed by unknown authority (

- Verify that the `$HOME/.kube/config` file contains a valid certificate, and
regenerate a certificate if necessary. The certificates in a kubeconfig file
are base64 encoded. The `base64 -d` command can be used to decode the certificate
are base64 encoded. The `base64 --decode` command can be used to decode the certificate
and `openssl x509 -text -noout` can be used for viewing the certificate information.
- Unset the `KUBECONFIG` environment variable using:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export CLUSTER_NAME="some_server_name"
APISERVER=$(kubectl config view -o jsonpath="{.clusters[?(@.name==\"$CLUSTER_NAME\")].cluster.server}")

# Gets the token value
TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}"|base64 -d)
TOKEN=$(kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='default')].data.token}"|base64 --decode)

# Explore the API with TOKEN
curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
Expand Down
6 changes: 3 additions & 3 deletions content/fr/docs/setup/independent/troubleshooting-kubeadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ Unable to connect to the server: x509: certificate signed by unknown authority (
"crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
```

- Vérifiez que le fichier `$HOME/.kube/config` contient un certificat valide, et 
re-générer un certificat si nécessaire. Les certificats dans un fichier kubeconfig 
sont encodés en base64. La commande `base64 -d` peut être utilisée pour décoder le certificat 
- Vérifiez que le fichier `$HOME/.kube/config` contient un certificat valide, et
re-générer un certificat si nécessaire. Les certificats dans un fichier kubeconfig
sont encodés en base64. La commande `base64 --decode` peut être utilisée pour décoder le certificat
et `openssl x509 -text -noout` peut être utilisé pour afficher les informations du certificat.
- Une autre solution consiste à écraser le `kubeconfig` existant pour l'utilisateur" admin ":

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Unable to connect to the server: x509: certificate signed by unknown authority (

- Verify that the `$HOME/.kube/config` file contains a valid certificate, and
regenerate a certificate if necessary. The certificates in a kubeconfig file
are base64 encoded. The `base64 -d` command can be used to decode the certificate
are base64 encoded. The `base64 --decode` command can be used to decode the certificate
and `openssl x509 -text -noout` can be used for viewing the certificate information.
- Unset the `KUBECONFIG` environment variable using:

Expand Down

0 comments on commit c1f1c06

Please sign in to comment.