{"id":923,"date":"2021-01-06T20:16:14","date_gmt":"2021-01-06T19:16:14","guid":{"rendered":"https:\/\/loeilduse.fr\/?p=923"},"modified":"2021-01-07T10:46:48","modified_gmt":"2021-01-07T09:46:48","slug":"deployer-kubeapps-pour-un-usage-multi-clusters","status":"publish","type":"post","link":"https:\/\/loeilduse.fr\/?p=923&lang=fr","title":{"rendered":"D\u00e9ployer Kubeapps pour un usage multi-clusters"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-927 size-large\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1024x474.png\" alt=\"\" width=\"696\" height=\"322\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1024x474.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-300x139.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-768x355.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1536x711.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list.png 1917w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Dans cet article nous allons voir comment d\u00e9ployer Kubeapps en environnement multi-cluster. Habituellement il se d\u00e9ployait cluster par cluster, ici, l&#8217;objectif est d&#8217;avoir une seule instance Kubeapps capable de d\u00e9ployer et de g\u00e9rer les applications sur plusieurs clusters. Pour cela, il faut que chaque cluster soit capable de s&#8217;authentifier \u00e0 une source IdP (Identity Provider).<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Dans mon exemple je vais utiliser des clusters TKG 1.2.1 avec l&#8217;extension incluse <a href=\"https:\/\/github.com\/dexidp\/dex\">Dex<\/a>. Dex\u00a0va permettre l\u2019authentification avec un provider OpenID Connect (OIDC).\u00a0 Pour info, dans notre exemple l\u2019extension <a href=\"https:\/\/github.com\/heptiolabs\/gangway\">Gangway<\/a> qui normalement va de pair avec Dex n&#8217;est pas utile. Elle sert \u00e0 g\u00e9n\u00e9rer un Kubeconfig une fois que l&#8217;utilisateur s&#8217;est authentifi\u00e9 via la page web du cluster. Kubeapps n&#8217;a pas besoin de cette extension car il utilise un proxy Oauth2. Sur mon environnement, je vais utiliser des clusters existant qui sont d\u00e9j\u00e0 configur\u00e9s avec l&#8217;extension Gangway et 1 que je vais cr\u00e9er sans installer Gangway (2 clusters auraient pu suffire mais c&#8217;est tellement simple \u00e0 d\u00e9ployer avec TKG qu&#8217;on ne va pas se priver).<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-953 aligncenter\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe-1024x316.png\" alt=\"\" width=\"696\" height=\"215\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe-1024x316.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe-300x93.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe-768x237.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe-1536x474.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-schema-de-principe.png 1566w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">\u00c9tape primordiale, c&#8217;est d&#8217; avoir l&#8217;extension Dex d&#8217;install\u00e9e sur le cluster de management et le configurer pour qu&#8217;il puisse faire des requ\u00eates sur une source IdP : <a href=\"https:\/\/docs.vmware.com\/en\/VMware-Tanzu-Kubernetes-Grid\/1.2\/vmware-tanzu-kubernetes-grid-12\/GUID-extensions-dex.html\">https:\/\/docs.vmware.com\/en\/VMware-Tanzu-Kubernetes-Grid\/1.2\/vmware-tanzu-kubernetes-grid-12\/GUID-extensions-dex.html<\/a>. Une fois Dex install\u00e9, il faut cr\u00e9er des clusters de workload compatibles OIDC et d\u00e9ployer Kubeapps sur un cluster de pr\u00e9f\u00e9rence distinct (ou commencer par installer Kubeapps et le mettre \u00e0 jour pour qu&#8217;il prenne en compte les nouveaux clusters).<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Exporter les variables sur l&#8217;environnement du cluster DEX :<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>export AUTH_MGMT_CLUSTER=&#8221;auth-mgmt-cluster-admin@auth-mgmt-cluster&#8221;<\/strong> # nom de mon cluster de management<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>export OIDC_ISSUER_URL=https:\/\/172.20.7.10:30167<\/strong> #IP et Port de mon cluster de management o\u00f9 est install\u00e9 DEX<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>export OIDC_USERNAME_CLAIM=email<\/strong><\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>export OIDC_GROUPS_CLAIM=groups<\/strong><\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>export OIDC_DEX_CA=$(kubectl get secret dex-cert-tls -n tanzu-system-auth -o &#8216;go-template={{ index .data &#8220;ca.crt&#8221; }}&#8217; &#8211;context $AUTH_MGMT_CLUSTER| base64 -d | gzip | base64)<\/strong> # certificat du cluster de management<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Cr\u00e9er ensuite les clusters de workloads :<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>tkg create cluster usine-32 <span style=\"color: #ff0000;\">&#8211;enable-cluster-options oidc<\/span> &#8211;plan dev &#8211;vsphere-controlplane-endpoint 172.20.7.17<\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Logs of the command execution can also be found at: \/tmp\/tkg-20210106T094128013610360.log<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Validating configuration&#8230;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Creating workload cluster &#8216;usine-32&#8217;&#8230;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Waiting for cluster to be initialized&#8230;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Waiting for cluster nodes to be available&#8230;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Waiting for addons installation&#8230;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Workload cluster &#8216;usine-32&#8217; created<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif; font-size: 12pt;\">R\u00e9cup\u00e9rer le context du cluster pour qu\u2019il soit int\u00e9gr\u00e9 dans le kubeconfig et ainsi r\u00e9cup\u00e9rer l&#8217;url de l&#8217;API <span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">server:<\/span> et le certificat <span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">certificateAuthorityData:<\/span><br \/>\n<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"><strong>tkg get credentials usine-32<\/strong><\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">Credentials of workload cluster &#8216;usine-32&#8217; have been saved<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">You can now access the cluster by running &#8216;kubectl config use-context usine-32-admin@usine-32&#8217;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Se connecter au cluster afin d&#8217;autoriser les utilisateurs \u00e0 s&#8217;y connecter et de d\u00e9ployer des applications :<br \/>\n<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">kubectl config use-context usine-32-admin@usine-32<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">cat &lt;&lt; EOF | kubectl apply &#8211;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">kind: ClusterRoleBinding<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">apiVersion: rbac.authorization.k8s.io\/v1<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">metadata:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 name: tkg-users<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">subjects:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; kind: Group<\/span> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"> # Donner le r\u00f4le au groupe, mettre User si vous souhaitez cibler un user en particulier<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 name: tkg-users # Mettre le nom du groupe, tous les utilisateurs du groupe seront pris en compte<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 apiGroup: &#8220;&#8221;<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">roleRef:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 kind: ClusterRole #this must be Role or ClusterRole<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 name: cluster-admin # ClusterRole \u00e0 avoir<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 apiGroup: rbac.authorization.k8s.io<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">EOF<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Une fois le cluster cr\u00e9\u00e9, les droits d&#8217;acc\u00e8s positionn\u00e9s, l&#8217;url et le certificat r\u00e9cup\u00e9r\u00e9s (si besoin, reproduire les m\u00eames \u00e9tapes pour d&#8217;autres clusters de workload), il reste deux fichiers \u00e0 modifier, l&#8217;un concerne le fichier de valeurs de l\u2019installation de Kubeapps et l&#8217;autre le fichier de configuration DEX.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Modification du fichier de valeurs pour l&#8217;installation de Kubeapps (Exemple provenant de mon coll\u00e8gue Michael Nelson : <a href=\"https:\/\/liveandletlearn.net\/post\/kubeapps-on-tkg-management-cluster\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/liveandletlearn.net\/post\/kubeapps-on-tkg-management-cluster\/<\/a>) :<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># Dans mon exemple Kubeapps est accessible au travers d&#8217;un LoadBalancer<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">frontend:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 service:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 port: 80<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 type: LoadBalancer<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># Setup the oauth2-proxy running on the frontend to handle the OIDC authentication<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">authProxy:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 enabled: true<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 provider: oidc<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 clientID: auth-tools<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 ## les deux Secrets ci-dessous sont \u00e0 g\u00e9n\u00e9rer par vous-m\u00eame (32 octets max)<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 clientSecret: wPmp8+IrTxbGZbVF\/yqPPeP4XZzw5mLt<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 cookieSecret: fiUrXyEBQx7uWlcw55CxQkbYwZ4a\/cC7<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 additionalFlags:<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 # C&#8217;est l&#8217;adresse IP et le port de DEX qui est install\u00e9 sur le cluster de management<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 &#8211; &#8211;oidc-issuer-url=https:\/\/172.20.7.10:30167<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0 # les clusters derri\u00e8res le mot audience sont les clusters sur lesquels les d\u00e9ploiements seront autoris\u00e9s, ils doivent aussi figurer en bas de ce fichier et dans le fichier de configuration Dex<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; &#8211;scope=openid email groups audience:server:client_id:workload-01 audience:server:client_id:workload-02 audience:server:client_id:usine-01 audience:server:client_id:usine-32<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0 \u00a0# Comme j&#8217;ai des certificats autosign\u00e9s, il ne faut pas les v\u00e9rifier aupr\u00e8s d\u2019une autorit\u00e9<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; &#8211;ssl-insecure-skip-verify=true<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0 \u00a0# Since Kubeapps is running without TLS, can&#8217;t use secure cookies<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; &#8211;cookie-secure=false<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 # If you need to access the actual token in the frontend for testing, uncomment the following.<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 # &#8211; &#8211;set-authorization-header=true<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># Liste des clusters sur lesquels les d\u00e9ploiements seront autoris\u00e9s, les m\u00eames renseign\u00e9s un peu plus haut<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># L&#8217;apiServiceURL et le certificateAuthorityData sont ceux r\u00e9cup\u00e9r\u00e9s dans le fichier kubeconfig un peu plus haut<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># dans mon exemple j&#8217;ai 4 clusters de workload<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">clusters:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; name: workload-01<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 apiServiceURL: https:\/\/172.20.7.14:6443<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 certificateAuthorityData: USUZJQ0FURS0tQkFRc0ZBREFWTVJNd0&#8230;&#8230;..E9KOFhFQUI1aVBqVDQxWXZzeEE9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; name: workload-02<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 apiServiceURL: https:\/\/172.20.7.15:6443<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 certificateAuthorityData: LS0tLS1CRUdJTiBDRVJUSUZJQ0FBREFWTVJNd0&#8230;&#8230;.wS1V1UUgvcCtjMWkvYW89Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; name: usine-01<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 apiServiceURL: https:\/\/172.20.7.16:6443<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 certificateAuthorityData: LS0TkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0&#8230;.Es2RWpSNys2NkNlT2dpeHcxVUk9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; name: usine-32<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 apiServiceURL: https:\/\/172.20.7.17:6443<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 certificateAuthorityData: BTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0&#8230;cldORUNGb3FJelZkdXdKRGNFMTA9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Maintenant, on peut installer Kubeapps dans un namespace avec comme param\u00e8tre ce fichier de valeurs (ici, je l&#8217;ai appel\u00e9<\/span> <span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">kubeapps-dex.yaml<\/span><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">)<\/span> :<\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">kubectl create namespace kubeapps-system<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">helm install kubeapps bitnami\/kubeapps &#8211;namespace kubeapps-system &#8211;values kubeapps-dex.yaml<\/span><\/p>\n<p>Si vous \u00eates amen\u00e9 \u00e0 modifier le fichier de configuration comme par exemple pour ajouter un autre cluster, vous pouvez utiliser cette commande :<\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">helm upgrade kubeapps bitnami\/kubeapps &#8211;namespace kubeapps-system &#8211;values kubeapps-dex.yaml<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Maintenant, il faut dire \u00e0 Dex qu&#8217;il y a de nouveaux clusters cr\u00e9\u00e9s<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">cat ~\/tkg\/tkg-extensions-v1.2.0+vmware.1\/\/extensions\/authentication\/dex\/vsphere\/ldap\/dex-data-values.yaml<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\"># Partie \u00e0 modifier extraite du fichier de configuration utilisait par Dex : ~\/tkg\/tkg-extensions-v1.2.0+vmware.1\/\/extensions\/authentication\/dex\/vsphere\/ldap\/dex-data-values.yaml<br \/>\n<\/span><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 #@overlay\/replace<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 staticClients:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; id: usine-01 # nom de mon cluster de workload, attention \u00e0 garder le m\u00eame nom que dans le fichier de valeurs utilis\u00e9 par Kubeapps<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0redirectURIs:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0&#8211; https:\/\/172.20.7.16:30166\/callback # Adress IP de l&#8217;API du cluster de workload et le port normalement utilis\u00e9 par Gangway<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0name: usine-01<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0secret: a1094138692761b8bd653e7af36c3d57 # Secret normalement utilisait par Gangway \u00e0 mettre m\u00eame si Gangway n&#8217;est pas install\u00e9, dans ce cas mettez ce que vous voulez<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0trustedPeers:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0&#8211; auth-tools # nom du cluster Kubeapps<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; id: usine-32<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0 \u00a0redirectURIs:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; https:\/\/172.20.7.17:30166\/callback<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 name: usine-32<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 secret: a1094138692721b8bd653e7af36c3d57<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 trustedPeers:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; auth-tools<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; id: workload-01<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 \u00a0\u00a0redirectURIs:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; https:\/\/172.20.7.14:30166\/callback<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 name: workload-01<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 secret: e36a415d615ccbf37b4c4b8316be9740<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 trustedPeers:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; auth-tools<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; id: workload-02<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 redirectURIs:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; https:\/\/172.20.7.15:30166\/callback<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 name: workload-02<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 secret: 85507bc84d6d26899aa9bf1c87600f81<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0 \u00a0trustedPeers:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; auth-tools<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0 &#8211; id: auth-tools<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 redirectURIs:<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 &#8211; http:\/\/172.20.7.130\/oauth2\/callback # Adresse IP de ma VIP qui pointe vers Kubeapps<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 name: auth-tools # nom du cluster o\u00f9 j&#8217;ai install\u00e9 Kubeapps, j&#8217;ai choisi de l&#8217;installer sur un cluster \u00e0 part<\/span><br \/>\n<span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">\u00a0\u00a0\u00a0 secret: wPmp8+IrTxbGZbVF\/yqPPeP4XZzw5mLt #cl\u00e9 renseign\u00e9e dans le fichier Kubeapps \u00ab clientSecret \u00bb<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Une fois modifier, il faut dire \u00e0 Dex de prendre en compte la nouvelle configuration, \u00e0 faire \u00e0 partir du cluster de management o\u00f9 Dex est install\u00e9 :<\/span><\/p>\n<p><span style=\"font-family: courier new, courier, monospace; font-size: 10pt;\">kubectl create secret generic dex-data-values &#8211;from-file ~\/tkg\/tkg-extensions-v1.2.0+vmware.1\/extensions\/authentication\/dex\/vsphere\/ldap\/dex-data-values.yaml -n tanzu-system-auth -o yaml &#8211;dry-run | kubectl replace -f-<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Voil\u00e0, maintenant Kubeapps est pr\u00eat \u00e0 \u00eatre utilis\u00e9 sur les 4 clusters configur\u00e9s :<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">A partir d&#8217;un navigateur entrez l&#8217;adresse o\u00f9 le nom de la VIP kubeapps obtenue et cliquez sur &#8220;LOGIN VIA OIDC PROVIDER:&#8221;<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-932 size-large aligncenter\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen-1024x501.png\" alt=\"\" width=\"696\" height=\"341\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen-1024x501.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen-300x147.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen-768x376.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen-1536x752.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-first-screen.png 1918w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Vous \u00eates ensuite redirig\u00e9 vers la page d&#8217;authentification DEX, vous remarquerez que l&#8217;IP et le port sont ceux renseign\u00e9s dans le fichier de configuration DEX, entrez votre compte et votre mot de passe :<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-935 size-large\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen-1024x527.png\" alt=\"\" width=\"696\" height=\"358\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen-1024x527.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen-300x154.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen-768x395.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen-1536x791.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-login-screen.png 1917w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Vous arrivez ensuite sur la page du cluster et namespace par d\u00e9faut, l&#8217;\u00e9cran est vide car il n&#8217;y a pas eu de d\u00e9ployement via HELM ou via un Operator sur le namespace et cluster d\u00e9fault :<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-936 aligncenter\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page-1024x528.png\" alt=\"\" width=\"696\" height=\"359\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page-1024x528.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page-300x155.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page-768x396.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page-1536x792.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/kubeapps-landing-page.png 1915w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: trebuchet ms, geneva, sans-serif;\">Vous pouvez changer de cluster et de namespace en cliquant sur &#8220;Current Context&#8221; en haut \u00e0 droite :<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-927 aligncenter\" src=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1024x474.png\" alt=\"\" width=\"696\" height=\"322\" srcset=\"https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1024x474.png 1024w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-300x139.png 300w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-768x355.png 768w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list-1536x711.png 1536w, https:\/\/loeilduse.fr\/wp-content\/uploads\/2021\/01\/Kubeapps-cluster-list.png 1917w\" sizes=\"(max-width: 696px) 100vw, 696px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Dans cet article nous allons voir comment d\u00e9ployer Kubeapps en environnement multi-cluster. Habituellement il se d\u00e9ployait cluster par cluster, ici, l&#8217;objectif est d&#8217;avoir une seule instance Kubeapps capable de d\u00e9ployer et de g\u00e9rer les applications sur plusieurs clusters. Pour cela, il faut que chaque cluster soit capable de s&#8217;authentifier \u00e0 une source IdP (Identity<\/p><\/div>\n<div class=\"blog-btn\"><a href=\"https:\/\/loeilduse.fr\/?p=923&#038;lang=fr\" class=\"home-blog-btn\">Lire la suite<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[147],"tags":[194,157,195,193,149,150,6],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/posts\/923"}],"collection":[{"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=923"}],"version-history":[{"count":24,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/posts\/923\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=\/wp\/v2\/posts\/923\/revisions\/955"}],"wp:attachment":[{"href":"https:\/\/loeilduse.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loeilduse.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}