Documentation
¶
Index ¶
- Variables
- func MarshalYaml(i interface{}) (string, error)
- type ConfigMap
- type ConfigMapOpt
- func ConfigMapBinaryData(key string, value []byte) ConfigMapOpt
- func ConfigMapBinaryDataMap(data map[string][]byte) ConfigMapOpt
- func ConfigMapData(key, value string) ConfigMapOpt
- func ConfigMapDataMap(data map[string]string) ConfigMapOpt
- func ConfigMapImmutable(b bool) ConfigMapOpt
- func ConfigMapNamespace(n string) ConfigMapOpt
- type Container
- type ContainerOpt
- func ContainerArgs(args []string) ContainerOpt
- func ContainerCommands(commands []string) ContainerOpt
- func ContainerEnvFromConfigMap(configmap, name, key string) ContainerOpt
- func ContainerEnvFromSecret(secret, name, key string) ContainerOpt
- func ContainerEnvVar(key, value string) ContainerOpt
- func ContainerImage(image string) ContainerOpt
- func ContainerImagePullPolicy(policy corev1.PullPolicy) ContainerOpt
- func ContainerLivenessProbeHTTP(h HTTPProbe) ContainerOpt
- func ContainerPort(name string, port int) ContainerOpt
- func ContainerVolume(path string, pv PersistentVolume) ContainerOpt
- func ContainerVolumeSource(name, mountPath string, vs corev1.VolumeSource) ContainerOpt
- type CronJob
- type CronJobOpt
- func CronJobActiveDeadlineSeconds(i int) CronJobOpt
- func CronJobBackoffLimit(i int) CronJobOpt
- func CronJobCompletions(i int) CronJobOpt
- func CronJobConcurrency(p batchv1.ConcurrencyPolicy) CronJobOpt
- func CronJobNamespace(n string) CronJobOpt
- func CronJobParallelism(i int) CronJobOpt
- func CronJobPodSpec(p PodSpec) CronJobOpt
- func CronJobRestartPolicy(r corev1.RestartPolicy) CronJobOpt
- func CronJobSchedule(cs CronSchedule) CronJobOpt
- type CronSchedule
- type Deployment
- type DeploymentOpt
- func DeploymentLabel(key, value string) DeploymentOpt
- func DeploymentLabels(labels map[string]string) DeploymentOpt
- func DeploymentNamespace(n string) DeploymentOpt
- func DeploymentNodeSelector(selectors map[string]string) DeploymentOpt
- func DeploymentPodSpec(p PodSpec) DeploymentOpt
- func DeploymentReplicas(r int) DeploymentOpt
- func DeploymentSelector(key, value string) DeploymentOpt
- func DeploymentTolerations(tolerations []Toleration) DeploymentOpt
- type HTTPProbe
- type Ingress
- type IngressOpt
- type Namespace
- type NamespaceOpt
- type Path
- type PersistentVolume
- type PersistentVolumeOpt
- type PodOpt
- type PodSpec
- type PolicyRule
- type PolicyRuleOpt
- func PolicyRuleAPIGroup(group string) PolicyRuleOpt
- func PolicyRuleAPIGroups(groups []string) PolicyRuleOpt
- func PolicyRuleNonResourceURL(nru string) PolicyRuleOpt
- func PolicyRuleNonResourceURLs(nru []string) PolicyRuleOpt
- func PolicyRuleResource(resource string) PolicyRuleOpt
- func PolicyRuleResourceName(rn string) PolicyRuleOpt
- func PolicyRuleResourceNames(rn []string) PolicyRuleOpt
- func PolicyRuleResources(resources []string) PolicyRuleOpt
- func PolicyRuleVerb(v Verb) PolicyRuleOpt
- func PolicyRuleVerbs(verbs []Verb) PolicyRuleOpt
- type Role
- type RoleBinding
- type RoleBindingOpt
- type RoleOpt
- type Rule
- type Secret
- type SecretOpt
- type Service
- type ServiceAccount
- type ServiceAccountOpt
- type ServiceOpt
- type TaintEffect
- type Toleration
- type TolerationOperator
- type Verb
Constants ¶
This section is empty.
Variables ¶
var ErrNameRequired = fmt.Errorf("name is required")
Functions ¶
func MarshalYaml ¶
MarshalYaml returns the YAML for an API object
Types ¶
type ConfigMap ¶
func NewConfigMap ¶
func NewConfigMap(name string, opts ...ConfigMapOpt) ConfigMap
Returns a configmap with the given name and options
func (*ConfigMap) AsVolumeSource ¶
func (c *ConfigMap) AsVolumeSource() corev1.VolumeSource
Returns the ConfigMap as a volume source
type ConfigMapOpt ¶
type ConfigMapOpt func(*ConfigMap)
func ConfigMapBinaryData ¶
func ConfigMapBinaryData(key string, value []byte) ConfigMapOpt
Set singular binary kv data
func ConfigMapBinaryDataMap ¶
func ConfigMapBinaryDataMap(data map[string][]byte) ConfigMapOpt
Set multiple binary kv data
func ConfigMapData ¶
func ConfigMapData(key, value string) ConfigMapOpt
Set singular configmap kv pair
func ConfigMapDataMap ¶
func ConfigMapDataMap(data map[string]string) ConfigMapOpt
Set multiple configmap kv pairs
func ConfigMapImmutable ¶
func ConfigMapImmutable(b bool) ConfigMapOpt
Set if configmap is immutable
type Container ¶
Container holds a Kubernetes container
func NewContainer ¶
func NewContainer(name string, opts ...ContainerOpt) Container
NewContainer returns a container with the provided namd and any options
type ContainerOpt ¶
type ContainerOpt func(*Container)
func ContainerCommands ¶
func ContainerCommands(commands []string) ContainerOpt
Set container commands
func ContainerEnvFromConfigMap ¶
func ContainerEnvFromConfigMap(configmap, name, key string) ContainerOpt
Add container environment variable from config map
func ContainerEnvFromSecret ¶
func ContainerEnvFromSecret(secret, name, key string) ContainerOpt
Add container environment variable from secret
func ContainerEnvVar ¶
func ContainerEnvVar(key, value string) ContainerOpt
Add container environment variable
func ContainerImagePullPolicy ¶
func ContainerImagePullPolicy(policy corev1.PullPolicy) ContainerOpt
Set container pull policy
func ContainerLivenessProbeHTTP ¶
func ContainerLivenessProbeHTTP(h HTTPProbe) ContainerOpt
Add liveness probe
func ContainerVolume ¶
func ContainerVolume(path string, pv PersistentVolume) ContainerOpt
Add container Volume
func ContainerVolumeSource ¶
func ContainerVolumeSource(name, mountPath string, vs corev1.VolumeSource) ContainerOpt
Mount a volume source in the container
type CronJob ¶
CronJob is a Kubernetes cron job
func NewCronJob ¶
func NewCronJob(name string, opts ...CronJobOpt) *CronJob
NewCronJob returns a cron job with the given name and options
type CronJobOpt ¶
type CronJobOpt func(*CronJob)
func CronJobActiveDeadlineSeconds ¶
func CronJobActiveDeadlineSeconds(i int) CronJobOpt
CronJobActiveDeadlineSeconds sets the active deadline seconds for the cronjob
func CronJobBackoffLimit ¶
func CronJobBackoffLimit(i int) CronJobOpt
CronJobBackoffLimit sets the backoff limit for the cronjob
func CronJobCompletions ¶
func CronJobCompletions(i int) CronJobOpt
CronJobCompletions sets the completions for the cronjob
func CronJobConcurrency ¶
func CronJobConcurrency(p batchv1.ConcurrencyPolicy) CronJobOpt
CronJobConcurrency sets the concurrency for the cronjob
func CronJobNamespace ¶
func CronJobNamespace(n string) CronJobOpt
CronJobNamespace sets the namespace for the cronjob
func CronJobParallelism ¶
func CronJobParallelism(i int) CronJobOpt
CronJobParallelism sets the parallelism for the cronjob
func CronJobPodSpec ¶
func CronJobPodSpec(p PodSpec) CronJobOpt
CronJobPodSpec sets the pod spec for the cronjob
func CronJobRestartPolicy ¶
func CronJobRestartPolicy(r corev1.RestartPolicy) CronJobOpt
CronJobRestartPolicy sets the restart policy for the cronjob
func CronJobSchedule ¶
func CronJobSchedule(cs CronSchedule) CronJobOpt
CronJobSchedule sets the schedule for the cronjob
type CronSchedule ¶
type CronSchedule string
CronSchedule is a cronjob schedule string
const ( Daily CronSchedule = "0 0 * * *" Hourly CronSchedule = "0 * * * *" Minute CronSchedule = "* * * * *" Weekly CronSchedule = "0 0 1 * *" Monthly CronSchedule = "0 0 1 1/1 *" Yearly CronSchedule = "0 0 1 1 *" Every15Minutes CronSchedule = "*/15 * * * *" Every5Minutes CronSchedule = "*/5 * * * *" Every10Minutes CronSchedule = "*/10 * * *" EveryHalfHour CronSchedule = "*/30 * * *" )
type Deployment ¶
type Deployment struct {
appsv1.Deployment
}
Deployment holds a Kubernetes deployment
func NewDeployment ¶
func NewDeployment(name string, depOpts ...DeploymentOpt) *Deployment
NewDeployment returns a deployment with the given name and options
type DeploymentOpt ¶
type DeploymentOpt func(*Deployment)
func DeploymentLabel ¶
func DeploymentLabel(key, value string) DeploymentOpt
Add single deployment label
func DeploymentLabels ¶
func DeploymentLabels(labels map[string]string) DeploymentOpt
Add multiple deployment labels
func DeploymentNamespace ¶
func DeploymentNamespace(n string) DeploymentOpt
Set deployment namespace
func DeploymentNodeSelector ¶
func DeploymentNodeSelector(selectors map[string]string) DeploymentOpt
func DeploymentSelector ¶
func DeploymentSelector(key, value string) DeploymentOpt
Add deployment selector
func DeploymentTolerations ¶
func DeploymentTolerations(tolerations []Toleration) DeploymentOpt
Set tolerations
type Ingress ¶
type Ingress struct {
networkingv1.Ingress
}
Ingress holds a Kubernetes ingress
func NewIngress ¶
func NewIngress(name string, opts ...IngressOpt) Ingress
NewIngress returns an ingress with the given name and options
type IngressOpt ¶
type IngressOpt func(*Ingress)
type Namespace ¶
Namespace holds a Kubernetes namespace
func NewNamespace ¶
func NewNamespace(name string, opts ...NamespaceOpt) Namespace
NewNamespace returns a namespace with the given name and options
type NamespaceOpt ¶
type NamespaceOpt func(*Namespace)
func NamespaceAnnotation ¶
func NamespaceAnnotation(key, value string) NamespaceOpt
Set single annotation
func NamespaceAnnotations ¶
func NamespaceAnnotations(annotations map[string]string) NamespaceOpt
Set multiple annotations
type Path ¶
type Path struct { Name string Service string Port int Type networkingv1.PathType }
Path holds an ingress path
type PersistentVolume ¶
type PersistentVolume struct {
corev1.PersistentVolume
}
PersistentVolume holds a Kubernetes persistent volume
func NewPersistentVolume ¶
func NewPersistentVolume(name string, opts ...PersistentVolumeOpt) PersistentVolume
NewPersistentVolume returns a persistent volume with the given name and options
type PersistentVolumeOpt ¶
type PersistentVolumeOpt func(*PersistentVolume)
func PersistentVolumeHostPath ¶
func PersistentVolumeHostPath(path string, pathType corev1.HostPathType) PersistentVolumeOpt
Set the volume host path
func PersistentVolumeLocal ¶
func PersistentVolumeLocal(path string, fsType string) PersistentVolumeOpt
Set the local volume path
func PersistentvolumeCapacity ¶
func PersistentvolumeCapacity(capacity resource.Quantity) PersistentVolumeOpt
Set volume capacity
type PodSpec ¶
type PodSpec struct { Name string Namespace string Image string Spec corev1.PodTemplateSpec }
Podspec holds information for a Kubernetes pod spec
func NewPodSpec ¶
Returns a pod spec with the given name and options
type PolicyRule ¶
type PolicyRule struct {
rbacv1.PolicyRule
}
PolicyRule is a Kubernetes policy rule
func NewPolicyRule ¶
func NewPolicyRule(name string, opts ...PolicyRuleOpt) PolicyRule
NewPolicyRule returns a policy rule with the given name and options
type PolicyRuleOpt ¶
type PolicyRuleOpt func(*PolicyRule)
func PolicyRuleAPIGroup ¶
func PolicyRuleAPIGroup(group string) PolicyRuleOpt
Set policy rule API group
func PolicyRuleAPIGroups ¶
func PolicyRuleAPIGroups(groups []string) PolicyRuleOpt
Set multiple rule API groups
func PolicyRuleNonResourceURL ¶
func PolicyRuleNonResourceURL(nru string) PolicyRuleOpt
Set policy rule resource URL
func PolicyRuleNonResourceURLs ¶
func PolicyRuleNonResourceURLs(nru []string) PolicyRuleOpt
Set multiple policy rule resource URLs
func PolicyRuleResource ¶
func PolicyRuleResource(resource string) PolicyRuleOpt
Set policy rule resource
func PolicyRuleResourceName ¶
func PolicyRuleResourceName(rn string) PolicyRuleOpt
Set policy rule resource name
func PolicyRuleResourceNames ¶
func PolicyRuleResourceNames(rn []string) PolicyRuleOpt
Set multiple policy rule resource names
func PolicyRuleResources ¶
func PolicyRuleResources(resources []string) PolicyRuleOpt
Set multiple policy rule resources
type RoleBinding ¶
type RoleBinding struct {
rbacv1.RoleBinding
}
RoleBinding is a Kubernetes role binding
func NewRoleBinding ¶
func NewRoleBinding(name string, opts ...RoleBindingOpt) RoleBinding
NewRoleBinding returns a role binding with the given name and options
type RoleBindingOpt ¶
type RoleBindingOpt func(*RoleBinding)
func RoleBindingNamespace ¶
func RoleBindingNamespace(n string) RoleBindingOpt
Set role binding namespace
func RoleBindingRoleRef ¶
func RoleBindingRoleRef(rf rbacv1.RoleRef) RoleBindingOpt
Set role binding roleref
func RoleBindingSubject ¶
func RoleBindingSubject(s rbacv1.Subject) RoleBindingOpt
Set role binding subject
func RoleBindingSubjects ¶
func RoleBindingSubjects(s []rbacv1.Subject) RoleBindingOpt
Set multiple role binding subjects
type Service ¶
Service holds a kubernetes service
func NewService ¶
func NewService(name string, opts ...ServiceOpt) Service
NewService returns a service with the given name and options
type ServiceAccount ¶
type ServiceAccount struct {
corev1.ServiceAccount
}
ServiceAccount is a Kubernetes service account
func NewServiceAccount ¶
func NewServiceAccount(name string, opts ...ServiceAccountOpt) ServiceAccount
NewSeviceAccount returns a service account with the provided name and options
type ServiceAccountOpt ¶
type ServiceAccountOpt func(*ServiceAccount)
func ServiceAccountAutoMountToken ¶
func ServiceAccountAutoMountToken(b bool) ServiceAccountOpt
ServiceAccountAutoMountToken sets the automounttoken for the service account
func ServiceAccountImagePullSecret ¶
func ServiceAccountImagePullSecret(s string) ServiceAccountOpt
ServiceAccountImagePullSecret sets an image pull secret for the service account
func ServiceAccountImagePullSecrets ¶
func ServiceAccountImagePullSecrets(s []string) ServiceAccountOpt
ServiceAccountImagePullSecrets sets multiple image pull secrets for the service account
func ServiceAccountNamespace ¶
func ServiceAccountNamespace(n string) ServiceAccountOpt
ServiceAccountNamespace sets the namespace for the service account
type ServiceOpt ¶
type ServiceOpt func(*Service)
type TaintEffect ¶
type TaintEffect = corev1.TaintEffect
type Toleration ¶
type Toleration struct { corev1.Toleration Key string Value string TolerationSeconds int Operator corev1.TolerationOperator Effect corev1.TaintEffect }
type TolerationOperator ¶
type TolerationOperator = corev1.TolerationOperator