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

[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

[Istio] Security authentication và authorization with ISTIO Isito-EnvoyFilter
[Helm Chart] Tìm hiểu – (gạch giữa), _ (gạch dưới), dấu chấm “.” trong helm chart Helm Chart
[Isito] FIX status 503 – SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED Isito-EnvoyFilter
[Prometheus/Istio] Research about Recording Rules in Prometheus and reduce metrics of istio cluster. Isito-EnvoyFilter
[istio] Discover route TCP in Cluster Istio Isito-EnvoyFilter
[Kustomize] How to combine Kustomize and Helm-chart! Helm Chart

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.