{"id":298985,"date":"2020-02-20T09:00:23","date_gmt":"2020-02-20T09:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=298985"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-02-20T09:00:23","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=298985","title":{"rendered":"\u041f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c ActiveDirectory \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u043a Kubernetes c \u043f\u043e\u043c\u043e\u0449\u044c\u044e Keycloak"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489172\/\">\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u0446\u0435\u043b\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/441112\/\">\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e<\/a>, \u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u044f\u0437\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 Microsoft ActiveDirectory, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c:<\/p>\n<ul>\n<li><b>Keycloak <\/b> \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0434\u0438\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 LDAP \u0438 OpenID \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442.<\/li>\n<li><b>Keycloak gatekeeper<\/b> \u2014 \u0440\u0435\u0432\u0435\u0440\u0441 \u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0438\u044e \u0447\u0435\u0440\u0435\u0437 Keycloak.<\/li>\n<li><b>Gangway <\/b> \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f kubectl \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 OpenID \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Kubernetes API.<\/li>\n<\/ul>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0430 \u0432 Kubernetes.<\/h3>\n<p>  \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\/\u0433\u0440\u0443\u043f\u043f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e RBAC, \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0443\u0436\u0435 \u043a\u0443\u0447\u0443 \u0441\u0442\u0430\u0442\u0435\u0439, \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RBAC \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u043e Kubernetes \u043d\u0435 \u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 Kubernetes. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 Kuberntes OpenID \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0430 \u043f\u0440\u0430\u0432\u0430 \u0435\u043c\u0443 \u0443\u0436\u0435 \u0432\u044b\u0434\u0430\u0441\u0442 \u0441\u0430\u043c Kubernetes.<\/p>\n<p>  <b>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/b><\/p>\n<ul>\n<li>\u0412\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f Kubernetes \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0438\u043b\u0438 minikube<\/li>\n<li>Active Directory<\/li>\n<li>\u0414\u043e\u043c\u0435\u043d\u044b:<br \/>   keycloak.example.org<br \/>   kubernetes-dashboard.example.org<br \/>   gangway.example.org<\/li>\n<li>\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0438\u043b\u0438 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442<\/li>\n<\/ul>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c 2 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430, \u044d\u0442\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439(\u0426\u0435\u043d\u0442\u0440 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438) \u0438 wildcard \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0434\u043b\u044f \u0434\u043e\u043c\u0435\u043d\u0430 *.example.org<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435\/\u0432\u044b\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b, \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 Kubernetes, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u043b\u044f \u043d\u0435\u0433\u043e secret:<\/p>\n<pre><code class=\"bash\">kubectl create secret tls tls-keycloak --cert=example.org.crt --key=example.org.pem<\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e Ingress \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Keycloak<\/h3>\n<p>  \u042f \u0440\u0435\u0448\u0438\u043b \u0447\u0442\u043e \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e helm chart-\u044b.<\/p>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e:<\/p>\n<pre><code class=\"bash\">helm repo add codecentric https:\/\/codecentric.github.io\/helm-charts helm repo update<\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b keycloak.yml c\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">keycloak.yml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">keycloak:   # \u0418\u043c\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430   username: &quot;test_admin&quot;   # \u041f\u0430\u0440\u043e\u043b\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440     password: &quot;admin&quot;   # \u042d\u0442\u0438 \u0444\u043b\u0430\u0433\u0438 \u043d\u0443\u0436\u043d\u044b \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 Keycloak \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0440\u044f\u043c\u043e \u0447\u0435\u0440\u0435\u0437 web \u043c\u043e\u0440\u0434\u0443. \u042d\u0442\u043e \u043d\u0430\u043c    \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e \u0431\u044b \u043f\u043e\u0447\u0438\u043d\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0431\u0430\u0433, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0438\u0436\u0435.   extraArgs: &quot;-Dkeycloak.profile.feature.script=enabled -Dkeycloak.profile.feature.upload_scripts=enabled&quot;    # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c ingress, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0432 secrets   ingress:     enabled: true      path: \/     annotations:       kubernetes.io\/ingress.class: nginx       ingress.kubernetes.io\/affinity: cookie     hosts:       - keycloak.example.org     tls:     - hosts:         - keycloak.example.org       secretName: tls-keycloak   # Keycloak \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u044f\u0445 \u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u044e Postgresql \u043f\u0440\u044f\u043c\u043e \u0432 Kuberntes, \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0442\u0430\u043a \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c!   persistence:     deployPostgres: true     dbVendor: postgres  postgresql:   postgresUser: keycloak   postgresPassword: &quot;&quot;   postgresDatabase: keycloak   persistence:     enabled: true<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0444\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u0432\u0435\u0431 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <a href=\"https:\/\/keycloak.example.org\/\" rel=\"nofollow\">keycloak.example.org<\/a><\/p>\n<p>  \u0412 \u043b\u0435\u0432\u043e\u043c \u0443\u0433\u043b\u0443 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <b>Add realm<\/b>  <\/p>\n<div class=\"scrollable-table\">\n<table>\n<tr>\n<th>Key<\/th>\n<th>Value<\/th>\n<\/tr>\n<tr>\n<td>Name<\/td>\n<td>kubernetes<\/td>\n<\/tr>\n<tr>\n<td>Display Name<\/td>\n<td>Kubernetes<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<p>  \u041e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f email \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<br \/>  <b>Client scopes &#8212;&gt; Email &#8212;&gt; Mappers &#8212;&gt; Email verified (Delete)<\/b><\/p>\n<p>  \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0444\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u0437 ActiveDirectory, \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0438\u0436\u0435 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b \u0434\u0443\u043c\u0430\u044e \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0439.<\/p>\n<p>  <b>User federation &#8212;&gt; Add provider\u2026 &#8212;&gt; ldap<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0444\u0435\u0434\u0435\u0440\u0430\u0446\u0438\u0438<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dp\/zh\/n4\/dpzhn4bo-kp4nlnkcnrcnxj73wm.png\"><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/sm\/s0\/9v\/sms09vw42zqqfkgdjsyonifzgn0.png\">  <\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 <b>Synchronize all users<\/b> \u0432\u044b \u0443\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u0430\u043f\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u0433\u0440\u0443\u043f\u043f\u044b<\/p>\n<p>  <b>User federation &#8212;&gt; ldap_localhost &#8212;&gt; Mappers &#8212;&gt; Create<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0430\u043f\u043f\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/g4\/ym\/8s\/g4ym8ss4xfzj4g2ju8xfgfj-vty.png\">  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/h3>\n<p>  \u041d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0432 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u0445 Keycloak \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0443 \u043d\u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f. \u0412\u0430\u0436\u043d\u044b\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u0432\u044b\u0434\u0435\u043b\u044e \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043a\u0440\u0430\u0441\u043d\u044b\u043c.<\/p>\n<p>  <b>Clients &#8212;&gt; Create<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gx\/ky\/xn\/gxkyxnglb556uxb98cfowt2yhjo.png\">  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c scoupe \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f:<\/p>\n<p>  <b>Client Scopes &#8212;&gt; Create<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 scoupe<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a_\/t8\/4n\/a_t84n571muypzgo6q2vwxicfli.png\">  <\/div>\n<\/div>\n<p>  \u0418 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c mapper \u0434\u043b\u044f \u043d\u0438\u0445:<\/p>\n<p>  <b>Client Scopes &#8212;&gt; groups &#8212;&gt; Mappers &#8212;&gt; Create<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041c\u0430\u043f\u043f\u0435\u0440<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qm\/iy\/m7\/qmiym7hpnqdwi4hafjli0oput0c.png\">  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043d\u0430\u0448\u0438\u0445 \u0433\u0440\u0443\u043f\u043f \u0432 Default Client Scopes:<\/p>\n<p>  <b>Clients &#8212;&gt; kubernetes &#8212;&gt; Client Scopes &#8212;&gt; Default Client Scopes<\/b><br \/>  \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>groups<\/b> \u0432 <b>Available Client Scopes<\/b>, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c <b>Add selected<\/b><\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c secret(\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043a\u0443\u0434\u0430 \u043d\u0438\u0442\u044c) \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Keycloak:<\/p>\n<p>  <b>Clients &#8212;&gt; kubernetes &#8212;&gt; Credentials &#8212;&gt; Secret<\/b><br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043e\u043a\u043e\u043d\u0447\u0435\u043d\u0430, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043b\u0443\u0447\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0443 403. <a href=\"https:\/\/issues.redhat.com\/browse\/KEYCLOAK-8954\" rel=\"nofollow\">\u0411\u0430\u0433 \u0440\u0435\u043f\u043e\u0440\u0442<\/a>. <\/p>\n<p>  \u0424\u0438\u043a\u0441:<\/p>\n<p>  <b>Client Scopes &#8212;&gt; roles &#8212;&gt; Mappers &#8212;&gt; Create<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Mapper<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ud\/pt\/6i\/udpt6icu8dqk4til9qjtpcf0fci.png\">  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/ add current client-id to token audience token.addAudience(token.getIssuedFor());  \/\/ return token issuer as dummy result assigned to iss again token.getIssuer(); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Kubernetes<\/h2>\n<p>  \u041d\u0430\u043c \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u043b\u0435\u0436\u0438\u0442 \u043d\u0430\u0448 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043e\u0442 \u0441\u0430\u0439\u0442\u0430, \u0438 \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 OIDC.<br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b \/etc\/kubernetes\/manifests\/kube-apiserver.yaml<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">kube-apiserver.yaml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"> ... spec:   containers:   - command:     - kube-apiserver ...     - --oidc-ca-file=\/var\/lib\/minikube\/certs\/My_Root.crt     - --oidc-client-id=kubernetes     - --oidc-groups-claim=groups     - --oidc-issuer-url=https:\/\/keycloak.example.org\/auth\/realms\/kubernetes     - --oidc-username-claim=email ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c kubeadm \u043a\u043e\u043d\u0444\u0438\u0433 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">kubeadm config<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">kubectl edit -n kube-system configmaps kubeadm-config<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\"> ... data:   ClusterConfiguration: |     apiServer:       extraArgs:         oidc-ca-file: \/var\/lib\/minikube\/certs\/My_Root.crt         oidc-client-id: kubernetes         oidc-groups-claim: groups         oidc-issuer-url: https:\/\/keycloak.example.org\/auth\/realms\/kubernetes         oidc-username-claim: email ... <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 auth-proxy<\/h2>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0449\u0438\u0442\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c keycloak gatekeeper. \u041f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0432\u0435\u0440\u0441 \u043f\u0440\u043e\u043a\u0441\u0438 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0434\u0430\u043a \u0435\u0449\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0430\u0441 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430\u0445. \u0422\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 OpenID, \u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0443\u0435\u0442\u0441\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 Kubernetes Dashboard<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Kubernetes Dashboard<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> helm install stable\/kubernetes-dashboard --name dashboard -f values_dashboard.yaml <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">values_dashboard.yaml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">enableInsecureLogin: true service:   externalPort: 80 rbac:   clusterAdminRole: true   create: true serviceAccount:   create: true   name: 'dashboard-test' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/h3>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c ClusterRoleBinding \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0430\u0434\u043c\u0438\u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430(\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f ClusterRole cluster-admin) \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 DataOPS.<\/p>\n<pre><code class=\"bash\"> kubectl apply -f rbac.yaml <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">rbac.yaml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"> apiVersion: rbac.authorization.k8s.io\/v1 kind: ClusterRoleBinding metadata:   name: dataops_group roleRef:   apiGroup: rbac.authorization.k8s.io   kind: ClusterRole   name: cluster-admin subjects: - apiGroup: rbac.authorization.k8s.io   kind: Group   name: DataOPS <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 keycloak gatekeeper:<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\"> helm repo add gabibbo97 https:\/\/gabibbo97.github.io\/charts\/ helm repo update helm install gabibbo97\/keycloak-gatekeeper --version 2.1.0 --name keycloak-gatekeeper -f values_proxy.yaml <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">values_proxy.yaml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">  # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c ingress ingress:   enabled: true   annotations:     kubernetes.io\/ingress.class: nginx   path: \/   hosts:     - kubernetes-dashboard.example.org   tls:    - secretName: tls-keycloak      hosts:        - kubernetes-dashboard.example.org  # \u0413\u043e\u0432\u043e\u0440\u0438\u043c \u0433\u0434\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0443 OIDC \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 discoveryURL: &quot;https:\/\/keycloak.example.org\/auth\/realms\/kubernetes&quot; # \u0418\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 Keycloak ClientID: &quot;kubernetes&quot; # Secret \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u0440\u043e\u0441\u0438\u043b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c ClientSecret: &quot;c6ec03b8-d0b8-4cb6-97a0-03becba1d727&quot; # \u041a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0424\u043e\u0440\u043c\u0430\u0442 &lt;SCHEMA&gt;:\/\/&lt;SERVICE_NAME&gt;.&gt;&lt;NAMESAPCE&gt;.&lt;CLUSTER_NAME&gt; upstreamURL: &quot;http:\/\/dashboard-kubernetes-dashboard.default.svc.cluster.local&quot; # \u041f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 skipOpenidProviderTlsVerify: true # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0432\u0441\u0435 path \u0435\u0441\u043b\u0438 \u043c\u044b \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 DataOPS rules:   - &quot;uri=\/*|groups=DataOPS&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/kubernetes-dashboard.example.org\" rel=\"nofollow\">kubernetes-dashboard.example.org<\/a>, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 Keycloak \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u043e\u043f\u0430\u0434\u0435\u043c \u0432 Dashboard \u0443\u0436\u0435 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d\u043d\u044b\u043c.<\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 gangway<\/h2>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c gangway \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f kubectl, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u0434 \u043d\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u043e\u043f\u0430\u0434\u0435\u043c \u0432 Kubernetes.<\/p>\n<pre><code class=\"bash\"> helm install --name gangway stable\/gangway -f values_gangway.yaml <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">values_gangway.yaml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\"> gangway:   # \u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430   clusterName: &quot;my-k8s&quot;   # \u0413\u0434\u0435 \u0443 \u043d\u0430\u0441 OIDC \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440   authorizeURL: &quot;https:\/\/keycloak.example.org\/auth\/realms\/kubernetes\/protocol\/openid-connect\/auth&quot;   tokenURL: &quot;https:\/\/keycloak.example.org\/auth\/realms\/kubernetes\/protocol\/openid-connect\/token&quot;   audience: &quot;https:\/\/keycloak.example.org\/auth\/realms\/kubernetes\/protocol\/openid-connect\/userinfo&quot;   # \u0422\u0435\u043e\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c groups \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0437\u0430\u043c\u0430\u043f\u0438\u043b\u0438   scopes: [&quot;openid&quot;, &quot;profile&quot;, &quot;email&quot;, &quot;offline_access&quot;]   redirectURL: &quot;https:\/\/gangway.example.org\/callback&quot;   # \u0418\u043c\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430   clientID: &quot;kubernetes&quot;   # \u0421\u0435\u043a\u0440\u0435\u0442   clientSecret: &quot;c6ec03b8-d0b8-4cb6-97a0-03becba1d727&quot;   # \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u043d\u0438\u0435, \u0442\u043e \u0437\u0430 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u0431\u0440\u0430\u0442\u044c\u044f &lt;b&gt;Frist name&lt;\/b&gt; &lt;b&gt;Second name&lt;\/b&gt;, \u0430 \u043f\u0440\u0438 &quot;sub&quot; \u0435\u0433\u043e \u043b\u043e\u0433\u0438\u043d   usernameClaim: &quot;sub&quot;   # \u0414\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f \u0438\u043b\u0438 IP \u0430\u0434\u0440\u0435\u0441\u0441 API \u0441\u0435\u0440\u0432\u0435\u0440\u0430   apiServerURL: &quot;https:\/\/192.168.99.111:8443&quot;  # \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c Ingress ingress:   enabled: true   annotations:     kubernetes.io\/ingress.class: nginx     nginx.ingress.kubernetes.io\/proxy-buffer-size: &quot;64k&quot;   path: \/   hosts:   - gangway.example.org   tls:   - secretName: tls-keycloak     hosts:       - gangway.example.org  # \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0430\u043c\u043e\u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0442\u043e \u0435\u0433\u043e(\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442) \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c. trustedCACert: |-  -----BEGIN CERTIFICATE-----  MIIDVzCCAj+gAwIBAgIBATANBgkqhkiG9w0BAQsFADA1MQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRGF0YU9QUzEUMBIGA1UEAxMLbXkgcm9vdCBrZXkwHhcNMjAwMjE0MDkxODAwWhcNMzAwMjE0MDkxODAwWjA1MQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRGF0YU9QUzEUMBIGA1UEAxMLbXkgcm9vdCBrZXkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDyP749PqqIRwNSqaK6qr0Zsi03G4PTCUlgaYTPZuMrwUVPK8xX2dWWs9MPRMOdXpgr8aSTZnVfmelIlVz4D7o2vK5rfmAe9GPcK0WbwKwXyhFU0flS9sU\/g46ogHFrk03SZxQAeJhMLfEmAJm8LF5HghtGDs3t4uwGsB95o+lqPLiBvxRB8ZS3jSpYpvPgXAuZWKdZUQ3UUZf0X3hGLp7uIcIwJ7i4MduOGaQEO4cePeEJy9aDAO6qV78YmHbyh9kaW+1DL\/Sgq8NmTgHGV6UOnAPKHTnMKXl6KkyUz8uLBGIdVhPxrlzG1EzXresJbJenSZ+FZqm3oLqZbw54Yp5hAgMBAAGjcjBwMA8GA1UdEwEB\/wQFMAMBAf8wHQYDVR0OBBYEFHISTOU\/6BQqqnOZj+1xJfxpjiG0MAsGA1UdDwQEAwIBBjARBglghkgBhvhCAQEEBAMCAAcwHgYJYIZIAYb4QgENBBEWD3hjYSBjZXJ0aWZpY2F0ZTANBgkqhkiG9w0BAQsFAAOCAQEAj7HC8ObibwOLT4ZYmISJZwub9lcE0AZ5cWkPW39j\/syhdbbqjK\/6jy2D3WUEbR+s1Vson5Ov7JhN5In2yfZ\/ByDvBnoj7CP8Q\/ZMjTJgwN7j0rgmEb3CTZvnDPAz8Ijw3FP0cjxfoZ1Z0V2F44Ry7gtLJWr06+MztXVyto3aIz1\/XbMQnXYlzc3c3B5yUQIy44Ce5aLRVsAjmXNqVRmDJ2QPNLicvrhnUJsO0zFWI+zZ2hc4Ge1RotCrjfOc9hQY63jZJ17myCZ6QCD7yzMzAob4vrgmkD4q7tpGrhPY\/gDcE+lUNhC7DO3l0oPy2wsnT2TEn87eyWmDiTFG9zWDew==  -----END CERTIFICATE----- <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0430\u043a \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0442\u0430\u043a \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u0430\u043d\u0434:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8b\/st\/ti\/8bsttivjxe0rfrdak52ldrwiuum.png\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/489172\/\"> https:\/\/habr.com\/ru\/post\/489172\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/489172\/\">\u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0441 \u0446\u0435\u043b\u044c\u044e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/441112\/\">\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e<\/a>, \u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0441\u0432\u044f\u0437\u043a\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0441 Microsoft ActiveDirectory, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c:<\/p>\n<ul>\n<li><b>Keycloak <\/b> \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c. \u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0434\u0438\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441 LDAP \u0438 OpenID \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442.<\/li>\n<li><b>Keycloak gatekeeper<\/b> \u2014 \u0440\u0435\u0432\u0435\u0440\u0441 \u043f\u0440\u043e\u043a\u0441\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0438\u044e \u0447\u0435\u0440\u0435\u0437 Keycloak.<\/li>\n<li><b>Gangway <\/b> \u2014 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f kubectl \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 OpenID \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Kubernetes API.<\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-298985","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=298985"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/298985\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=298985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=298985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=298985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}