Documentation
¶
Index ¶
- Constants
- func Client(c context.Context) *coreClient
- func GetContainerSpec(spec kubernetes.ContainerSpec, options ...ContainerSpecOption) corev1.Container
- func GetEnvFromHTTPParam(queryParams map[string][]string) []corev1.EnvVar
- func GetEnvfromSecretorCM(envFrom []kubernetes.EnvFrom) []corev1.EnvFromSource
- func GetPodSpec(spec kubernetes.PodSpec, options ...PodSpecOption) corev1.PodSpec
- func GetVolumeMounts(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.VolumeMount
- func GetVolumeSources(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.Volume
- type ContainerSpecOption
- func WithCommand(cmd []string) ContainerSpecOption
- func WithEnv(envs []corev1.EnvVar) ContainerSpecOption
- func WithEnvFromSecretorCM(envFromSecretorCM []kubernetes.EnvFrom) ContainerSpecOption
- func WithImagePullPolicy(pullPolicy corev1.PullPolicy) ContainerSpecOption
- func WithName(name string) ContainerSpecOption
- func WithPort(port int32) ContainerSpecOption
- func WithResources(resources []kubernetes.Resource) ContainerSpecOption
- func WithSecurityContext(user int64) ContainerSpecOption
- func WithVolumeMounts(cms []corev1.VolumeMount, secrets []corev1.VolumeMount) ContainerSpecOption
- type PodSpecOption
Constants ¶
View Source
const ( //CM_MISSING - error message to indicate CM is missing CM_MISSING = "cm %s is not found in the namespace %s, create cm before referring in the function" //SECRET_MISSING - error message to indicate Secret is missing SECRET_MISSING = "secret %s is not found in the namespace %s, create secret before referring in the function" //INVALID_ENV_FROM_TYPE - error message to indicate invalid type to mount as env INVALID_ENV_FROM_TYPE = "Provide a valid EnvFrom type. Should be 'CM' or 'Secret'" )
Variables ¶
This section is empty.
Functions ¶
func GetContainerSpec ¶
func GetContainerSpec(spec kubernetes.ContainerSpec, options ...ContainerSpecOption) corev1.Container
GetContainerSpec construct container spec based on option provided
func GetEnvFromHTTPParam ¶
func GetEnvfromSecretorCM ¶
func GetEnvfromSecretorCM(envFrom []kubernetes.EnvFrom) []corev1.EnvFromSource
func GetPodSpec ¶
func GetPodSpec(spec kubernetes.PodSpec, options ...PodSpecOption) corev1.PodSpec
func GetVolumeMounts ¶
func GetVolumeMounts(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.VolumeMount
func GetVolumeSources ¶
func GetVolumeSources(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.Volume
Types ¶
type ContainerSpecOption ¶
func WithCommand ¶
func WithCommand(cmd []string) ContainerSpecOption
WithCommand - container startup command
func WithEnvFromSecretorCM ¶
func WithEnvFromSecretorCM(envFromSecretorCM []kubernetes.EnvFrom) ContainerSpecOption
WithEnvFromSecretorCM attach secret/cm as env
func WithImagePullPolicy ¶
func WithImagePullPolicy(pullPolicy corev1.PullPolicy) ContainerSpecOption
WithImagePullPolicy - image pull policy
func WithResources ¶
func WithResources(resources []kubernetes.Resource) ContainerSpecOption
WithResources - container resource constraints
func WithSecurityContext ¶
func WithSecurityContext(user int64) ContainerSpecOption
WithSecurityContext attached pod security policy
func WithVolumeMounts ¶
func WithVolumeMounts(cms []corev1.VolumeMount, secrets []corev1.VolumeMount) ContainerSpecOption
WithVolumeMounts mount cm/secret as volume
type PodSpecOption ¶
func WithContainerOptions ¶
func WithContainerOptions(cspec kubernetes.ContainerSpec, options ...ContainerSpecOption) PodSpecOption
func WithRestartPolicy ¶
func WithRestartPolicy(policy string) PodSpecOption
func WithServiceAccount ¶
func WithServiceAccount(sa string) PodSpecOption
func WithVolumes ¶
func WithVolumes(containers []kubernetes.ContainerSpec) PodSpecOption
Click to show internal directories.
Click to hide internal directories.