Mặc định pass là admin/admin
Giờ chúng ta muốn change pass admin thì làm sao.
1) Configure authentication
Reference links:
https://docs.lenses.io/3.0/install_setup/configuration/security.html
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.



3) Reset data của lenses
Cách này hơi chuối làn bạn xóa 2 file
