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
    • MetalLB
    • Kong Gateway
  • 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
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Lenses/kafka] Configure authentication and authorization for lenses

Posted on March 11, 2022June 2, 2022 By nim No Comments on [Lenses/kafka] Configure authentication and authorization for lenses

Mặc định pass là admin/admin
Giờ chúng ta muốn change pass admin thì làm sao.

Contents

  • 1) Configure authentication
    • 1.1) File config
    • 1.2) configure ENV in docker
    • 1.3) configure values.yaml in helm-chart k8s
  • 2) Create User Kafka-lenses
  • 3) Reset data của lenses

1) Configure authentication

Reference links:
https://docs.lenses.io/3.0/install_setup/configuration/security.html

Lenses Administrator

A default account with administrator privileges is always active. The default credentials are admin / admin and if left at default, a notification will show in the user interface, informing that the setup is insecure.

The default account username and password may be adjusted as below. For security purposes it is strongly advised to use your password’s SHA256 checksum instead of the plaintext.

1.1) File config

# Lenses Administrator settings

lenses.security.user = "admin"

## For the password you can either use the plaintext
#lenses.security.password = "admin"
## Or you may use the SHA256 checksum (advised)
lenses.security.password = "sha256:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"

Ở trên là các config strong file security.conf
và cách để bạn có chuỗi sha256

unset HISTFILE # Disable history for the current terminal
echo -n "password" | sha256sum

1.2) configure ENV in docker

Nhưng mà chúng ta sài docker thì change file hơi kì
nên chúng ta dùng biền ENV
https://docs.lenses.io/4.1/installation/docker/

  LENSES_SECURITY_USER: admin
  LENSES_SECURITY_PASSWORD: sha256:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
version: '2'
services:
  lenses:
    image: lensesio/lenses:4.1
    environment:
      LENSES_PORT: 9991
      LENSES_KAFKA_BROKERS: "PLAINTEXT://broker.1.url:9092,PLAINTEXT://broker.2.url:9092"
      LENSES_ZOOKEEPER_HOSTS: |
        [
          {url:"zookeeper.1.url:2181", jmx:"zookeeper.1.url:9585"},
          {url:"zookeeper.2.url:2181", jmx:"zookeeper.2.url:9585"}
        ]        
      LENSES_SCHEMA_REGISTRY_URLS: |
        [
          {url:"http://schema.registry.1.url:8081",jmx:"schema.registry.1.url:9582"},
          {url:"http://schema.registry.2.url:8081",jmx:"schema.registry.2.url:9582"}
        ]        
      LENSES_KAFKA_CONNECT_CLUSTERS: |
        [
          {
            name:"data_science",
            urls: [
              {url:"http://connect.worker.1.url:8083",jmx:"connect.worker.1.url:9584"},
              {url:"http://connect.worker.2.url:8083",jmx:"connect.worker.2.url:9584"}
            ],
            statuses:"connect-statuses-cluster-a",
            configs:"connect-configs-cluster-a",
            offsets:"connect-offsets-cluster-a"
          }
        ]        
      LENSES_SECURITY_USER: admin
      LENSES_SECURITY_PASSWORD: sha256:8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
    ports:
      - 9991:9991
      - 9102:9102
    volumes:
      - ./license.json:/license.json
    network_mode: host

1.3) configure values.yaml in helm-chart k8s

Với ENV trên thì mình test nó ko work với helm chart k8s
Nên sẽ sử dụng values.yaml

lenses:
  security:
    defaultUser:
      username: admin
      password: sha256:c956bfaabaf92e736dc95696fb9cf2aa78a4d6f0f203bd763c1925e94fa89bbe

Bạn có thể tham khảo thêm ở đây:
https://help.lenses.io/knowledge-base/helm/helm-external-secrets/

2) Create User Kafka-lenses

Case đầu tiên chúng ta cần tạo 1 user cho develop để họ view connector và topic và chỉ có quyền readonly.

Đầu tiên bạn tạo group
Đây là các quyền cho group
Bạn tạo user và add vào group mới tạo ở trên

3) Reset data của lenses

Cách này hơi chuối làn bạn xóa 2 file

Lenses

Post navigation

Previous Post: [SQL] what are DDL, DML, DCL in SQL?
Next Post: [Sidecar/Kubernestes] Inject sidecar into a Pod automatically

More Related Articles

[Kafka] UI control Kafka, Kafka-connect, … It’s akhq.io Apache Kafka
[Kafka-connect] Install lenses to manage Kafka. Apache Kafka
[Lenses] Insert data or Push messages to Kafka via Lenses. Lenses
[Lenses/kafka] Fix the problem “Cannot extract connector information from the configuration provided” when creating connector Kafka-connect Apache Kafka

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

  • [Prometheus/Grafana] Install Prometheus and Grafana on ubuntu. March 27, 2023
  • [Kong Gateway] WebSocket connection failed March 26, 2023
  • [Nextcloud] Can’t download files to have a size bigger than 2Gi on NextCloud – RaspBerry March 24, 2023
  • [Datadog] Using DataDog to monitor all services on kubernetes March 19, 2023
  • [Metrics Server] Failed to make webhook authorizer request: the server could not find the requested resource March 17, 2023

Archives

  • March 2023
  • February 2023
  • 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
    • NextCloud
  • 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
    • Kong Gateway
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • MetalLB
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.