Documentation ¶
Index ¶
- Constants
- func CreateManageSecretRole(appName, roleName string, secretNames []string, ...) *auth.Role
- func GetRoleBindingGroups(groups []string) []auth.Subject
- func GetRolebindingToClusterRole(appName, roleName string, groups []string) *auth.RoleBinding
- func GetRolebindingToClusterRoleForServiceAccountWithLabels(roleName, serviceAccountName, serviceAccountNamespace string, ...) *auth.RoleBinding
- func GetRolebindingToClusterRoleWithLabels(roleName string, groups []string, labels map[string]string) *auth.RoleBinding
- func GetRolebindingToRole(appName, roleName string, groups []string) *auth.RoleBinding
- func GetRolebindingToRoleForServiceAccountWithLabels(roleName, serviceAccountName, serviceAccountNamespace string, ...) *auth.RoleBinding
- func GetRolebindingToRoleWithLabels(roleName string, groups []string, labels map[string]string) *auth.RoleBinding
- type Kube
- func (k *Kube) ApplyClusterRole(clusterrole *auth.ClusterRole) error
- func (k *Kube) ApplyClusterRoleBinding(clusterrolebinding *auth.ClusterRoleBinding) error
- func (k *Kube) ApplyClusterRoleToServiceAccount(roleName string, serviceAccount *corev1.ServiceAccount, ...) error
- func (kube *Kube) ApplyDeployment(namespace string, deployment *v1beta1.Deployment) error
- func (kube *Kube) ApplyIngress(namespace string, ingress *v1beta1.Ingress) error
- func (k *Kube) ApplyLimitRange(namespace string, limitRange *corev1.LimitRange) error
- func (kube *Kube) ApplyNamespace(name string, labels map[string]string, ownerRefs []metav1.OwnerReference) error
- func (k *Kube) ApplyRole(namespace string, role *auth.Role) error
- func (k *Kube) ApplyRoleBinding(namespace string, role *auth.RoleBinding) error
- func (k *Kube) ApplySecret(namespace string, secret *corev1.Secret) (savedSecret *corev1.Secret, err error)
- func (k *Kube) ApplyService(namespace string, service *corev1.Service) error
- func (kube *Kube) ApplyServiceAccount(serviceAccountName, namespace string) (*corev1.ServiceAccount, error)
- func (k *Kube) BuildLimitRange(namespace, name, appName string, ...) *corev1.LimitRange
- func (kube *Kube) GetClusterName() (string, error)
- func (k *Kube) GetClusterRole(name string) (*auth.ClusterRole, error)
- func (kube *Kube) GetConfigMap(namespace, name string) (*corev1.ConfigMap, error)
- func (kube *Kube) GetContainerRegistry() (string, error)
- func (kube *Kube) GetRadixDeployment(namespace, name string) (*v1.RadixDeployment, error)
- func (kube *Kube) GetRegistration(name string) (*v1.RadixRegistration, error)
- func (k *Kube) GetRole(namespace, name string) (*auth.Role, error)
- func (k *Kube) GetSecret(namespace, name string) (*corev1.Secret, error)
- func (k *Kube) ListClusterRoleBindings(namespace string) ([]*auth.ClusterRoleBinding, error)
- func (k *Kube) ListClusterRoles(namespace string) ([]*auth.ClusterRole, error)
- func (kube *Kube) ListDeployments(namespace string) ([]*v1beta1.Deployment, error)
- func (kube *Kube) ListIngresses(namespace string) ([]*v1beta1.Ingress, error)
- func (kube *Kube) ListIngressesWithSelector(namespace string, labelSelectorString *string) ([]*v1beta1.Ingress, error)
- func (kube *Kube) ListRadixDeployments(namespace string) ([]*v1.RadixDeployment, error)
- func (kube *Kube) ListRegistrations() ([]*v1.RadixRegistration, error)
- func (k *Kube) ListRoleBindings(namespace string) ([]*auth.RoleBinding, error)
- func (k *Kube) ListRoleBindingsWithSelector(namespace string, labelSelectorString *string) ([]*auth.RoleBinding, error)
- func (k *Kube) ListRoles(namespace string) ([]*auth.Role, error)
- func (k *Kube) ListRolesWithSelector(namespace string, labelSelectorString *string) ([]*auth.Role, error)
- func (k *Kube) ListSecrets(namespace string) ([]*v1.Secret, error)
- func (k *Kube) ListSecretsWithSelector(namespace string, labelSelectorString *string) ([]*v1.Secret, error)
- func (k *Kube) ListServices(namespace string) ([]*corev1.Service, error)
- func (k *Kube) SecretExists(namespace, secretName string) bool
- func (kube *Kube) WaitForCompletionOf(job *batchv1.Job) error
- type NamespaceWatcher
- type NamespaceWatcherImpl
Constants ¶
const ( RadixBranchAnnotation = "radix-branch" RadixComponentImagesAnnotation = "radix-component-images" RadixUpdateTimeAnnotation = "radix-update-time" // See https://github.com/equinor/radix-velero-plugin/blob/master/velero-plugins/deployment/restore.go RestoredStatusAnnotation = "equinor.com/velero-restored-status" )
Radix Annotations
const ( RadixAppLabel = "radix-app" RadixEnvLabel = "radix-env" RadixComponentLabel = "radix-component" RadixJobNameLabel = "radix-job-name" RadixBuildLabel = "radix-build" RadixCommitLabel = "radix-commit" RadixImageTagLabel = "radix-image-tag" RadixJobTypeLabel = "radix-job-type" RadixJobTypeJob = "job" // Outer job RadixJobTypeBuild = "build" RadixJobTypeCloneConfig = "clone-config" RadixAppAliasLabel = "radix-app-alias" RadixExternalAliasLabel = "radix-app-external-alias" RadixActiveClusterAliasLabel = "radix-app-active-cluster-alias" // Only for backward compatibility RadixBranchDeprecated = "radix-branch" )
Radix Labels
Variables ¶
This section is empty.
Functions ¶
func CreateManageSecretRole ¶ added in v1.3.0
func CreateManageSecretRole(appName, roleName string, secretNames []string, customLabels *map[string]string) *auth.Role
CreateManageSecretRole creates a role that can manage a secret with predifined set of verbs
func GetRoleBindingGroups ¶
GetRoleBindingGroups Get subjects for list of ad groups
func GetRolebindingToClusterRole ¶ added in v1.3.0
func GetRolebindingToClusterRole(appName, roleName string, groups []string) *auth.RoleBinding
GetRolebindingToClusterRole Get role binding object
func GetRolebindingToClusterRoleForServiceAccountWithLabels ¶ added in v1.3.0
func GetRolebindingToClusterRoleForServiceAccountWithLabels(roleName, serviceAccountName, serviceAccountNamespace string, labels map[string]string) *auth.RoleBinding
GetRolebindingToClusterRoleForServiceAccountWithLabels Get role binding object
func GetRolebindingToClusterRoleWithLabels ¶ added in v1.3.0
func GetRolebindingToClusterRoleWithLabels(roleName string, groups []string, labels map[string]string) *auth.RoleBinding
GetRolebindingToClusterRoleWithLabels Get role binding object
func GetRolebindingToRole ¶ added in v1.3.0
func GetRolebindingToRole(appName, roleName string, groups []string) *auth.RoleBinding
GetRolebindingToRole Get role binding object
func GetRolebindingToRoleForServiceAccountWithLabels ¶ added in v1.3.0
func GetRolebindingToRoleForServiceAccountWithLabels(roleName, serviceAccountName, serviceAccountNamespace string, labels map[string]string) *auth.RoleBinding
GetRolebindingToRoleForServiceAccountWithLabels Get role binding object
func GetRolebindingToRoleWithLabels ¶ added in v1.3.0
func GetRolebindingToRoleWithLabels(roleName string, groups []string, labels map[string]string) *auth.RoleBinding
GetRolebindingToRoleWithLabels Get role binding object
Types ¶
type Kube ¶
type Kube struct { RrLister v1Lister.RadixRegistrationLister RdLister v1Lister.RadixDeploymentLister NamespaceLister coreListers.NamespaceLister ConfigMapLister coreListers.ConfigMapLister SecretLister coreListers.SecretLister DeploymentLister extensionListers.DeploymentLister IngressLister extensionListers.IngressLister ServiceLister coreListers.ServiceLister RoleBindingLister rbacListers.RoleBindingLister ClusterRoleBindingLister rbacListers.ClusterRoleBindingLister RoleLister rbacListers.RoleLister ClusterRoleLister rbacListers.ClusterRoleLister ServiceAccountLister coreListers.ServiceAccountLister LimitRangeLister coreListers.LimitRangeLister // contains filtered or unexported fields }
Kube Stuct for accessing lower level kubernetes functions
func New ¶
func New(client kubernetes.Interface, radixClient radixclient.Interface) (*Kube, error)
New Constructor
func NewWithListers ¶
func NewWithListers(client kubernetes.Interface, radixclient radixclient.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, radixInformerFactory informers.SharedInformerFactory) (*Kube, error)
NewWithListers Constructor
func (*Kube) ApplyClusterRole ¶
func (k *Kube) ApplyClusterRole(clusterrole *auth.ClusterRole) error
ApplyClusterRole Creates or updates cluster-role
func (*Kube) ApplyClusterRoleBinding ¶
func (k *Kube) ApplyClusterRoleBinding(clusterrolebinding *auth.ClusterRoleBinding) error
ApplyClusterRoleBinding Creates or updates cluster-role-binding
func (*Kube) ApplyClusterRoleToServiceAccount ¶
func (k *Kube) ApplyClusterRoleToServiceAccount(roleName string, serviceAccount *corev1.ServiceAccount, ownerReference []metav1.OwnerReference) error
ApplyClusterRoleToServiceAccount Creates cluster-role-binding as a link between role and service account
func (*Kube) ApplyDeployment ¶
func (kube *Kube) ApplyDeployment(namespace string, deployment *v1beta1.Deployment) error
ApplyDeployment Create or update deployment in provided namespace
func (*Kube) ApplyIngress ¶
ApplyIngress Will create or update ingress in provided namespace
func (*Kube) ApplyLimitRange ¶
func (k *Kube) ApplyLimitRange(namespace string, limitRange *corev1.LimitRange) error
ApplyLimitRange Applies limit range to namespace
func (*Kube) ApplyNamespace ¶
func (kube *Kube) ApplyNamespace(name string, labels map[string]string, ownerRefs []metav1.OwnerReference) error
ApplyNamespace Creates a new namespace, if not exists allready
func (*Kube) ApplyRoleBinding ¶
func (k *Kube) ApplyRoleBinding(namespace string, role *auth.RoleBinding) error
ApplyRoleBinding Creates or updates role
func (*Kube) ApplySecret ¶
func (k *Kube) ApplySecret(namespace string, secret *corev1.Secret) (savedSecret *corev1.Secret, err error)
ApplySecret Creates or updates secret to namespace
func (*Kube) ApplyService ¶ added in v1.4.1
ApplyService Will create or update service in provided namespace
func (*Kube) ApplyServiceAccount ¶
func (kube *Kube) ApplyServiceAccount(serviceAccountName, namespace string) (*corev1.ServiceAccount, error)
ApplyServiceAccount Creates or updates service account
func (*Kube) BuildLimitRange ¶
func (k *Kube) BuildLimitRange(namespace, name, appName string, defaultResourceCPU, defaultResourceMemory, defaultRequestCPU, defaultRequestMemory resource.Quantity) *corev1.LimitRange
BuildLimitRange Builds a limit range spec
func (*Kube) GetClusterName ¶
GetClusterName Gets the global name of the cluster from config map in default namespace
func (*Kube) GetClusterRole ¶ added in v1.4.2
func (k *Kube) GetClusterRole(name string) (*auth.ClusterRole, error)
GetClusterRole Gets cluster role
func (*Kube) GetConfigMap ¶
GetConfigMap Gets config map by name
func (*Kube) GetContainerRegistry ¶
GetContainerRegistry Gets the container registry from config map in default namespace
func (*Kube) GetRadixDeployment ¶
func (kube *Kube) GetRadixDeployment(namespace, name string) (*v1.RadixDeployment, error)
GetRadixDeployment Gets deployment using lister if present
func (*Kube) GetRegistration ¶
func (kube *Kube) GetRegistration(name string) (*v1.RadixRegistration, error)
GetRegistration Gets registration using lister if present
func (*Kube) ListClusterRoleBindings ¶ added in v1.4.2
func (k *Kube) ListClusterRoleBindings(namespace string) ([]*auth.ClusterRoleBinding, error)
ListClusterRoleBindings List cluster roles
func (*Kube) ListClusterRoles ¶ added in v1.4.2
func (k *Kube) ListClusterRoles(namespace string) ([]*auth.ClusterRole, error)
ListClusterRoles List cluster roles
func (*Kube) ListDeployments ¶ added in v1.4.2
func (kube *Kube) ListDeployments(namespace string) ([]*v1beta1.Deployment, error)
ListDeployments List deployments
func (*Kube) ListIngresses ¶ added in v1.4.0
ListIngresses lists ingresses
func (*Kube) ListIngressesWithSelector ¶ added in v1.4.0
func (kube *Kube) ListIngressesWithSelector(namespace string, labelSelectorString *string) ([]*v1beta1.Ingress, error)
ListIngressesWithSelector lists ingresses
func (*Kube) ListRadixDeployments ¶
func (kube *Kube) ListRadixDeployments(namespace string) ([]*v1.RadixDeployment, error)
ListRadixDeployments Gets deployments using lister if present
func (*Kube) ListRegistrations ¶
func (kube *Kube) ListRegistrations() ([]*v1.RadixRegistration, error)
ListRegistrations lists registrations
func (*Kube) ListRoleBindings ¶ added in v1.4.1
func (k *Kube) ListRoleBindings(namespace string) ([]*auth.RoleBinding, error)
ListRoleBindings Lists role bindings from cache or from cluster
func (*Kube) ListRoleBindingsWithSelector ¶ added in v1.4.1
func (k *Kube) ListRoleBindingsWithSelector(namespace string, labelSelectorString *string) ([]*auth.RoleBinding, error)
ListRoleBindingsWithSelector Lists role bindings from cache or from cluster using a selector
func (*Kube) ListRolesWithSelector ¶ added in v1.4.2
func (k *Kube) ListRolesWithSelector(namespace string, labelSelectorString *string) ([]*auth.Role, error)
ListRolesWithSelector List roles
func (*Kube) ListSecrets ¶ added in v1.4.3
ListSecrets secrets in namespace
func (*Kube) ListSecretsWithSelector ¶ added in v1.4.3
func (k *Kube) ListSecretsWithSelector(namespace string, labelSelectorString *string) ([]*v1.Secret, error)
ListSecretsWithSelector secrets in namespace
func (*Kube) ListServices ¶ added in v1.4.1
ListServices Lists services from cache or from cluster
func (*Kube) SecretExists ¶
SecretExists Checks if secret allready exists
type NamespaceWatcher ¶
NamespaceWatcher Watcher to wait for namespace to be created
type NamespaceWatcherImpl ¶
type NamespaceWatcherImpl struct {
// contains filtered or unexported fields
}
NamespaceWatcherImpl Implementation of watcher
func NewNamespaceWatcherImpl ¶
func NewNamespaceWatcherImpl(client kubernetes.Interface) NamespaceWatcherImpl
NewNamespaceWatcherImpl Constructor
func (NamespaceWatcherImpl) WaitFor ¶
func (watcher NamespaceWatcherImpl) WaitFor(namespace string) error
WaitFor Waits for namespace to appear