Follow Need to know
nginx add on keycloak and LDAP
nginx ->
Kibana ( Elasticsearch +fluenbit+Kibana ),
Prometheus, Alertmanager, Grafana
nginx's URL 為對外expose 服務的進入點,經由ngnix可統一做認證授權,使得特定使用者才能使用。
再做完認證授權後,由ngnix再轉送到k8s內部服務。
可以是一至多組Virtual Service host代表不同服務的入口點。
user(人)->(input)nginx's URL at browser->keyclock(login)->{nginx's URL for Kibana,Prometheus,Alertmanager}
LDAP: Lightweight Directory Access Protocol
nginx 設定與LDAP的連線資訊:
Note: LDAP's port & SSL & certification
port 設 389 , SSL 就會設 false, 不用加 certification -> 由這點可以知道排除憑證的情況下,LDAP帳密或是帳號在LDAP的啟用狀態影響了LDAP連線的結果(Bind to LDAP result)
port 設 636 , SSL 就會設 true, 需加對應LDAP URL(網域)的正確 certification -> 憑證正確與否預先測試可用 openSSL command 憑證connect LDAP URL
nginx 設定與LDAP的連線結果
Argo CD Log | Kube Dashboard Pod's Log | End to End check by nginx's URLs
LDAP Bind Error 可能情況:
(1)密碼錯誤
(2)帳密正確但是LDAP Account 狀態為Disabled
(3)使用LDAP port 636 SSL true 時憑證放錯
(1)(2) Error Msg Format
"The exception is [LDAP: error code 49 - 80090308: LdapErr: DSID-0Cxxxxxx, comment: AcceptSecurityContext error, data <HEX>, vece ]."
(1) Code 49 Hex 52e : ERROR_LOGON_FAILURE, Returns when username is valid but password/credential is invalid.
(2) Code 49 Hex 533 : ERROR_ACCOUNT_DISABLED, Administratively Disabled: LDAP User-Account-Control Attribute - ACCOUNTDISABLE, NOTE: Returns only when presented with valid username and password/credential.
(3) Error Msg contain issuer
or same as run openSSL XXX {cert} XXX {LDAP URL} result(Command to Verify LDAP Connection via OpenSSL) for more info.(SSL handshake bytes and verification result/code)
ldap.wiki.com:Common Active Directory Bind Errors
How ngnix link to actual upstream service ?
use k8s internal service (internal endpoint). (由 kube dahshboard service section可找到)
openSSL command x 2
Note: 由Deply to ENV**(Stage)**來決定下載哪一個憑證,最後由openSSL command XXX pem XXX connect LDAP URL 來確認憑證可否與設置的LDAP URL 進行連線
keyword: K8s Virtual Service and Service
取消(註解掉)原服務的Virtual Service配置,把原Virtual Service host 設的值,貼到nginx's URL, 使得原User無痛轉換
或是 Virtual Service 路由到另外一個 service port 非原服務,當Service有開不同的port出來for不同用途
Ex: 只保留首頁(8080),不保留詳細頁面(5000) -> Virtual Service 只路由到首頁(8080)
Base on traffic inside or outside K8s
(1) expose to outside cluster -> inner cluster
(2) inner cluster only