Documentation ¶
Index ¶
- func CreateClusterRole(name string, rules []rbacv1.PolicyRule, labels map[string]string) *rbacv1.ClusterRole
- func CreateClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string, ...) *rbacv1.ClusterRoleBinding
- func CreateConfigMap(name string, labels map[string]string) *corev1.ConfigMap
- func CreateDeployment(name, namespace, matchKey, matchValue string, labels map[string]string, ...) *appsv1.Deployment
- func CreateSecret(name string, labels map[string]string) *corev1.Secret
- func CreateService(name, matchKey, matchValue string, labels map[string]string) *corev1.Service
- func ValidateGVKs(objects []runtime.Object)
- func WithLabels(labels map[string]string, existing map[string]string) map[string]string
- type ResourceBuilder
- func (b *ResourceBuilder) CreateAggregateClusterRole(name, aggregateTo string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole
- func (b *ResourceBuilder) CreateClusterRole(name string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole
- func (b *ResourceBuilder) CreateClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.ClusterRoleBinding
- func (b *ResourceBuilder) CreateConfigMap(name string) *corev1.ConfigMap
- func (b *ResourceBuilder) CreateContainer(name, image, pullPolicy string) *corev1.Container
- func (b *ResourceBuilder) CreateDeployment(name, namespace, matchKey, matchValue, serviceAccount string, ...) *appsv1.Deployment
- func (b *ResourceBuilder) CreateOperatorClusterRole(name string, policyRules []rbacv1.PolicyRule) *rbacv1.ClusterRole
- func (b *ResourceBuilder) CreateOperatorClusterRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.ClusterRoleBinding
- func (b *ResourceBuilder) CreateOperatorDeployment(name, namespace, matchKey, matchValue, serviceAccount string, ...) *appsv1.Deployment
- func (b *ResourceBuilder) CreateOperatorServiceAccount(name, namespace string) *corev1.ServiceAccount
- func (b *ResourceBuilder) CreatePortsContainer(name, image, pullPolicy string, ports []corev1.ContainerPort) *corev1.Container
- func (b *ResourceBuilder) CreateRole(name string, rules []rbacv1.PolicyRule) *rbacv1.Role
- func (b *ResourceBuilder) CreateRoleBinding(name, roleRef, serviceAccount, serviceAccountNamespace string) *rbacv1.RoleBinding
- func (b *ResourceBuilder) CreateSecret(name string) *corev1.Secret
- func (b *ResourceBuilder) CreateService(name, matchKey, matchValue string, additionalLabels map[string]string) *corev1.Service
- func (b *ResourceBuilder) CreateServiceAccount(name string) *corev1.ServiceAccount
- func (b *ResourceBuilder) WithCommonLabels(labels map[string]string) map[string]string
- func (b *ResourceBuilder) WithOperatorLabels(labels map[string]string) map[string]string
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 ¶
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 ¶
CreateSecret creates secret
func CreateService ¶
CreateService creates service
func ValidateGVKs ¶
ValidateGVKs makes sure all resources have initialized GVKs
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