Puppet Class: profile::kubernetes::kubeconfig::admin

Defined in:
modules/profile/manifests/kubernetes/kubeconfig/admin.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • kubernetes_cluster_groups (Hash[String, Hash]) (defaults to: lookup('kubernetes_cluster_groups'))
  • tokens (Hash[String, Hash[String, Hash]]) (defaults to: lookup('profile::kubernetes::infrastructure_users', { default_value => {} }))


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'modules/profile/manifests/kubernetes/kubeconfig/admin.pp', line 2

class profile::kubernetes::kubeconfig::admin (
    Hash[String, Hash] $kubernetes_cluster_groups                      = lookup('kubernetes_cluster_groups'),
    Hash[String, Hash[String, Hash]] $tokens                           = lookup('profile::kubernetes::infrastructure_users', { default_value => {} }),
) {
    $kubernetes_cluster_groups.map |$cluster_group, $clusters| {
        $_tokens = $tokens[$cluster_group]
        $clusters.each |$cluster, $cluster_data| {
            k8s::kubeconfig { "/etc/kubernetes/admin-${cluster}.config":
                master_host => $cluster_data['master'],
                username    => 'client-infrastructure',
                token       => $_tokens['client-infrastructure']['token'],
                group       => 'root',
                owner       => 'root',
                mode        => '0400',
            }
        }
    }
}