Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[Isito] FIX status 503 – SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Posted on November 20, 2021November 26, 2021 By nim No Comments on [Isito] FIX status 503 – SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Hệ thông istio trước giờ trước giờ vẫn đang chạy ngon.

Bỗng 1 ngày dev báo truy cập vào website thì bị chửi.

upstream connect error or disconnect/reset before headers. reset reason: connection failure, transport failure reason: TLS error: 268435581:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED

Contents

  • 1) Check expiration time
    • 1.1) renew certs
  • 2) Different time
    • 2.1) check time of node
    • 2.2) try to config timezone of workload
  • 3) sidecar istio-proxy
  • 4)HOW TO CONFIGURE THE LIFETIME FOR ISTIO CERTIFICATES?

1) Check expiration time

Chúng ta sẽ kiểm tra CERTIFICATE của các con:
– ingressgateway-istio.
– istio-proxy (sidecar injected to workload).

links:
https://istio.io/v1.8/docs/ops/configuration/security/root-transition/

kubectl exec [YOUR_POD] -c istio-proxy -n [YOUR_NAMESPACE] -- curl http://localhost:15000/certs | head -c 1000

Hoặc bạn exec vào container luôn và dùng câu lệnh:

http://localhost:15000/certs | head -c 1000

Như ngày hôm đó của tôi và expiration time thì cert chưa hết

1.1) renew certs

Mà nếu cert của bạn có hết hạn thì bạn run câu lệnh này. (tested on single cluster istio)

wget https://raw.githubusercontent.com/istio/tools/release-1.9/bin/root-transition.sh
chmod +x root-transition.sh
./root-transition.sh check-root

=====YOU HAVE 30 DAYS BEFORE THE ROOT CERT EXPIRES!=====

Bạn nhớ kiểm tra release-1.9 nhé
Chỗ này mình thấy nó ko có –context được nên bạn nhớ switch context của kubectl nhé.

List contexts

kubectl config get-contexts

Switch contexts

kubectl config set current-context MY-CONTEXT

Chuẩn bị mọi thứ OK rồi run thôi

./root-transition.sh root-transition
Cả 2 file old-ca-cert.pem và ca-key.pem sẽ được lưu xuống máy
Động thời istio-ca-secret sẽ được cập nhật

Bạn có thể kiểm tra lại bằng command và content của file cert.

OK nếu cert cũng chưa expirate.
Log istiod, ingressgateway, proxy-istio ko có j đặc biệt.

2) Different time

Lúc đó tôi thử redeploy proxy-istio hay ingressgateway
mình lỗi túa ra:

Ở đây nghĩ là gì Giờ của istiod và istio-proxy bị lệch nhau
Istio istiod < istio-proxy
nên cert allways expirate
failed to warm certificate: failed to generate workload certificate: create certificate: rpc error: code = Unavailable desc = connection error: desc = “transport: authentication handshake failed: x509: certificate has expired or is not yet valid: current time 2021-11-20T04:29:25Z is before 2021-11-20T11:14:51Z

2.1) check time of node

Lúc này bạn nên đi check date của các pod: istiod, ingressgateway-istio, sidecar istio-proxy.
Con nào sai giờ thì bạn có thể redeploy để nhảy sang node khác và check giờ của kube worker node ngay nhé.

2.2) try to config timezone of workload

Hoặc bạn có thể chỉnh timezone của pod “istiod, ingressgateway-istio, sidecar istio-proxy”

Bạn thêm vào environment của workload

- name: TZ
  value: Asia/Saigon

Nói chung là có nhiêu cách thì chơi hết.

POd vừa deploy mà toàn báo 7h trước thôi các bạn

Trong lúc research thấy có bài của anh Tây, chắc nào rảnh coi

https://blog.christianposta.com/diving-into-istio-1-6-certificate-rotation/

3) sidecar istio-proxy

Sau khi mà anh em check giờ ngon nghe trên istiod và istio-ingressgateway ngon nghẻ òi.
thì đôi khi các sidecar istio-proxy sẽ bị lỗi sau

Nếu bị như trên redeploy lại workload nhé anh em.

4)HOW TO CONFIGURE THE LIFETIME FOR ISTIO CERTIFICATES?

Thông tin này được lấy trang của istio

https://istio.io/latest/about/faq/security/#cert-lifetime-config
For the workloads running in Kubernetes, the lifetime of their Istio certificates is by default 24 hours.

This configuration may be overridden by customizing the proxyMetadata field of the proxy configuration. For example:

proxyMetadata:
  SECRET_TTL: 48h

Values over 90 days will not be accepted.

Isito-EnvoyFilter

Post navigation

Previous Post: [redis-cli] a few Redis commands are useful.
Next Post: [istio] Discover route inside istio

More Related Articles

[Istio] Research tracing in Istio Isito-EnvoyFilter
[Istio-Multi Cluster] Tutorial is very detailed to install Primary-Remote on different networks Isito-EnvoyFilter
[VictoriaMetrics/Grafana/Prometheus/Kiali] VictoriaMetrics is a fast, cost-effective and scalable time series database Grafana
[Istio] Authenticator KubeJWTAuthenticator at index 1 got error: failed to validate the JWT from cluster – When you update K8s version 1.20 to 1.21 Isito-EnvoyFilter
[Istio] why does workload inject Istio that workload always connects fail database? – hold Application Isito-EnvoyFilter
[Istio] OMG – Metric of an Istiod pod had 2 versions. Why??? Isito-EnvoyFilter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Smartctl] Instruction check the health disk of Raspberry. January 16, 2023
  • [kubectl/Argocd] How to create a kubectl config file for serviceaccount or from the cluster secret of Argocd January 12, 2023
  • [Helm/Github] Create a public Helm chart repository with GitHub Pages January 8, 2023
  • [AWS] How to increase the disk size of a Windows EC2 machine? January 4, 2023
  • [Redis] ElastiCache-Redis Cross-Region Replication|Global DataStore January 3, 2023

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.