Documentation ¶
Index ¶
- Constants
- func AddInitializer(resource any, initializer *applycorev1.ContainerApplyConfiguration) (res any, retErr error)
- func AddLoadBalancers(resources []any) []any
- func AddLogging(resources []any, level string) []any
- func AddPortForwarders(resources []any) []any
- func AddServiceMesh(resource any, serviceMeshProxy *applycorev1.ContainerApplyConfiguration) (res any, retErr error)
- func CoordinatorBundle() []any
- func Emojivoto(smMode serviceMeshMode) []any
- func EncodeResources(resources ...any) ([]byte, error)
- func EncodeUnstructured(resources []*unstructured.Unstructured) ([]byte, error)
- func GetDEnts() ([]any, error)
- func ImageReplacementsFromFile(file io.Reader) (map[string]string, error)
- func Initializer() *applycorev1.ContainerApplyConfiguration
- func MapPodSpec(resource any, ...) any
- func MapPodSpecWithMeta(resource any, ...) any
- func Namespace(name string) *applycorev1.NamespaceApplyConfiguration
- func NewEnvVar(name, value string) *applycorev1.EnvVarApplyConfiguration
- func OpenSSL() []any
- func Overhead(podFixed corev1.ResourceList) *applynodev1.OverheadApplyConfiguration
- func PatchCoordinatorMetrics(resources []any, port int32) []any
- func PatchImages(resources []any, replacements map[string]string) []any
- func PatchNamespaces(resources []any, namespace string) []any
- func PatchServiceMeshAdminInterface(resources []any, port int32) []any
- func PortForwarderForService(svc *applycorev1.ServiceApplyConfiguration) *applycorev1.PodApplyConfiguration
- func Probe() *applycorev1.ProbeApplyConfiguration
- func ResourcesToUnstructured(resources []any) ([]*unstructured.Unstructured, error)
- func Runtime() []any
- func Scheduling(nodeSelector map[string]string, ...) *applynodev1.SchedulingApplyConfiguration
- func ServiceForDeployment(d *applyappsv1.DeploymentApplyConfiguration) *applycorev1.ServiceApplyConfiguration
- func ServiceForStatefulSet(s *applyappsv1.StatefulSetApplyConfiguration) *applycorev1.ServiceApplyConfiguration
- func ServiceMeshProxy() *applycorev1.ContainerApplyConfiguration
- func TCPSocketAction() *applycorev1.TCPSocketActionApplyConfiguration
- func UnmarshalApplyConfigurations(data []byte) ([]any, error)
- type ContainerConfig
- type ContainerPortConfig
- type CoordinatorConfig
- type DaemonSetConfig
- type DaemonSetSpecConfig
- type DeploymentConfig
- type DeploymentSpecConfig
- type EmptyDirVolumeSourceConfig
- type EnvVarConfig
- type HostPathVolumeSourceConfig
- type LabelSelectorConfig
- type NamespaceConfig
- type NodeInstallerConfig
- type PodConfig
- type PodSpecConfig
- type PodTemplateSpecConfig
- type PortForwarderConfig
- type ResourceRequirementsConfig
- func (r *ResourceRequirementsConfig) WithCPURequest(cpuM int64) *applycorev1.ResourceRequirementsApplyConfiguration
- func (r *ResourceRequirementsConfig) WithMemoryLimitAndRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration
- func (r *ResourceRequirementsConfig) WithMemoryRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration
- type RuntimeClassConfig
- type SecurityContextConfig
- type ServiceAccountConfig
- type ServiceConfig
- type ServicePortConfig
- type ServiceSpecConfig
- type StatefulSetConfig
- type StatefulSetSpecConfig
- type VolumeConfig
- type VolumeMountConfig
Constants ¶
const ( // ServiceMeshIngressEgress sets the service mesh mode to ingress and egress. ServiceMeshIngressEgress serviceMeshMode = "service-mesh-ingress-egress" // ServiceMeshEgress sets the service mesh mode to egress. ServiceMeshEgress serviceMeshMode = "service-mesh-egress" // ServiceMeshDisabled disables the service mesh. ServiceMeshDisabled serviceMeshMode = "service-mesh-disabled" )
Variables ¶
This section is empty.
Functions ¶
func AddInitializer ¶
func AddInitializer( resource any, initializer *applycorev1.ContainerApplyConfiguration, ) (res any, retErr error)
AddInitializer adds an initializer and its shared volume to the resource.
If the resource does not contain a PodSpec, this function does nothing. This function is idempotent.
func AddLoadBalancers ¶
AddLoadBalancers adds a load balancer to each Service resource.
func AddLogging ¶
AddLogging modifies Contrast Coordinators among the resources to enable debug logging.
func AddPortForwarders ¶
AddPortForwarders adds a port-forwarder for each Service resource.
func AddServiceMesh ¶
func AddServiceMesh( resource any, serviceMeshProxy *applycorev1.ContainerApplyConfiguration, ) (res any, retErr error)
AddServiceMesh adds a service mesh proxy to the resource with the proxy configuration given in the object annotations.
If the resource does not contain a PodSpec, this function does nothing. This function is idempotent.
func CoordinatorBundle ¶ added in v0.7.0
func CoordinatorBundle() []any
CoordinatorBundle returns the Coordinator and a matching Service.
func Emojivoto ¶
func Emojivoto(smMode serviceMeshMode) []any
Emojivoto returns resources for deploying Emojivoto application.
func EncodeResources ¶
EncodeResources encodes a list of apply configurations into a single YAML document.
func EncodeUnstructured ¶
func EncodeUnstructured(resources []*unstructured.Unstructured) ([]byte, error)
EncodeUnstructured encodes a list of unstructured resources into a single YAML document.
func ImageReplacementsFromFile ¶
ImageReplacementsFromFile parses the containerlookup file into a map.
The file is expected to contain newline-separated pairs of images and their intended replacement, separated by an = sign. Empty lines and lines starting with the pound character are ignored. This file is populated by container image build rules in the justfile.
func Initializer ¶
func Initializer() *applycorev1.ContainerApplyConfiguration
Initializer creates a new InitializerConfig.
func MapPodSpec ¶
func MapPodSpec(resource any, f func(spec *applycorev1.PodSpecApplyConfiguration) *applycorev1.PodSpecApplyConfiguration) any
MapPodSpec applies a function to a PodSpec in a Kubernetes resource.
func MapPodSpecWithMeta ¶ added in v0.7.0
func MapPodSpecWithMeta( resource any, f func( meta *applymetav1.ObjectMetaApplyConfiguration, spec *applycorev1.PodSpecApplyConfiguration, ) (*applymetav1.ObjectMetaApplyConfiguration, *applycorev1.PodSpecApplyConfiguration), ) any
MapPodSpecWithMeta applies a function to a PodSpec in a Kubernetes resource, and its corresponding object metadata.
func Namespace ¶
func Namespace(name string) *applycorev1.NamespaceApplyConfiguration
Namespace creates a new NamespaceConfig.
func NewEnvVar ¶
func NewEnvVar(name, value string) *applycorev1.EnvVarApplyConfiguration
NewEnvVar creates a new EnvVarApplyConfiguration from name and value.
func Overhead ¶
func Overhead(podFixed corev1.ResourceList) *applynodev1.OverheadApplyConfiguration
Overhead creates a new OverheadApplyConfiguration.
func PatchCoordinatorMetrics ¶ added in v0.7.0
PatchCoordinatorMetrics enables Coordinator metrics on the specified port.
func PatchImages ¶
PatchImages replaces images in a set of resources.
func PatchNamespaces ¶
PatchNamespaces replaces namespaces in a set of resources.
func PatchServiceMeshAdminInterface ¶ added in v0.7.0
PatchServiceMeshAdminInterface activates the admin interface on the specified port for all Service Mesh components in a set of resources.
func PortForwarderForService ¶
func PortForwarderForService(svc *applycorev1.ServiceApplyConfiguration) *applycorev1.PodApplyConfiguration
PortForwarderForService creates a Pod that forwards network traffic to the given service.
Port forwarders are named "port-forwarder-SVCNAME" and forward the first port in the ServiceSpec.
func Probe ¶
func Probe() *applycorev1.ProbeApplyConfiguration
Probe creates a new ProbeApplyConfiguration.
func ResourcesToUnstructured ¶
func ResourcesToUnstructured(resources []any) ([]*unstructured.Unstructured, error)
ResourcesToUnstructured converts a list of resources into a list of unstructured resources.
func Runtime ¶
func Runtime() []any
Runtime returns a set of resources for registering and installing the runtime.
func Scheduling ¶
func Scheduling(nodeSelector map[string]string, tolerations ...*applycorev1.TolerationApplyConfiguration) *applynodev1.SchedulingApplyConfiguration
Scheduling creates a new SchedulingApplyConfiguration.
func ServiceForDeployment ¶
func ServiceForDeployment(d *applyappsv1.DeploymentApplyConfiguration) *applycorev1.ServiceApplyConfiguration
ServiceForDeployment creates a service for a deployment by exposing the configured ports of the deployment's first container.
func ServiceForStatefulSet ¶ added in v0.7.0
func ServiceForStatefulSet(s *applyappsv1.StatefulSetApplyConfiguration) *applycorev1.ServiceApplyConfiguration
ServiceForStatefulSet creates a service for a StatefulSet by exposing the configured ports of the first container.
func ServiceMeshProxy ¶
func ServiceMeshProxy() *applycorev1.ContainerApplyConfiguration
ServiceMeshProxy creates a new service mesh proxy sidecar container.
func TCPSocketAction ¶
func TCPSocketAction() *applycorev1.TCPSocketActionApplyConfiguration
TCPSocketAction creates a new TCPSocketActionApplyConfiguration.
func UnmarshalApplyConfigurations ¶
UnmarshalApplyConfigurations unmarshals a YAML document into a list of ApplyConfigurations.
Types ¶
type ContainerConfig ¶
type ContainerConfig struct {
*applycorev1.ContainerApplyConfiguration
}
ContainerConfig wraps applycorev1.ContainerApplyConfiguration.
type ContainerPortConfig ¶
type ContainerPortConfig struct {
*applycorev1.ContainerPortApplyConfiguration
}
ContainerPortConfig wraps applycorev1.ContainerPortApplyConfiguration.
func ContainerPort ¶
func ContainerPort() *ContainerPortConfig
ContainerPort creates a new ContainerPortConfig.
type CoordinatorConfig ¶
type CoordinatorConfig struct {
*applyappsv1.StatefulSetApplyConfiguration
}
CoordinatorConfig wraps applyappsv1.DeploymentApplyConfiguration for a coordinator.
func Coordinator ¶
func Coordinator(namespace string) *CoordinatorConfig
Coordinator constructs a new CoordinatorConfig.
func (*CoordinatorConfig) WithImage ¶
func (c *CoordinatorConfig) WithImage(image string) *CoordinatorConfig
WithImage sets the image of the coordinator.
type DaemonSetConfig ¶
type DaemonSetConfig struct {
*applyappsv1.DaemonSetApplyConfiguration
}
DaemonSetConfig wraps applyappsv1.DaemonSetApplyConfiguration.
func DaemonSet ¶
func DaemonSet(name, namespace string) *DaemonSetConfig
DaemonSet creates a new DaemonSetConfig.
type DaemonSetSpecConfig ¶
type DaemonSetSpecConfig struct {
*applyappsv1.DaemonSetSpecApplyConfiguration
}
DaemonSetSpecConfig wraps applyappsv1.DaemonSetSpecApplyConfiguration.
func DaemonSetSpec ¶
func DaemonSetSpec() *DaemonSetSpecConfig
DaemonSetSpec creates a new DaemonSetSpecConfig.
type DeploymentConfig ¶
type DeploymentConfig struct {
*applyappsv1.DeploymentApplyConfiguration
}
DeploymentConfig wraps applyappsv1.DeploymentApplyConfiguration.
func Deployment ¶
func Deployment(name, namespace string) *DeploymentConfig
Deployment creates a new DeploymentConfig.
type DeploymentSpecConfig ¶
type DeploymentSpecConfig struct {
*applyappsv1.DeploymentSpecApplyConfiguration
}
DeploymentSpecConfig wraps applyappsv1.DeploymentSpecApplyConfiguration.
func DeploymentSpec ¶
func DeploymentSpec() *DeploymentSpecConfig
DeploymentSpec creates a new DeploymentSpecConfig.
type EmptyDirVolumeSourceConfig ¶
type EmptyDirVolumeSourceConfig struct {
*applycorev1.EmptyDirVolumeSourceApplyConfiguration
}
EmptyDirVolumeSourceConfig wraps applycorev1.EmptyDirVolumeSourceApplyConfiguration.
func EmptyDirVolumeSource ¶
func EmptyDirVolumeSource() *EmptyDirVolumeSourceConfig
EmptyDirVolumeSource creates a new EmptyDirVolumeSourceConfig.
func (*EmptyDirVolumeSourceConfig) Inner ¶
func (e *EmptyDirVolumeSourceConfig) Inner() *applycorev1.EmptyDirVolumeSourceApplyConfiguration
Inner returns the inner applycorev1.EmptyDirVolumeSourceApplyConfiguration.
type EnvVarConfig ¶
type EnvVarConfig struct {
*applycorev1.EnvVarApplyConfiguration
}
EnvVarConfig wraps applycorev1.EnvVarApplyConfiguration.
type HostPathVolumeSourceConfig ¶
type HostPathVolumeSourceConfig struct {
*applycorev1.HostPathVolumeSourceApplyConfiguration
}
HostPathVolumeSourceConfig wraps applycorev1.HostPathVolumeSourceApplyConfiguration.
func HostPathVolumeSource ¶
func HostPathVolumeSource() *HostPathVolumeSourceConfig
HostPathVolumeSource creates a new HostPathVolumeSourceConfig.
func (*HostPathVolumeSourceConfig) Inner ¶
func (h *HostPathVolumeSourceConfig) Inner() *applycorev1.HostPathVolumeSourceApplyConfiguration
Inner returns the inner applycorev1.HostPathVolumeSourceApplyConfiguration.
type LabelSelectorConfig ¶
type LabelSelectorConfig struct {
*applymetav1.LabelSelectorApplyConfiguration
}
LabelSelectorConfig wraps applymetav1.LabelSelectorApplyConfiguration.
func LabelSelector ¶
func LabelSelector() *LabelSelectorConfig
LabelSelector creates a new LabelSelectorConfig.
type NamespaceConfig ¶
type NamespaceConfig struct {
*applycorev1.NamespaceApplyConfiguration
}
NamespaceConfig wraps applycorev1.NamespaceApplyConfiguration.
type NodeInstallerConfig ¶
type NodeInstallerConfig struct {
*applyappsv1.DaemonSetApplyConfiguration
}
NodeInstallerConfig wraps a DaemonSetApplyConfiguration for a node installer.
func NodeInstaller ¶
func NodeInstaller(namespace string) *NodeInstallerConfig
NodeInstaller constructs a node installer daemon set.
type PodConfig ¶
type PodConfig struct {
*applycorev1.PodApplyConfiguration
}
PodConfig wraps applyappsv1.PodApplyConfiguration.
type PodSpecConfig ¶
type PodSpecConfig struct {
*applycorev1.PodSpecApplyConfiguration
}
PodSpecConfig wraps applycorev1.PodSpecApplyConfiguration.
type PodTemplateSpecConfig ¶
type PodTemplateSpecConfig struct {
*applycorev1.PodTemplateSpecApplyConfiguration
}
PodTemplateSpecConfig wraps applycorev1.PodTemplateSpecApplyConfiguration.
func PodTemplateSpec ¶
func PodTemplateSpec() *PodTemplateSpecConfig
PodTemplateSpec creates a new PodTemplateSpecConfig.
type PortForwarderConfig ¶
type PortForwarderConfig struct {
*applycorev1.PodApplyConfiguration
}
PortForwarderConfig wraps a PodApplyConfiguration for a port forwarder.
func PortForwarder ¶
func PortForwarder(name, namespace string) *PortForwarderConfig
PortForwarder constructs a port forwarder pod.
func (*PortForwarderConfig) WithForwardTarget ¶
func (p *PortForwarderConfig) WithForwardTarget(host string, port int32) *PortForwarderConfig
WithForwardTarget sets the target host and port to forward to.
func (*PortForwarderConfig) WithListenPort ¶
func (p *PortForwarderConfig) WithListenPort(port int32) *PortForwarderConfig
WithListenPort sets the port to listen on.
type ResourceRequirementsConfig ¶
type ResourceRequirementsConfig struct {
*applycorev1.ResourceRequirementsApplyConfiguration
}
ResourceRequirementsConfig wraps applycorev1.ResourceRequirementsApplyConfiguration.
func ResourceRequirements ¶
func ResourceRequirements() *ResourceRequirementsConfig
ResourceRequirements creates a new ResourceRequirementsConfig.
func (*ResourceRequirementsConfig) WithCPURequest ¶
func (r *ResourceRequirementsConfig) WithCPURequest(cpuM int64) *applycorev1.ResourceRequirementsApplyConfiguration
WithCPURequest sets the CPU request of the ResourceRequirements.
func (*ResourceRequirementsConfig) WithMemoryLimitAndRequest ¶
func (r *ResourceRequirementsConfig) WithMemoryLimitAndRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration
WithMemoryLimitAndRequest sets the memory limit and request of the ResourceRequirements.
func (*ResourceRequirementsConfig) WithMemoryRequest ¶
func (r *ResourceRequirementsConfig) WithMemoryRequest(memoryMi int64) *applycorev1.ResourceRequirementsApplyConfiguration
WithMemoryRequest sets the memory request of the ResourceRequirements.
type RuntimeClassConfig ¶
type RuntimeClassConfig struct {
*applynodev1.RuntimeClassApplyConfiguration
}
RuntimeClassConfig wraps applypodsv1.RuntimeClassApplyConfiguration for a runtime class.
func ContrastRuntimeClass ¶
func ContrastRuntimeClass() *RuntimeClassConfig
ContrastRuntimeClass creates a new RuntimeClassConfig.
func RuntimeClass ¶
func RuntimeClass(name string) *RuntimeClassConfig
RuntimeClass constructs a new RuntimeClassConfig.
type SecurityContextConfig ¶
type SecurityContextConfig struct {
*applycorev1.SecurityContextApplyConfiguration
}
SecurityContextConfig wraps applycorev1.SecurityContextApplyConfiguration.
func SecurityContext ¶
func SecurityContext() *SecurityContextConfig
SecurityContext creates a new SecurityContextConfig.
func (*SecurityContextConfig) AddCapabilities ¶
func (s *SecurityContextConfig) AddCapabilities(capabilities ...corev1.Capability) *SecurityContextConfig
AddCapabilities appends the given capabilities to the add list.
func (*SecurityContextConfig) WithPrivileged ¶
func (s *SecurityContextConfig) WithPrivileged(privileged bool) *SecurityContextConfig
WithPrivileged sets the Privileged field in the declarative configuration to the given value.
type ServiceAccountConfig ¶
type ServiceAccountConfig struct {
*applycorev1.ServiceAccountApplyConfiguration
}
ServiceAccountConfig wraps applycorev1.ServiceAccountApplyConfiguration.
func ServiceAccount ¶
func ServiceAccount(name, namespace string) *ServiceAccountConfig
ServiceAccount creates a new ServiceAccountConfig.
type ServiceConfig ¶
type ServiceConfig struct {
*applycorev1.ServiceApplyConfiguration
}
ServiceConfig wraps applycorev1.ServiceApplyConfiguration.
func Service ¶
func Service(name, namespace string) *ServiceConfig
Service creates a new ServiceConfig.
type ServicePortConfig ¶
type ServicePortConfig struct {
*applycorev1.ServicePortApplyConfiguration
}
ServicePortConfig wraps applycorev1.ServicePortApplyConfiguration.
func ServicePort ¶
func ServicePort() *ServicePortConfig
ServicePort creates a new ServicePortConfig.
type ServiceSpecConfig ¶
type ServiceSpecConfig struct {
*applycorev1.ServiceSpecApplyConfiguration
}
ServiceSpecConfig wraps applycorev1.ServiceSpecApplyConfiguration.
func ServiceSpec ¶
func ServiceSpec() *ServiceSpecConfig
ServiceSpec creates a new ServiceSpecConfig.
type StatefulSetConfig ¶ added in v0.7.0
type StatefulSetConfig struct {
*applyappsv1.StatefulSetApplyConfiguration
}
StatefulSetConfig wraps applyappsv1.StatefulSetApplyConfiguration.
func StatefulSet ¶ added in v0.7.0
func StatefulSet(name, namespace string) *StatefulSetConfig
StatefulSet creates a new StatefulSetConfig.
type StatefulSetSpecConfig ¶ added in v0.7.0
type StatefulSetSpecConfig struct {
*applyappsv1.StatefulSetSpecApplyConfiguration
}
StatefulSetSpecConfig wraps applyappsv1.StatefulSetSpecApplyConfiguration.
func StatefulSetSpec ¶ added in v0.7.0
func StatefulSetSpec() *StatefulSetSpecConfig
StatefulSetSpec creates a new StatefulSetSpecConfig.
type VolumeConfig ¶
type VolumeConfig struct {
*applycorev1.VolumeApplyConfiguration
}
VolumeConfig wraps applycorev1.VolumeApplyConfiguration.
type VolumeMountConfig ¶
type VolumeMountConfig struct {
*applycorev1.VolumeMountApplyConfiguration
}
VolumeMountConfig wraps applycorev1.VolumeMountApplyConfiguration.
func VolumeMount ¶
func VolumeMount() *VolumeMountConfig
VolumeMount creates a new VolumeMountConfig.