Documentation ¶
Index ¶
- Variables
- func Decode(manifest string) runtime.Object
- func GroupVersionKind(o runtime.Object) schema.GroupVersionKind
- func ID(o runtime.Object) string
- func Initialize(o runtime.Object, namespace, name string, visitors ...func(o runtime.Object))
- func Labels(o runtime.Object) map[string]string
- func Meta(o runtime.Object) metav1.Object
- func NamespacedName(o client.Object) types.NamespacedName
- func NewClusterRole(name string, rules ...rbacv1.PolicyRule) *rbacv1.ClusterRole
- func NewClusterRoleBinding(name string, roleRef rbacv1.RoleRef, subjects ...rbacv1.Subject) *rbacv1.ClusterRoleBinding
- func NewConfigMap(namespace, name string, data map[string]string, ...) *corev1.ConfigMap
- func NewContainer(name string, image string, pullPolicy corev1.PullPolicy, ...) *corev1.Container
- func NewDaemonSet(namespace, name string, visitors ...func(o runtime.Object)) *appsv1.DaemonSet
- func NewDeployment(namespace, name string, visitors ...func(o runtime.Object)) *appsv1.Deployment
- func NewLogFileMetricExporter(namespace, name string) *loggingv1alpha1.LogFileMetricExporter
- func NewNamespace(name string) *corev1.Namespace
- func NewPod(namespace, name string, containers ...corev1.Container) *corev1.Pod
- func NewPolicyRule(apiGroups, resources, resourceNames, verbs []string) rbacv1.PolicyRule
- func NewPolicyRules(rules ...rbacv1.PolicyRule) []rbacv1.PolicyRule
- func NewPriorityClass(name string, priorityValue int32, globalDefault bool, description string) *scheduling.PriorityClass
- func NewPrometheusRule(namespace, ruleName string) *monitoringv1.PrometheusRule
- func NewPrometheusRuleSpecFrom(groups string) (*monitoringv1.PrometheusRuleSpec, error)
- func NewRole(namespace, name string, rules ...rbacv1.PolicyRule) *rbacv1.Role
- func NewRoleBinding(namespace, name string, roleRef rbacv1.RoleRef, subjects ...rbacv1.Subject) *rbacv1.RoleBinding
- func NewRoute(namespace, name, service, port string) *openshiftv1.Route
- func NewSCC(name string) *security.SecurityContextConstraints
- func NewSecret(namespace, name string, data map[string][]byte, ...) *corev1.Secret
- func NewService(namespace, name string, visitors ...func(o runtime.Object)) *corev1.Service
- func NewServiceAccount(namespace, name string) *corev1.ServiceAccount
- func NewServiceMonitor(namespace, name string) *monitoringv1.ServiceMonitor
- func NewSubject(kind, name string) rbacv1.Subject
- func NewSubjects(subjects ...rbacv1.Subject) []rbacv1.Subject
- func Selectors(instanceName, component, name string) map[string]string
- func ServiceDomainName(o runtime.Object) string
- func SetCommonLabels(object runtime.Object, name, instanceName, component string)
- func SvcClusterLocal(namespace, name string) string
- type ConfigMapBuilder
- type ContainerBuilder
- func (builder *ContainerBuilder) AddContainerPort(name string, port int32) *ContainerBuilder
- func (builder *ContainerBuilder) AddEnvVar(name, value string) *ContainerBuilder
- func (builder *ContainerBuilder) AddEnvVarFromFieldRef(name, fieldRef string) *ContainerBuilder
- func (builder *ContainerBuilder) AddRunAsUser(uid int64) *ContainerBuilder
- func (builder *ContainerBuilder) AddVolumeMount(name, path, subPath string, readonly bool) *ContainerBuilder
- func (builder *ContainerBuilder) End() *PodBuilder
- func (builder *ContainerBuilder) ResourceRequirements(resources corev1.ResourceRequirements) *ContainerBuilder
- func (builder *ContainerBuilder) Update() *PodBuilder
- func (builder *ContainerBuilder) WithCmd(cmdAgrgs []string) *ContainerBuilder
- func (builder *ContainerBuilder) WithCmdArgs(cmdArgs []string) *ContainerBuilder
- func (builder *ContainerBuilder) WithImage(image string) *ContainerBuilder
- func (builder *ContainerBuilder) WithImagePullPolicy(policy corev1.PullPolicy) *ContainerBuilder
- func (builder *ContainerBuilder) WithPodSecurity() *ContainerBuilder
- func (builder *ContainerBuilder) WithPrivilege() *ContainerBuilder
- type DaemonSetBuilder
- func (builder *DaemonSetBuilder) WithPodSpec(podSpec core.PodSpec) *DaemonSetBuilder
- func (builder *DaemonSetBuilder) WithSelector(selector map[string]string) *DaemonSetBuilder
- func (builder *DaemonSetBuilder) WithTemplateAnnotations(annotations map[string]string) *DaemonSetBuilder
- func (builder *DaemonSetBuilder) WithTemplateLabels(labels map[string]string) *DaemonSetBuilder
- func (builder *DaemonSetBuilder) WithUpdateStrategy(updateStrategy apps.DaemonSetUpdateStrategy) *DaemonSetBuilder
- type DeploymentBuilder
- func (builder *DeploymentBuilder) WithPodSpec(podSpec core.PodSpec) *DeploymentBuilder
- func (builder *DeploymentBuilder) WithReplicas(replicas *int32) *DeploymentBuilder
- func (builder *DeploymentBuilder) WithSelector(selector map[string]string) *DeploymentBuilder
- func (builder *DeploymentBuilder) WithTemplateAnnotations(annotations map[string]string) *DeploymentBuilder
- func (builder *DeploymentBuilder) WithTemplateLabels(labels map[string]string) *DeploymentBuilder
- func (builder *DeploymentBuilder) WithUpdateStrategy(updateStrategy apps.DeploymentStrategy) *DeploymentBuilder
- type Object
- type PodBuilder
- func (builder *PodBuilder) AddAnnotation(key, value string) *PodBuilder
- func (builder *PodBuilder) AddConfigMapVolume(name, configMapName string) *PodBuilder
- func (builder *PodBuilder) AddConfigMapVolumeWithPermissions(name, configMapName string, permissions *int32) *PodBuilder
- func (builder *PodBuilder) AddConfigMapWith(name, configMapName string, handler func(corev1.Volume) corev1.Volume) *PodBuilder
- func (builder *PodBuilder) AddContainer(name, image string) *ContainerBuilder
- func (builder *PodBuilder) AddEmptyDirVolume(name string) *PodBuilder
- func (builder *PodBuilder) AddHostAlias(hostAlias corev1.HostAlias) *PodBuilder
- func (builder *PodBuilder) AddHostPathVolume(name, path string) *PodBuilder
- func (builder *PodBuilder) AddInitContainer(name, image string) *ContainerBuilder
- func (builder *PodBuilder) AddLabels(labels map[string]string) *PodBuilder
- func (builder *PodBuilder) AddSecretVolume(name, secretName string) *PodBuilder
- func (builder *PodBuilder) GetContainer(name string) *ContainerBuilder
- func (builder *PodBuilder) WithLabels(labels map[string]string) *PodBuilder
- type PodBuilderVisitor
- type ServiceBuilder
- func (builder *ServiceBuilder) AddLabel(key, val string) *ServiceBuilder
- func (builder *ServiceBuilder) AddServicePort(port int32, targetPort int) *ServiceBuilder
- func (builder *ServiceBuilder) WithSelector(selector map[string]string) *ServiceBuilder
- func (builder *ServiceBuilder) WithServicePort(servicePorts []corev1.ServicePort) *ServiceBuilder
Constants ¶
This section is empty.
Variables ¶
var Codecs = serializer.NewCodecFactory(scheme.Scheme)
Codecs is a codec factory for the default scheme, including core and our custom types.
Functions ¶
func GroupVersionKind ¶
func GroupVersionKind(o runtime.Object) schema.GroupVersionKind
GroupVersionKind deduces the Kind from the Go type.
func Initialize ¶
Initialize sets name, namespace and type metadata deduced from Go type.
func Meta ¶
Meta interface to get/set object metadata. Panics if o is not a metav1.Object, e.g. if it is a List type.
func NamespacedName ¶
func NamespacedName(o client.Object) types.NamespacedName
NamespacedName returns the namespaced name of an object.
func NewClusterRole ¶
func NewClusterRole(name string, rules ...rbacv1.PolicyRule) *rbacv1.ClusterRole
NewClusterRole returns a role with namespace, names, rules
func NewClusterRoleBinding ¶
func NewClusterRoleBinding(name string, roleRef rbacv1.RoleRef, subjects ...rbacv1.Subject) *rbacv1.ClusterRoleBinding
NewClusterRoleBinding returns a role with namespace, names, rules
func NewConfigMap ¶
func NewConfigMap(namespace, name string, data map[string]string, visitors ...func(o runtime.Object)) *corev1.ConfigMap
NewConfigMap returns a corev1.ConfigMap with namespace, name and data.
func NewContainer ¶
func NewContainer(name string, image string, pullPolicy corev1.PullPolicy, resources *corev1.ResourceRequirements) *corev1.Container
NewContainer stubs an instance of a corev1.Container
func NewDaemonSet ¶
NewDaemonSet returns a daemon set.
func NewDeployment ¶
func NewDeployment(namespace, name string, visitors ...func(o runtime.Object)) *appsv1.Deployment
NewDeployment returns a deployment
func NewLogFileMetricExporter ¶
func NewLogFileMetricExporter(namespace, name string) *loggingv1alpha1.LogFileMetricExporter
Returns a new default LogFileMetricExporter
func NewNamespace ¶
NewNamespace returns a corev1.Namespace with name.
func NewPolicyRule ¶
func NewPolicyRule(apiGroups, resources, resourceNames, verbs []string) rbacv1.PolicyRule
NewPolicyRule stubs policy rule
func NewPolicyRules ¶
func NewPolicyRules(rules ...rbacv1.PolicyRule) []rbacv1.PolicyRule
NewPolicyRules stubs policy rules
func NewPriorityClass ¶
func NewPriorityClass(name string, priorityValue int32, globalDefault bool, description string) *scheduling.PriorityClass
NewPriorityClass is a constructor to create a PriorityClass
func NewPrometheusRule ¶
func NewPrometheusRule(namespace, ruleName string) *monitoringv1.PrometheusRule
func NewPrometheusRuleSpecFrom ¶
func NewPrometheusRuleSpecFrom(groups string) (*monitoringv1.PrometheusRuleSpec, error)
func NewRole ¶
func NewRole(namespace, name string, rules ...rbacv1.PolicyRule) *rbacv1.Role
NewRole returns a role with namespace, names, rules
func NewRoleBinding ¶
func NewRoleBinding(namespace, name string, roleRef rbacv1.RoleRef, subjects ...rbacv1.Subject) *rbacv1.RoleBinding
NewRoleBinding returns a role with namespace, names, rules
func NewRoute ¶
func NewRoute(namespace, name, service, port string) *openshiftv1.Route
NewRoute returns an openshift.io/v1.Route with namespace and name to port on service.
func NewSCC ¶
func NewSCC(name string) *security.SecurityContextConstraints
func NewSecret ¶
func NewSecret(namespace, name string, data map[string][]byte, visitors ...func(o runtime.Object)) *corev1.Secret
NewSecret returns a corev1.Secret with namespace and name.
func NewService ¶
NewService returns a corev1.Service with namespace and name.
func NewServiceAccount ¶
func NewServiceAccount(namespace, name string) *corev1.ServiceAccount
NewServiceAccount returns a corev1.ServiceAccount with namespace and name.
func NewServiceMonitor ¶
func NewServiceMonitor(namespace, name string) *monitoringv1.ServiceMonitor
func NewSubjects ¶
NewSubjects stubs subjects
func ServiceDomainName ¶
ServiceDomainName returns "name.namespace.svc".
func SetCommonLabels ¶
SetCommonLabels initialize given object labels with K8s Common labels These are recommended labels. They make it easier to manage applications but aren't required for any core tooling. https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
func SvcClusterLocal ¶
SvcClusterLocal returns the svc.cluster.local hostname for name and namespace.
Types ¶
type ConfigMapBuilder ¶
func NewConfigMapBuilder ¶
func NewConfigMapBuilder(cm *corev1.ConfigMap) *ConfigMapBuilder
func (*ConfigMapBuilder) Add ¶
func (builder *ConfigMapBuilder) Add(key, value string) *ConfigMapBuilder
func (*ConfigMapBuilder) AddAnnotation ¶
func (builder *ConfigMapBuilder) AddAnnotation(key, value string) *ConfigMapBuilder
func (*ConfigMapBuilder) AddLabel ¶
func (builder *ConfigMapBuilder) AddLabel(key, value string) *ConfigMapBuilder
type ContainerBuilder ¶
type ContainerBuilder struct {
// contains filtered or unexported fields
}
func (*ContainerBuilder) AddContainerPort ¶
func (builder *ContainerBuilder) AddContainerPort(name string, port int32) *ContainerBuilder
func (*ContainerBuilder) AddEnvVar ¶
func (builder *ContainerBuilder) AddEnvVar(name, value string) *ContainerBuilder
func (*ContainerBuilder) AddEnvVarFromFieldRef ¶
func (builder *ContainerBuilder) AddEnvVarFromFieldRef(name, fieldRef string) *ContainerBuilder
func (*ContainerBuilder) AddRunAsUser ¶
func (builder *ContainerBuilder) AddRunAsUser(uid int64) *ContainerBuilder
func (*ContainerBuilder) AddVolumeMount ¶
func (builder *ContainerBuilder) AddVolumeMount(name, path, subPath string, readonly bool) *ContainerBuilder
func (*ContainerBuilder) End ¶
func (builder *ContainerBuilder) End() *PodBuilder
func (*ContainerBuilder) ResourceRequirements ¶
func (builder *ContainerBuilder) ResourceRequirements(resources corev1.ResourceRequirements) *ContainerBuilder
func (*ContainerBuilder) Update ¶
func (builder *ContainerBuilder) Update() *PodBuilder
func (*ContainerBuilder) WithCmd ¶
func (builder *ContainerBuilder) WithCmd(cmdAgrgs []string) *ContainerBuilder
func (*ContainerBuilder) WithCmdArgs ¶
func (builder *ContainerBuilder) WithCmdArgs(cmdArgs []string) *ContainerBuilder
func (*ContainerBuilder) WithImage ¶
func (builder *ContainerBuilder) WithImage(image string) *ContainerBuilder
func (*ContainerBuilder) WithImagePullPolicy ¶
func (builder *ContainerBuilder) WithImagePullPolicy(policy corev1.PullPolicy) *ContainerBuilder
func (*ContainerBuilder) WithPodSecurity ¶
func (builder *ContainerBuilder) WithPodSecurity() *ContainerBuilder
func (*ContainerBuilder) WithPrivilege ¶
func (builder *ContainerBuilder) WithPrivilege() *ContainerBuilder
type DaemonSetBuilder ¶
func NewDaemonSetBuilder ¶
func NewDaemonSetBuilder(ds *apps.DaemonSet) *DaemonSetBuilder
func (*DaemonSetBuilder) WithPodSpec ¶
func (builder *DaemonSetBuilder) WithPodSpec(podSpec core.PodSpec) *DaemonSetBuilder
func (*DaemonSetBuilder) WithSelector ¶
func (builder *DaemonSetBuilder) WithSelector(selector map[string]string) *DaemonSetBuilder
func (*DaemonSetBuilder) WithTemplateAnnotations ¶
func (builder *DaemonSetBuilder) WithTemplateAnnotations(annotations map[string]string) *DaemonSetBuilder
func (*DaemonSetBuilder) WithTemplateLabels ¶
func (builder *DaemonSetBuilder) WithTemplateLabels(labels map[string]string) *DaemonSetBuilder
func (*DaemonSetBuilder) WithUpdateStrategy ¶
func (builder *DaemonSetBuilder) WithUpdateStrategy(updateStrategy apps.DaemonSetUpdateStrategy) *DaemonSetBuilder
type DeploymentBuilder ¶
type DeploymentBuilder struct {
Deployment *apps.Deployment
}
func NewDeploymentBuilder ¶
func NewDeploymentBuilder(ds *apps.Deployment) *DeploymentBuilder
func (*DeploymentBuilder) WithPodSpec ¶
func (builder *DeploymentBuilder) WithPodSpec(podSpec core.PodSpec) *DeploymentBuilder
func (*DeploymentBuilder) WithReplicas ¶
func (builder *DeploymentBuilder) WithReplicas(replicas *int32) *DeploymentBuilder
func (*DeploymentBuilder) WithSelector ¶
func (builder *DeploymentBuilder) WithSelector(selector map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) WithTemplateAnnotations ¶
func (builder *DeploymentBuilder) WithTemplateAnnotations(annotations map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) WithTemplateLabels ¶
func (builder *DeploymentBuilder) WithTemplateLabels(labels map[string]string) *DeploymentBuilder
func (*DeploymentBuilder) WithUpdateStrategy ¶
func (builder *DeploymentBuilder) WithUpdateStrategy(updateStrategy apps.DeploymentStrategy) *DeploymentBuilder
type PodBuilder ¶
func NewPodBuilder ¶
func NewPodBuilder(pod *corev1.Pod) *PodBuilder
func (*PodBuilder) AddAnnotation ¶
func (builder *PodBuilder) AddAnnotation(key, value string) *PodBuilder
func (*PodBuilder) AddConfigMapVolume ¶
func (builder *PodBuilder) AddConfigMapVolume(name, configMapName string) *PodBuilder
func (*PodBuilder) AddConfigMapVolumeWithPermissions ¶
func (builder *PodBuilder) AddConfigMapVolumeWithPermissions(name, configMapName string, permissions *int32) *PodBuilder
func (*PodBuilder) AddConfigMapWith ¶
func (builder *PodBuilder) AddConfigMapWith(name, configMapName string, handler func(corev1.Volume) corev1.Volume) *PodBuilder
func (*PodBuilder) AddContainer ¶
func (builder *PodBuilder) AddContainer(name, image string) *ContainerBuilder
func (*PodBuilder) AddEmptyDirVolume ¶
func (builder *PodBuilder) AddEmptyDirVolume(name string) *PodBuilder
func (*PodBuilder) AddHostAlias ¶
func (builder *PodBuilder) AddHostAlias(hostAlias corev1.HostAlias) *PodBuilder
func (*PodBuilder) AddHostPathVolume ¶
func (builder *PodBuilder) AddHostPathVolume(name, path string) *PodBuilder
func (*PodBuilder) AddInitContainer ¶
func (builder *PodBuilder) AddInitContainer(name, image string) *ContainerBuilder
func (*PodBuilder) AddLabels ¶
func (builder *PodBuilder) AddLabels(labels map[string]string) *PodBuilder
func (*PodBuilder) AddSecretVolume ¶
func (builder *PodBuilder) AddSecretVolume(name, secretName string) *PodBuilder
func (*PodBuilder) GetContainer ¶
func (builder *PodBuilder) GetContainer(name string) *ContainerBuilder
func (*PodBuilder) WithLabels ¶
func (builder *PodBuilder) WithLabels(labels map[string]string) *PodBuilder
type PodBuilderVisitor ¶
type PodBuilderVisitor func(builder *PodBuilder) error
PodBuilderVisitor provides the ability to manipulate the PodBuilder with custom logic
type ServiceBuilder ¶
func NewServiceBuilder ¶
func NewServiceBuilder(svc *corev1.Service) *ServiceBuilder
func (*ServiceBuilder) AddLabel ¶
func (builder *ServiceBuilder) AddLabel(key, val string) *ServiceBuilder
func (*ServiceBuilder) AddServicePort ¶
func (builder *ServiceBuilder) AddServicePort(port int32, targetPort int) *ServiceBuilder
func (*ServiceBuilder) WithSelector ¶
func (builder *ServiceBuilder) WithSelector(selector map[string]string) *ServiceBuilder
func (*ServiceBuilder) WithServicePort ¶
func (builder *ServiceBuilder) WithServicePort(servicePorts []corev1.ServicePort) *ServiceBuilder