assets

package
v0.0.0-...-ec701fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRoles

func GetRoles(f fs.ReadFileFS, clusterType configuration.ClusterType) ([]runtimeclient.Object, error)

func ParseTemplate

func ParseTemplate(f fs.ReadFileFS, fileName string) ([]runtimeclient.Object, error)

Types

type ClusterConfig

type ClusterConfig struct {
	API string `yaml:"api"`
}

type ClusterRoleBindings

type ClusterRoleBindings struct {
	ClusterRoles []string `yaml:"clusterRoles,omitempty"`
}

type Clusters

type Clusters struct {
	Host    ClusterConfig   `yaml:"host"`
	Members []MemberCluster `yaml:"members"`
}

type DefaultServiceAccountsNamespace

type DefaultServiceAccountsNamespace struct {
	Host   string `yaml:"host"`
	Member string `yaml:"member"`
}

DefaultServiceAccountsNamespace defines the names of the default namespaces where the ksctl SAs should be created. If not specified, then the names kubesaw-admins-host and kubesaw-admins-member are used.

type FS

type FS interface {
	fs.FS
	fs.ReadDirFS
	fs.ReadFileFS
}

FS is an interface that matches all the methods provided by embed.FS

type FilenameMatcher

type FilenameMatcher func(string) bool

type KubeSawAdmins

type KubeSawAdmins struct {
	Clusters                        Clusters                        `yaml:"clusters"`
	ServiceAccounts                 []ServiceAccount                `yaml:"serviceAccounts"`
	Users                           []User                          `yaml:"users"`
	DefaultServiceAccountsNamespace DefaultServiceAccountsNamespace `yaml:"defaultServiceAccountsNamespace"`
}

func GetKubeSawAdminsConfig

func GetKubeSawAdminsConfig(kubeSawAdminsFile string) (*KubeSawAdmins, error)

type MemberCluster

type MemberCluster struct {
	Name          string `yaml:"name"`
	ClusterConfig `yaml:",inline"`
	// SeparateKustomizeComponent when set to true, then the manifests for the member cluster will be generated in a separate
	// Kustomize component (a directory structure that will contain all the generated manifests including the kustomization.yaml files).
	// The name of the root folder will have the same name as the name of the member cluster.
	SeparateKustomizeComponent bool `yaml:"separateKustomizeComponent"`
}

type PermissionBindings

type PermissionBindings struct {
	RoleBindings        []RoleBindings      `yaml:"roleBindings"`
	ClusterRoleBindings ClusterRoleBindings `yaml:"clusterRoleBindings"`
}

type PermissionsPerClusterType

type PermissionsPerClusterType map[string]PermissionBindings

type RoleBindings

type RoleBindings struct {
	Namespace    string   `yaml:"namespace"`
	Roles        []string `yaml:"roles,omitempty"`
	ClusterRoles []string `yaml:"clusterRoles,omitempty"`
}

type Selector

type Selector struct {
	// SkipMembers can contain a list of member cluster names the entity shouldn't be applied for
	SkipMembers []string `yaml:"skipMembers,omitempty"`
	// MemberClusters defines a list of member cluster names the entity should be applied for
	MemberClusters []string `yaml:"memberClusters,omitempty"`
}

Selector contains fields to select clusters the entity should (not) be applied for

func (Selector) ShouldBeSkippedForMember

func (s Selector) ShouldBeSkippedForMember(memberName string) bool

type ServiceAccount

type ServiceAccount struct {
	Name                      string   `yaml:"name"`
	Namespace                 string   `yaml:"namespace,omitempty"`
	Selector                  Selector `yaml:"selector"`
	PermissionsPerClusterType `yaml:",inline"`
}

type User

type User struct {
	Name                      string   `yaml:"name"`
	ID                        []string `yaml:"id"`
	AllClusters               bool     `yaml:"allClusters,omitempty"` // force user and identity manifest generation on all clusters, even if no permissions are specified
	Groups                    []string `yaml:"groups"`
	Selector                  Selector `yaml:"selector"`
	PermissionsPerClusterType `yaml:",inline,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL