Hiện trạng của mình là istio của mình đan chạy trên version k8s 1.20 và istio là 1.9.9
Sau khi upgrade version k8s từ 1.20 lên 1.21 thì istiod của mình gặp lỗi bên dưới
2022-05-04T04:09:15.612472Z warn serverca Authentication failed for x.x.x.x:42104: Authenticator ClientCertAuthenticator at index 0 got error: no verified chain is found. Authenticator KubeJWTAuthenticator at index 1 got error: failed to validate the JWT from cluster "cluster1": the service account authentication returns an error: [invalid bearer token, token audiences ["unknown"] is invalid for the target audiences ["istio-ca"]].
istio-proxy thì gặp lỗi sau:
warn failed to fetch token from file: open ./var/run/secrets/tokens/istio-token: no such file or directory
như các log trên thì mình chắc chắn là bạn đang run istio với config như sau:
values.global.jwtPolicy=first-party-jwt
chúng ta cùng tìm hiểu ở links này Configure third party service account tokens
- Third party tokens, which have a scoped audience and expiration.
- First party tokens, which have no expiration and are mounted into all pods.
Về phía kubernetes thì bạn có thêm tham khảo ở đây:
https://sysdig.com/blog/kubernetes-1-21-whats-new/ ở mục #542, #1205 TokenRequest API and Kubelet integration
Vậy điều chúng ta cần làm bây giờ là change thành values.global.jwtPolicy=third-party-jwt
và thực hiện redeploy
– các workload có chưa pod đã inject istio-proxy.
– istio-gateway.