-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Documentation: fix key rotation command in encryption guide #15365
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
Documentation: fix key rotation command in encryption guide #15365
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Looks good, but please find a suggestion below.
Commit b6b767b8465bfbd1729550270ed5b954001874ae does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
"kubectl get secret -n kube-system cilium-ipsec-keys" outputs two lines with "keys:", one is the real key data and other is a "managedField": $ kubectl get secret -n kube-system cilium-ipsec-keys -o yaml | grep keys: keys: MyByZmM0MTA2KGdjbShhZXMpKSA3ZTE1YmZlNmQyZjczNGUzZmQ0YTEzM2FlZDU2MGQwMjEzZjBjNmRmIDEyOA== f:keys: {} It makes the whole command to get the key id to fail: $ KEYID=$(kubectl get secret -n kube-system cilium-ipsec-keys -o yaml|grep keys: | awk '{print $2}' | base64 -d | awk '{print $1}') base64: invalid input This will be fixed in next Kubernetes release (kubernetes/kubernetes#96878), in the meanwhile just use a regular expression in awk to match "keys:" at the begining. Fixes: 4ea52ae ("cilium: encryption, docs key updates") Signed-off-by: Mauricio Vásquez <mauricio@accuknox.com> Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
b6b767b
to
537bf79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
"kubectl get secret -n kube-system cilium-ipsec-keys" outputs two lines
with "keys:", one is the real key data and other is a "managedField":
$ kubectl get secret -n kube-system cilium-ipsec-keys -o yaml | grep keys:
keys: MyByZmM0MTA2KGdjbShhZXMpKSA3ZTE1YmZlNmQyZjczNGUzZmQ0YTEzM2FlZDU2MGQwMjEzZjBjNmRmIDEyOA==
f:keys: {}
It makes the whole command to get the key id to fail:
$ KEYID=$(kubectl get secret -n kube-system cilium-ipsec-keys -o yaml|grep keys: | awk '{print $2}' | base64 -d | awk '{print $1}')
base64: invalid input
This will be fixed in next Kubernetes release
(kubernetes/kubernetes#96878), in the meanwhile
we can just use "-m 1" for grep to make it only return the first result.
Fixes: 4ea52ae ("cilium: encryption, docs key updates")
Signed-off-by: Mauricio Vásquez mauricio@accuknox.com
Signed-off-by: Mauricio Vásquez mauricio@kinvolk.io