Documentation ¶
Index ¶
- type ClusterRoleBinding
- type ConfigMap
- type ConfigRef
- type CronJob
- type CronJobWithSpec
- type Deployment
- type DeploymentSpec
- type EmptyEnvConfig
- type EnvConfig
- type HorizontalPodAutoscaler
- type Host
- type Job
- type JobWithSpec
- type Metric
- type MetricResource
- type Namespace
- type NetworkPolicy
- type Passthru
- type Pod
- type Port
- type Quota
- type ResourceQuota
- type RoleBinding
- type RoleRef
- type ScaleTargetRef
- type Secret
- type Selector
- type Service
- type ServiceAccount
- type Subject
- type Template
- type TypedJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterRoleBinding ¶
func (*ClusterRoleBinding) ToManifest ¶
func (crb *ClusterRoleBinding) ToManifest() (any, error)
type ConfigMap ¶
func (*ConfigMap) ToManifest ¶
ToManifest is only structured for reading. For creating configMaps more work needs to be done.
type ConfigRef ¶
ConfigRef implements EnvConfig and can provide configMap and Secrets based configuration based on refs
func (*ConfigRef) ToVolumeMounts ¶
type CronJob ¶
type CronJob struct { Name string Namespace string Labels map[string]string ContainerImage string Schedule string // the crontab string Command []string EnvConfig EnvConfig PodMetadata map[string]any }
func (*CronJob) ToManifest ¶
type CronJobWithSpec ¶
type CronJobWithSpec struct { Name string Namespace string Labels map[string]string Schedule string Command []string PodMetadata map[string]any PodSpec map[string]any }
CronJobWithSpec represents a CronJob which is created using an existing Pod's spec as its base. This means it will re-use the image and environment information from the existing pod (via its spec). This komponent is analogous to JobWithSpec.
func (*CronJobWithSpec) ToManifest ¶
func (j *CronJobWithSpec) ToManifest() (any, error)
type Deployment ¶
type Deployment struct { Name string Namespace string Labels map[string]string Spec DeploymentSpec }
func (*Deployment) ToManifest ¶
func (d *Deployment) ToManifest() (any, error)
type DeploymentSpec ¶
type EmptyEnvConfig ¶
type EmptyEnvConfig struct{}
func (*EmptyEnvConfig) ToEnvFrom ¶
func (*EmptyEnvConfig) ToEnvFrom() []map[string]any
func (*EmptyEnvConfig) ToVolumeMounts ¶
func (*EmptyEnvConfig) ToVolumeMounts() []map[string]any
func (*EmptyEnvConfig) ToVolumes ¶
func (*EmptyEnvConfig) ToVolumes() []map[string]any
type HorizontalPodAutoscaler ¶
type HorizontalPodAutoscaler struct { Name string Namespace string Labels map[string]string ScaleTargetRef ScaleTargetRef MinReplicas int MaxReplicas int Metrics []Metric }
func (*HorizontalPodAutoscaler) ToManifest ¶
func (hpa *HorizontalPodAutoscaler) ToManifest() (any, error)
type Host ¶
func HostInDefaultNamespace ¶
func (*Host) ToManifest ¶
ToManifest is only structured for reading. For creating secrets more work needs to be done.
type Job ¶
type Job struct { // TODO: have a way to validate arguments Name string // TODO: ensure it's a valid k8s name Namespace string Labels map[string]string ContainerImage string Command []string EnvConfig EnvConfig PodMetadata map[string]any BackoffLimit int TTLSecondsAfterFinished int // contains filtered or unexported fields }
func (*Job) PatchForTest ¶
PatchForTest is an api for tests. It is too fast-and-loose to use in production. Please use more structured APIs for prod.
patchMapper patchMapper make me a patch find me a find catch me a catch
func (*Job) ToManifest ¶
type JobWithSpec ¶
type JobWithSpec struct { Command []string Name string Namespace string Labels map[string]string PodMetadata map[string]any PodSpec map[string]any BackoffLimit int TTLSecondsAfterFinished int // contains filtered or unexported fields }
func (*JobWithSpec) ToManifest ¶
func (j *JobWithSpec) ToManifest() (any, error)
type Metric ¶
type Metric struct { Type string Resource MetricResource }
type MetricResource ¶
type Namespace ¶
func (*Namespace) ToManifest ¶
type NetworkPolicy ¶
NetworkPolicy is a simplified version of k8s NetworkPolicy resource For now, we only support limiting ingress based on namespaces. We can make this more complicated if needed
func (*NetworkPolicy) ToManifest ¶
func (np *NetworkPolicy) ToManifest() (any, error)
ToManifest is only structured for reading. For creating secrets more work needs to be done.
type Pod ¶
func (*Pod) ToManifest ¶
type ResourceQuota ¶
func (*ResourceQuota) ToManifest ¶
func (rb *ResourceQuota) ToManifest() (any, error)
type RoleBinding ¶
func (*RoleBinding) ToManifest ¶
func (rb *RoleBinding) ToManifest() (any, error)
type ScaleTargetRef ¶
type Secret ¶
func SecretFromUnstructured ¶
func SecretFromUnstructured(u *unstructured.Unstructured) *Secret
func (*Secret) ToManifest ¶
ToManifest is only structured for reading. For creating secrets more work needs to be done.
type Service ¶
type Service struct { Name string Namespace string Labels map[string]string Ports []Port SelectorLabels map[string]string Type string // TODO make enum: ClusterIP, NodePort, LoadBalancer, ExternalName }
func (*Service) ToManifest ¶
type ServiceAccount ¶
func (*ServiceAccount) ToManifest ¶
func (sa *ServiceAccount) ToManifest() (any, error)
type TypedJob ¶
type TypedJob struct { // TODO: have a way to validate arguments Name string // TODO: ensure it's a valid k8s name Namespace string ContainerImage string Command []string }
Experiment to see if we prefer to used the typed objects from the typed K8s APIs. So far: Pros: It's typed, so you get compile time checking, completion, docs in IDE Cons: Feels slow to translate. With the untyped case I can easily look at
a YAML and write the corresponding struct very quickly. With the typed API I find myself trying to figure out in which go package a given type is defined, and making sure we're importing it