factory

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigMapVolume

func GetConfigMapVolume(key string, arg *ConfigMapVolumeArgs) corev1.Volume

GetConfigMapVolume creates the cofigmap volume entry

func NewConfigMap

func NewConfigMap(args *ConfigMapArgs) corev1.ConfigMap

NewConfigMap create config map

func NewContainer

func NewContainer(args *DeploymentArgs) []corev1.Container

NewContainer create container

func NewContainerPort

func NewContainerPort(ports map[string]int32) []corev1.ContainerPort

NewContainerPort create container port slice

func NewDeployment

func NewDeployment(args *DeploymentArgs) appsv1.Deployment

NewDeployment create Deployment

func NewDeploymentSpec

func NewDeploymentSpec(args *DeploymentArgs) appsv1.DeploymentSpec

NewDeploymentSpec create deployment specs

func NewKafkaTopic

func NewKafkaTopic(args *KafkaTopicArgs) crd.KafkaTopic

NewKafkaTopic creates kafka topic custom resource defined by strimzi.io

func NewLabelSelector

func NewLabelSelector(matchLabels map[string]string) *metav1.LabelSelector

NewLabelSelector create lable selector

func NewLocalObjectReference

func NewLocalObjectReference(name string) *corev1.LocalObjectReference

NewLocalObjectReference create lable selector

func NewNamespace

func NewNamespace(args *NamespaceArgs) corev1.Namespace

NewNamespace create type namespace kubernetes objects.

func NewNetworkChaos

func NewNetworkChaos(args *NetworkChaosArgs) crd.NetworkChaos

NewNetworkChaos create type network chaos kubernetes custom resource objects for chaos-mesh.

func NewNetworkChaosSpec

func NewNetworkChaosSpec(args *NetworkChaosArgs) crd.NetworkChaosSpec

NewNetworkChaosSpec create type namespace kubernetes objects.

func NewObjectMeta

func NewObjectMeta(options ObjectMetaOptions) metav1.ObjectMeta

NewObjectMeta object meta data with name and namespace

func NewPodSpec

func NewPodSpec(args *DeploymentArgs) corev1.PodSpec

NewPodSpec create pod spec

func NewPodTemplate

func NewPodTemplate(args *DeploymentArgs) corev1.PodTemplateSpec

NewPodTemplate create pod template

func NewSerivce

func NewSerivce(args *ServiceArgs) corev1.Service

NewSerivce create new service api object

func NewServicePort

func NewServicePort(ports map[string]int32) []corev1.ServicePort

NewServicePort create service port slice

func NewTypeMeta

func NewTypeMeta(kind string, apiVersion string) metav1.TypeMeta

NewTypeMeta create type meta for all kubernetes objects.

func NewVolume

func NewVolume(configVolumeArgs *ConfigMapVolumeArgs) []corev1.Volume

NewVolume create volume

func NewVolumeMount

func NewVolumeMount(volumes map[string]string) []corev1.VolumeMount

NewVolumeMount create container port slice

Types

type ConfigMapArgs

type ConfigMapArgs struct {
	Name      string
	Namespace string
	Data      map[string]string
}

type ConfigMapVolumeArgs

type ConfigMapVolumeArgs struct {
	Name  string
	Items map[string]string
}

type DeploymentArgs

type DeploymentArgs struct {
	Name         string
	Namespace    string
	Annotations  map[string]string
	Image        string
	Replicas     int32
	Resource     *corev1.ResourceRequirements
	Ports        map[string]int32
	VolumeMounts map[string]string
	Envs         []corev1.EnvVar
	ConfigVolume *ConfigMapVolumeArgs
}

type KafkaTopicArgs

type KafkaTopicArgs struct {
	Topic       string
	ClusterName string
	Namespace   string
	Partitions  int32
	Replicas    int32
}

type NamespaceArgs

type NamespaceArgs struct {
	Name        string
	Annotations map[string]string
}

type NetworkChaosArgs

type NetworkChaosArgs struct {
	Name            string
	Namespace       string
	TargetNamespace string
	Selector        map[string]string
	Duration        string
	Latency         string
	Jitter          string
}

type ObjectMetaOptions

type ObjectMetaOptions struct {
	Name        string
	Namespace   string
	Labels      map[string]string
	Annotations map[string]string
}

type ServiceArgs

type ServiceArgs struct {
	Name      string
	Namespace string
	// ports are assumed to use TCP
	// ports are mapped to same target port
	Ports map[string]int32
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL