Documentation
¶
Index ¶
- type ConfigMap
- func (c *ConfigMap) AddData(key string, value string) *ConfigMap
- func (c *ConfigMap) Build() *corev1.ConfigMap
- func (c *ConfigMap) SetAnnotations(annotations map[string]string) *ConfigMap
- func (c *ConfigMap) SetData(data map[string]string) *ConfigMap
- func (c *ConfigMap) SetImmutable() *ConfigMap
- func (c *ConfigMap) SetLabels(labels map[string]string) *ConfigMap
- func (c *ConfigMap) SetNamespace(namespace string) *ConfigMap
- func (c *ConfigMap) ToYaml() []byte
- type Container
- type Namespace
- type Pod
- func (p *Pod) AddContainer(container corev1.Container) *Pod
- func (p *Pod) Build() *corev1.Pod
- func (p *Pod) BuildTemplate() *corev1.PodTemplateSpec
- func (p *Pod) SetAnnotations(annotations map[string]string) *Pod
- func (p *Pod) SetLabels(labels map[string]string) *Pod
- func (p *Pod) SetNamespace(namespace string) *Pod
- func (p *Pod) ToYaml() []byte
- type Ports
- type Secret
- func (s *Secret) Build() *corev1.Secret
- func (s *Secret) SetAnnotations(annotations map[string]string) *Secret
- func (s *Secret) SetData(data map[string][]byte) *Secret
- func (s *Secret) SetImmutable() *Secret
- func (s *Secret) SetLabels(labels map[string]string) *Secret
- func (s *Secret) SetNamespace(namespace string) *Secret
- func (s *Secret) SetStringData(data map[string]string) *Secret
- func (s *Secret) SetType(secretType corev1.SecretType) *Secret
- func (s *Secret) ToYaml() []byte
- type Service
- func (s *Service) AddPorts(ports *corev1.ServicePort) *Service
- func (s *Service) Build() (*corev1.Service, error)
- func (s *Service) SetAnnotations(annotations map[string]string) *Service
- func (s *Service) SetClusterIP(clusterIP string) *Service
- func (s *Service) SetExternalName(externalName string) *Service
- func (s *Service) SetLabels(labels map[string]string) *Service
- func (s *Service) SetNamespace(namespace string) *Service
- func (s *Service) SetSelector(selector map[string]string) *Service
- func (s *Service) SetType(t corev1.ServiceType) *Service
- func (s *Service) ToYaml() []byte
- func (s *Service) Validate() error
- type ServiceAccount
- func (sa *ServiceAccount) Build() *corev1.ServiceAccount
- func (sa *ServiceAccount) SetAnnotations(annotations map[string]string) *ServiceAccount
- func (sa *ServiceAccount) SetLabels(labels map[string]string) *ServiceAccount
- func (sa *ServiceAccount) SetNamespace(namespace string) *ServiceAccount
- func (sa *ServiceAccount) ToYaml() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMap ¶
type ConfigMap struct { Name string Namespace string Labels map[string]string Annotations map[string]string Data map[string]string Immutable bool ConfigMap *corev1.ConfigMap }
ConfigMap struct for configmap kubernetes resource
func NewConfigMapBuilder ¶
NewConfigMapBuilder return a ConfigMap Immutable is false for default
func (*ConfigMap) SetAnnotations ¶
SetAnnotations set labels in the configmap
func (*ConfigMap) SetImmutable ¶
SetImmutable set the configmap immutable
func (*ConfigMap) SetNamespace ¶
SetNamespace set the configmap namespace
type Container ¶
type Container struct { Name string Image string Tag string Port int32 Container *corev1.Container }
Container Struct for containers
func NewContainerBuilder ¶
func NewContainerBuilder() Container
NewContainerBuilder return a container struct
type Namespace ¶
type Namespace struct { Name string Labels map[string]string Annotations map[string]string Namespace *corev1.Namespace }
Namespace is the struct for namespace
func NewNamespaceBuilder ¶
NewNamespaceBuilder return a namespace builder
func (*Namespace) SetAnnotations ¶
SetAnnotations sets annotations of a namespace
type Pod ¶
type Pod struct { Name string Namespace string Labels map[string]string Annotations map[string]string Containers []corev1.Container Pod *corev1.Pod PodTemplate *corev1.PodTemplateSpec }
Pod is the base for work with Pods
func (*Pod) AddContainer ¶
AddContainer Add new container to deployment
func (*Pod) BuildTemplate ¶
func (p *Pod) BuildTemplate() *corev1.PodTemplateSpec
BuildTemplate build pod template
func (*Pod) SetAnnotations ¶
SetAnnotations Set Annotations for deployment
func (*Pod) SetNamespace ¶
SetNamespace Set namespace for deployment
type Ports ¶
type Ports struct { Name string Port int32 Protocol corev1.Protocol TargetPort intstr.IntOrString NodePort int32 ServicePort *corev1.ServicePort }
Ports ports struct for service ports
func (*Ports) SetNodePort ¶
SetNodePort set Node port for service port
func (*Ports) SetProtocol ¶
SetProtocol set protocol of the service port
func (*Ports) SetTargetPort ¶
SetTargetPort set target port for service port
type Secret ¶
type Secret struct { Name string Namespace string Labels map[string]string Annotations map[string]string Data map[string][]byte StringData map[string]string Immutable bool Type corev1.SecretType Secret *corev1.Secret }
Secret struct for secret
func NewSecretBuilder ¶
NewSecretBuilder get a sercret builder
func (*Secret) SetAnnotations ¶
SetAnnotations set labels in the configmap
func (*Secret) SetImmutable ¶
SetImmutable set to immutable the secret
func (*Secret) SetNamespace ¶
SetNamespace set the namespace of the secret
func (*Secret) SetStringData ¶
SetStringData set data in the secret
type Service ¶
type Service struct { Name string Namespace string Type corev1.ServiceType Selector map[string]string ClusterIP string Labels map[string]string Annotations map[string]string Ports []corev1.ServicePort ExternalName string Service *corev1.Service }
Service struct for service kubernetes resource
func NewServiceBuilder ¶
NewServiceBuilder return a service
func (*Service) AddPorts ¶
func (s *Service) AddPorts(ports *corev1.ServicePort) *Service
AddPorts add ports to the service
func (*Service) SetAnnotations ¶
SetAnnotations Set annotations for the service
func (*Service) SetClusterIP ¶
SetClusterIP Set the clusterIP of a service
func (*Service) SetExternalName ¶
SetExternalName set the external name (optional)
func (*Service) SetNamespace ¶
SetNamespace Set the namespace of the service
func (*Service) SetSelector ¶
SetSelector Set the selector of a service
func (*Service) SetType ¶
func (s *Service) SetType(t corev1.ServiceType) *Service
SetType Set the type of a service The options could be "ClusterIP", "NodePort", "LoadBalancer" or "ExternalName" or use this contants https://pkg.go.dev/k8s.io/api/core/v1#ServiceType
type ServiceAccount ¶
type ServiceAccount struct { Name string Namespace string Labels map[string]string Annotations map[string]string ServiceAccount *corev1.ServiceAccount }
ServiceAccount struct for manage ServiceAccount
func NewServiceAccountBuilder ¶
func NewServiceAccountBuilder(name string) *ServiceAccount
NewServiceAccountBuilder return ServiceAccountBuilder
func (*ServiceAccount) Build ¶
func (sa *ServiceAccount) Build() *corev1.ServiceAccount
Build Build Namespace object
func (*ServiceAccount) SetAnnotations ¶
func (sa *ServiceAccount) SetAnnotations(annotations map[string]string) *ServiceAccount
SetAnnotations set annotations for service account
func (*ServiceAccount) SetLabels ¶
func (sa *ServiceAccount) SetLabels(labels map[string]string) *ServiceAccount
SetLabels set labels for service account
func (*ServiceAccount) SetNamespace ¶
func (sa *ServiceAccount) SetNamespace(namespace string) *ServiceAccount
SetNamespace set namespace for service account
func (*ServiceAccount) ToYaml ¶
func (sa *ServiceAccount) ToYaml() []byte
ToYaml Convert the object in yaml