resources

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClusterRole

func CreateClusterRole(name string, rules []rbacv1.PolicyRule, labels map[string]string) *rbacv1.ClusterRole

CreateClusterRole creates a cluster role

func CreateClusterRoleBinding

func CreateClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string, labels map[string]string) *rbacv1.ClusterRoleBinding

CreateClusterRoleBinding creates cluster role binding

func CreateConfigMap

func CreateConfigMap(name string, labels map[string]string) *corev1.ConfigMap

CreateConfigMap creates config map

func CreateDeployment

func CreateDeployment(name, namespace, matchKey, matchValue string, labels map[string]string, numReplicas int32, podSpec corev1.PodSpec, serviceAccount string) *appsv1.Deployment

CreateDeployment creates deployment

func CreateSecret

func CreateSecret(name string, labels map[string]string) *corev1.Secret

CreateSecret creates secret

func CreateService

func CreateService(name, matchKey, matchValue string, labels map[string]string) *corev1.Service

CreateService creates service

func ValidateGVKs

func ValidateGVKs(objects []runtime.Object)

ValidateGVKs makes sure all resources have initialized GVKs

func WithLabels

func WithLabels(labels map[string]string, existing map[string]string) map[string]string

WithLabels aggregates existing labels

Types

type ResourceBuilder

type ResourceBuilder struct {
	// contains filtered or unexported fields
}

ResourceBuilder helps in building k8s resources

func NewResourceBuilder

func NewResourceBuilder(commonLabels map[string]string, operatorLabels map[string]string) ResourceBuilder

NewResourceBuilder creates new ResourceBuilder

func (*ResourceBuilder) CreateAggregateClusterRole

func (b *ResourceBuilder) CreateAggregateClusterRole(name, aggregateTo string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole

CreateAggregateClusterRole creates aggregate cluster role

func (*ResourceBuilder) CreateClusterRole

func (b *ResourceBuilder) CreateClusterRole(name string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole

CreateClusterRole create cluster role

func (*ResourceBuilder) CreateClusterRoleBinding

func (b *ResourceBuilder) CreateClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.ClusterRoleBinding

CreateClusterRoleBinding creates cluster role binding

func (*ResourceBuilder) CreateConfigMap

func (b *ResourceBuilder) CreateConfigMap(name string) *corev1.ConfigMap

CreateConfigMap creates config map

func (*ResourceBuilder) CreateContainer

func (b *ResourceBuilder) CreateContainer(name, image, pullPolicy string) *corev1.Container

CreateContainer creates container

func (*ResourceBuilder) CreateDeployment

func (b *ResourceBuilder) CreateDeployment(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32, podSpec corev1.PodSpec) *appsv1.Deployment

CreateDeployment creates deployment

func (*ResourceBuilder) CreateOperatorClusterRole

func (b *ResourceBuilder) CreateOperatorClusterRole(name string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole

CreateOperatorClusterRole create operator cluster role

func (*ResourceBuilder) CreateOperatorClusterRoleBinding

func (b *ResourceBuilder) CreateOperatorClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.ClusterRoleBinding

CreateOperatorClusterRoleBinding creates operator cluster role binding

func (*ResourceBuilder) CreateOperatorDeployment

func (b *ResourceBuilder) CreateOperatorDeployment(name, namespace, matchKey, matchValue, serviceAccount string, numReplicas int32, podSpec corev1.PodSpec) *appsv1.Deployment

CreateOperatorDeployment creates deployment

func (*ResourceBuilder) CreateOperatorServiceAccount

func (b *ResourceBuilder) CreateOperatorServiceAccount(name, namespace string) *corev1.ServiceAccount

CreateOperatorServiceAccount creates service account

func (*ResourceBuilder) CreatePortsContainer

func (b *ResourceBuilder) CreatePortsContainer(name, image, pullPolicy string, ports []corev1.ContainerPort) *corev1.Container

CreatePortsContainer creates container with ports

func (*ResourceBuilder) CreateRole

func (b *ResourceBuilder) CreateRole(name string, rules []rbacv1.PolicyRule) *rbacv1.Role

CreateRole creates role

func (*ResourceBuilder) CreateRoleBinding

func (b *ResourceBuilder) CreateRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.RoleBinding

CreateRoleBinding creates role binding

func (*ResourceBuilder) CreateSecret

func (b *ResourceBuilder) CreateSecret(name string) *corev1.Secret

CreateSecret creates secret

func (*ResourceBuilder) CreateService

func (b *ResourceBuilder) CreateService(name, matchKey, matchValue string, additionalLabels map[string]string) *corev1.Service

CreateService creates service

func (*ResourceBuilder) CreateServiceAccount

func (b *ResourceBuilder) CreateServiceAccount(name string) *corev1.ServiceAccount

CreateServiceAccount creates service account

func (*ResourceBuilder) WithCommonLabels

func (b *ResourceBuilder) WithCommonLabels(labels map[string]string) map[string]string

WithCommonLabels aggregates common labels

func (*ResourceBuilder) WithOperatorLabels

func (b *ResourceBuilder) WithOperatorLabels(labels map[string]string) map[string]string

WithOperatorLabels aggregates operator labels

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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