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
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[kiali] Config authentication on Kiali.

Posted on November 28, 2021November 28, 2021 By nim No Comments on [kiali] Config authentication on Kiali.

Thường thì cài kiali lúc show trang web thì chúng ta sẽ login bằng user “anonymous”
Nếu bạn muốn có authen chuẩn chỉ hơn thì sem bài viết này.

Contents

  • Authentication Strategies
    • Anonymous strategy
    • Header strategy
    • OpenID Connect strategy
    • OpenShift strategy
    • Token strategy
  • 1) OpenID Connect strategy
    • 1.1) Config google
  • 1.2) Config kiali
  • 1.3) Filter email login follow domain
    • 1.4) mode read only on kiali

Authentication Strategies

Anonymous strategy

Access Kiali with no authentication.

Header strategy

Run Kiali behind a reverse proxy responsible for injecting the user’s token, or a token with impersonation.

OpenID Connect strategy

Access Kiali requiring authentication through a third-party OpenID Connect provider.

OpenShift strategy

Access Kiali requiring OpenShift authentication.

Token strategy

Access Kiali requiring a Kubernetes ServiceAccount token.

Như cung cấp ở bên trên thì chúng ta có nhiều cách để authen

1) OpenID Connect strategy

1.1) Config google

Đầu tiên là truy cập:
https://console.developers.google.com/

Giờ bạn tìm cách để trở về trang APIs & Services
Mình thấy có 1 warning
Các này dùng để lấy các thông tin của user như(tên tài khoản, email, …)
Thướng thì mình sẽ lấy 3 thông tin này và nhấn update
Nó sẽ đưa chúng ta ra ngoài dashboard

1.2) Config kiali

https://kiali.io/docs/configuration/authentication/openid/
Như bạn add manifest như hướng dẫn sẽ bị lỗi như ảnh bên dưới.

Chúng ta cần add thêm vào configmap của kiali

      strategy: "openid"
      openid:
        client_id: "506853153623-xxxxxxxxtp21hsbb81n7cs7diujetuv9.apps.googleusercontent.com"
        disable_rbac: true
        issuer_uri: "https://accounts.google.com"
        scopes: ["openid", "email"]
        username_claim: "email"
        redirect_uri: "http://kiali.nimtechnology.com/kiali"

Tiếp theo bạn apply 1 secret.

apiVersion: v1
kind: Secret
metadata:
  name: kiali
  namespace: istio-system
  labels:
    app: kiali
type: Opaque
data:
  oidc-secret: "XXXXXXXXXVIb3RCdEUzQUtwT1VnZGktUVNSV0YzUG85WV8="

OK sau khi đã làm sau thì bạn cần redeploy lại kiali.

Và thực hiện đăng nhập thử

như này là ok.

1.3) Filter email login follow domain

Note: I tested that the feature only worked with Kiali 1.43.0 ++

Thường thì nếu cấu hình đăng nhập theo hình thức trên, cứ email nào đăng nhập google thì đều có thể login vào kiali của bạn.

https://kiali.io/docs/configuration/authentication/openid/#configuring-allowed-domains

spec:
  auth:
    openid:
      allowed_domains:
      - example.com
      - foo.com
HÌnh mô tả
Khi login bằng email có đuôi domain khác.
sẽ bị deny

1.4) mode read only on kiali

Ở thời điểm hiện tại thì đối với mình kiali cũng chỉ để view là chính và mình cũng không có nhu cầu config trên kiali

Nếu mình muốn force chỉ view trên kiali thì config như trong configmap kiali

view_only_mode: false

Isito-EnvoyFilter, Kubernetes & Container

Post navigation

Previous Post: [ingress-nginx] Error=”ingress does not contain a valid IngressClass”, After upgrade ingress-nginx(helm 4.x.x, ingress-nginx/controller:v1.1.0)
Next Post: [code/k8s] Lost or not found file inside the container on k8s

More Related Articles

[Kustomize] Tìm hiểu về Kustomize tool cho k8s, có thể dùng cho ArgoCD. Kubernetes & Container
[Udemy] Download khóa học Udemy giá rẻ chỉ với 55k/khóa Kubernetes & Container
[Kubernetes] How to delete namespace is Terminating and very stubborn Kubernetes
[Istio/Recheck Envoy] Test các features liên quan đến EnvoyFilter trên Istio . Isito-EnvoyFilter
Hướng dẫn đưa secret của Kubernetes thành biến env của pod Kubernetes
[wordpress] Install WordPress so easily. Kubernetes & Container

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

  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022
  • [Postgresql] Install postgresql client and trying a few command postgresql. June 20, 2022
  • [Mount/Nextcloud] How do you mount a hard disk that was used windows into Linux. June 19, 2022

Archives

  • 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
    • Jenkins
    • Spinnaker
  • Coding
    • Git
    • Golang
    • Jquery & JavaScript
    • Laravel
    • 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 © 2022 NimTechnology.