kubeutil

package
v0.0.0-...-862afa6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 22 Imported by: 11

Documentation

Overview

Package kubeutil provides helper functions to create and manipulate kubernetes basic types.

Code generated by apisources. DO NOT EDIT.

Index

Constants

View Source
const (

	// AppLabelName defines the name of the application i.e. mysql
	AppLabelName = "app.kubernetes.io/name"
	// AppLabelInstance defines a unique name identifying the instance of an application i.e. mysql-abcxyz
	AppLabelInstance = "app.kubernetes.io/instance"
	// AppLabelVersion defines the current version of the application i.e. 5.7.21
	AppLabelVersion = "app.kubernetes.io/version"
	// AppLabelComponent defines the component within the architecture i.e. database
	AppLabelComponent = "app.kubernetes.io/component"
	// AppLabelPartOf defines the name of a higher level application this one is part of i.e. WordPress
	AppLabelPartOf = "app.kubernetes.io/part-of"
	// AppLabelManagedBy defines the tool being used to manage the operation of an application i.e. lingon
	AppLabelManagedBy = "app.kubernetes.io/managed-by"
)

Recommended Kubernetes Labels

https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/

Shared labels and annotations share a common prefix: `app.kubernetes.io`. The shared prefix ensures that shared labels do not interfere with custom user labels.

View Source
const (
	// LabelServiceName is used to indicate the name of a Kubernetes service.
	// See https://kubernetes.io/docs/concepts/services-networking/service/#custom-endpointslices
	LabelServiceName = "kubernetes.io/service-name"

	LabelInstanceTypeStable = "node.kubernetes.io/instance-type"
	LabelOSStable           = "kubernetes.io/os"
	LabelArchStable         = "kubernetes.io/arch"
	LabelHostname           = "kubernetes.io/hostname"
	LabelDefaultContainer   = "kubectl.kubernetes.io/default-container"
	LabelTopologyZone       = "topology.kubernetes.io/zone"
	LabelTopologyRegion     = "topology.kubernetes.io/region"
)
View Source
const (
	LabelRbacAggregateToAdmin = "rbac.authorization.k8s.io/aggregate-to-admin"
	LabelRbacAggregateToEdit  = "rbac.authorization.k8s.io/aggregate-to-edit"
	LabelRbacAggregateToView  = "rbac.authorization.k8s.io/aggregate-to-view"
)

RBAC aggregated cluster roles

see https://kubernetes.io/docs/reference/access-authn-authz/rbac/#aggregated-clusterroles

View Source
const (
	PortNameMetrics   = "metrics"
	PortNameProfiling = "profiling"
	PortNameProbes    = "probes"
	PortNameHTTP      = "http"
)
View Source
const (
	PathMetrics   = "/metrics"
	PathProfiling = "/debug/pprof"
	PathHealthz   = "/healthz"
	PathReadiness = "/readiness"
)
View Source
const (
	NSKubeSystem = "kube-system"
	NSDefault    = "default"
)
View Source
const (
	NSLabelPodSecurityEnforce        = "pod-security.kubernetes.io/enforce"
	NSLabelPodSecurityEnforceVersion = "pod-security.kubernetes.io/enforce-version"
	NSLabelPodSecurityAudit          = "pod-security.kubernetes.io/audit"
	NSLabelPodSecurityAuditVersion   = "pod-security.kubernetes.io/audit-version"
	NSLabelPodSecurityWarn           = "pod-security.kubernetes.io/warn"
	NSLabelPodSecurityWarnVersion    = "pod-security.kubernetes.io/warn-version"
)

Labels for namespaces taken from https://kubernetes.io/docs/tasks/configure-pod-container/enforce-standards-namespace-labels/

View Source
const (
	NSValuePodSecurityPrivileged = "privileged"
	NSValuePodSecurityRestricted = "restricted"
	NSValuePodSecurityBaseline   = "baseline"
)
View Source
const (
	// TypeSecretSAToken ServiceAccount token
	TypeSecretSAToken = "kubernetes.io/service-account-token" // nolint:gosec

	// TypeSecretDockerCfg serialized ~/.dockercfg file
	TypeSecretDockerCfg = "kubernetes.io/dockercfg" // nolint:gosec

	// TypeSecretDockerJSON serialized ~/.docker/config.json file
	TypeSecretDockerJSON = "kubernetes.io/dockerconfigjson" // nolint:gosec

	// TypeSecretBasicAuth credentials for basic authentication
	TypeSecretBasicAuth = "kubernetes.io/basic-auth" // nolint:gosec

	// TypeSecretSSH credentials for SSH authentication
	TypeSecretSSH = "kubernetes.io/ssh-auth" // nolint:gosec

	// TypeSecretTLS data for a TLS client or server
	TypeSecretTLS = "kubernetes.io/tls" // nolint:gosec

	// TypeSecretBootstrapToken bootstrap token data
	TypeSecretBootstrapToken = "bootstrap.kubernetes.io/token" // nolint:gosec
)

see https://kubernetes.io/docs/concepts/configuration/secret/

Variables

View Source
var ErrFieldMissing = errors.New("missing")
View Source
var NotInWindows = corev1.NodeSelectorTerm{
	MatchExpressions: []corev1.NodeSelectorRequirement{
		{
			Key:      LabelOSStable,
			Operator: corev1.NodeSelectorOpNotIn,
			Values:   []string{"windows"},
		},
	},
}
View Source
var TypeAPIServiceV1 = metav1.TypeMeta{
	APIVersion: "apiregistration.k8s.io/v1",
	Kind:       "APIService",
}
View Source
var TypeAWSNodeTemplateV1Alpha1 = metav1.TypeMeta{
	APIVersion: "karpenter.k8s.aws/v1alpha1",
	Kind:       "AWSNodeTemplate",
}
View Source
var TypeBindingV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Binding",
}
View Source
var TypeCSIDriverV1 = metav1.TypeMeta{
	APIVersion: "storage.k8s.io/v1",
	Kind:       "CSIDriver",
}
View Source
var TypeCSINodeV1 = metav1.TypeMeta{
	APIVersion: "storage.k8s.io/v1",
	Kind:       "CSINode",
}
View Source
var TypeCSIStorageCapacityV1Beta1 = metav1.TypeMeta{
	APIVersion: "storage.k8s.io/v1beta1",
	Kind:       "CSIStorageCapacity",
}
View Source
var TypeCertificateSigningRequestV1 = metav1.TypeMeta{
	APIVersion: "certificates.k8s.io/v1",
	Kind:       "CertificateSigningRequest",
}
View Source
var TypeCiliumClusterwideNetworkPolicyV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumClusterwideNetworkPolicy",
}
View Source
var TypeCiliumEndpointV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumEndpoint",
}
View Source
var TypeCiliumExternalWorkloadV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumExternalWorkload",
}
View Source
var TypeCiliumIdentityV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumIdentity",
}
View Source
var TypeCiliumNetworkPolicyV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumNetworkPolicy",
}
View Source
var TypeCiliumNodeV2 = metav1.TypeMeta{
	APIVersion: "cilium.io/v2",
	Kind:       "CiliumNode",
}
View Source
var TypeClusterRoleBindingV1 = metav1.TypeMeta{
	APIVersion: "rbac.authorization.k8s.io/v1",
	Kind:       "ClusterRoleBinding",
}
View Source
var TypeClusterRoleV1 = metav1.TypeMeta{
	APIVersion: "rbac.authorization.k8s.io/v1",
	Kind:       "ClusterRole",
}
View Source
var TypeComponentStatusV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "ComponentStatus",
}
View Source
var TypeConfigMapV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "ConfigMap",
}
View Source
var TypeControllerRevisionV1 = metav1.TypeMeta{
	APIVersion: "apps/v1",
	Kind:       "ControllerRevision",
}
View Source
var TypeCronJobV1 = metav1.TypeMeta{
	APIVersion: "batch/v1",
	Kind:       "CronJob",
}
View Source
var TypeCustomResourceDefinitionV1 = metav1.TypeMeta{
	APIVersion: "apiextensions.k8s.io/v1",
	Kind:       "CustomResourceDefinition",
}
View Source
var TypeDaemonSetV1 = metav1.TypeMeta{
	APIVersion: "apps/v1",
	Kind:       "DaemonSet",
}
View Source
var TypeDeploymentV1 = metav1.TypeMeta{
	APIVersion: "apps/v1",
	Kind:       "Deployment",
}
View Source
var TypeENIConfigV1Alpha1 = metav1.TypeMeta{
	APIVersion: "crd.k8s.amazonaws.com/v1alpha1",
	Kind:       "ENIConfig",
}
View Source
var TypeEndpointSliceV1 = metav1.TypeMeta{
	APIVersion: "discovery.k8s.io/v1",
	Kind:       "EndpointSlice",
}
View Source
var TypeEndpointsV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Endpoints",
}
View Source
var TypeFlowSchemaV1Beta2 = metav1.TypeMeta{
	APIVersion: "flowcontrol.apiserver.k8s.io/v1beta2",
	Kind:       "FlowSchema",
}
View Source
var TypeHorizontalPodAutoscalerV2 = metav1.TypeMeta{
	APIVersion: "autoscaling/v2",
	Kind:       "HorizontalPodAutoscaler",
}
View Source
var TypeIngressClassV1 = metav1.TypeMeta{
	APIVersion: "networking.k8s.io/v1",
	Kind:       "IngressClass",
}
View Source
var TypeIngressV1 = metav1.TypeMeta{
	APIVersion: "networking.k8s.io/v1",
	Kind:       "Ingress",
}
View Source
var TypeJobV1 = metav1.TypeMeta{
	APIVersion: "batch/v1",
	Kind:       "Job",
}
View Source
var TypeLeaseV1 = metav1.TypeMeta{
	APIVersion: "coordination.k8s.io/v1",
	Kind:       "Lease",
}
View Source
var TypeLimitRangeV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "LimitRange",
}
View Source
var TypeLocalSubjectAccessReviewV1 = metav1.TypeMeta{
	APIVersion: "authorization.k8s.io/v1",
	Kind:       "LocalSubjectAccessReview",
}
View Source
var TypeMutatingWebhookConfigurationV1 = metav1.TypeMeta{
	APIVersion: "admissionregistration.k8s.io/v1",
	Kind:       "MutatingWebhookConfiguration",
}
View Source
var TypeNamespaceV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Namespace",
}
View Source
var TypeNetworkPolicyV1 = metav1.TypeMeta{
	APIVersion: "networking.k8s.io/v1",
	Kind:       "NetworkPolicy",
}
View Source
var TypeNodeV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Node",
}
View Source
var TypePersistentVolumeClaimV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "PersistentVolumeClaim",
}
View Source
var TypePersistentVolumeV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "PersistentVolume",
}
View Source
var TypePodDisruptionBudgetV1 = metav1.TypeMeta{
	APIVersion: "policy/v1",
	Kind:       "PodDisruptionBudget",
}
View Source
var TypePodSecurityPolicyV1Beta1 = metav1.TypeMeta{
	APIVersion: "policy/v1beta1",
	Kind:       "PodSecurityPolicy",
}
View Source
var TypePodTemplateV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "PodTemplate",
}
View Source
var TypePodV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Pod",
}
View Source
var TypePriorityClassV1 = metav1.TypeMeta{
	APIVersion: "scheduling.k8s.io/v1",
	Kind:       "PriorityClass",
}
View Source
var TypePriorityLevelConfigurationV1Beta2 = metav1.TypeMeta{
	APIVersion: "flowcontrol.apiserver.k8s.io/v1beta2",
	Kind:       "PriorityLevelConfiguration",
}
View Source
var TypeProvisionerV1Alpha5 = metav1.TypeMeta{
	APIVersion: "karpenter.sh/v1alpha5",
	Kind:       "Provisioner",
}
View Source
var TypeReplicaSetV1 = metav1.TypeMeta{
	APIVersion: "apps/v1",
	Kind:       "ReplicaSet",
}
View Source
var TypeReplicationControllerV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "ReplicationController",
}
View Source
var TypeResourceQuotaV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "ResourceQuota",
}
View Source
var TypeRoleBindingV1 = metav1.TypeMeta{
	APIVersion: "rbac.authorization.k8s.io/v1",
	Kind:       "RoleBinding",
}
View Source
var TypeRoleV1 = metav1.TypeMeta{
	APIVersion: "rbac.authorization.k8s.io/v1",
	Kind:       "Role",
}
View Source
var TypeRuntimeClassV1 = metav1.TypeMeta{
	APIVersion: "node.k8s.io/v1",
	Kind:       "RuntimeClass",
}
View Source
var TypeSecretV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Secret",
}
View Source
var TypeSecurityGroupPolicyV1Beta1 = metav1.TypeMeta{
	APIVersion: "vpcresources.k8s.aws/v1beta1",
	Kind:       "SecurityGroupPolicy",
}
View Source
var TypeSelfSubjectAccessReviewV1 = metav1.TypeMeta{
	APIVersion: "authorization.k8s.io/v1",
	Kind:       "SelfSubjectAccessReview",
}
View Source
var TypeSelfSubjectRulesReviewV1 = metav1.TypeMeta{
	APIVersion: "authorization.k8s.io/v1",
	Kind:       "SelfSubjectRulesReview",
}
View Source
var TypeServiceAccountV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "ServiceAccount",
}
View Source
var TypeServiceV1 = metav1.TypeMeta{
	APIVersion: "v1",
	Kind:       "Service",
}
View Source
var TypeStatefulSetV1 = metav1.TypeMeta{
	APIVersion: "apps/v1",
	Kind:       "StatefulSet",
}
View Source
var TypeStorageClassV1 = metav1.TypeMeta{
	APIVersion: "storage.k8s.io/v1",
	Kind:       "StorageClass",
}
View Source
var TypeSubjectAccessReviewV1 = metav1.TypeMeta{
	APIVersion: "authorization.k8s.io/v1",
	Kind:       "SubjectAccessReview",
}
View Source
var TypeTokenReviewV1 = metav1.TypeMeta{
	APIVersion: "authentication.k8s.io/v1",
	Kind:       "TokenReview",
}
View Source
var TypeValidatingWebhookConfigurationV1 = metav1.TypeMeta{
	APIVersion: "admissionregistration.k8s.io/v1",
	Kind:       "ValidatingWebhookConfiguration",
}
View Source
var TypeVolumeAttachmentV1 = metav1.TypeMeta{
	APIVersion: "storage.k8s.io/v1",
	Kind:       "VolumeAttachment",
}

Functions

func AnnotationPrometheus

func AnnotationPrometheus(path string, port int32) map[string]string
AnnotationPrometheus returns map[string]string{
	"prometheus.io/path":   path,
	"prometheus.io/port":   fmt.Sprintf("%d", port),
	"prometheus.io/scrape": "true",
}

func AntiAffinityHostnameByLabel

func AntiAffinityHostnameByLabel(key, value string) *corev1.PodAntiAffinity

func BindClusterRole

func BindClusterRole(
	name string,
	sa *corev1.ServiceAccount,
	cr *rbacv1.ClusterRole,
	labels map[string]string,
) *rbacv1.ClusterRoleBinding

BindClusterRole binds a cluster role to a service account

func BindRole

func BindRole(
	name string,
	sa *corev1.ServiceAccount,
	r *rbacv1.Role,
	labels map[string]string,
) *rbacv1.RoleBinding

BindRole binds a role to a service account inside the Role's namespace

func CleanUpJSON

func CleanUpJSON(in []byte) ([]byte, error)

func CleanUpYAML

func CleanUpYAML(in []byte) ([]byte, error)

func ClusterRole

func ClusterRole(
	name string,
	labels map[string]string,
	rules []rbacv1.PolicyRule,
) *rbacv1.ClusterRole

ClusterRole creates a ClusterRole with the given name, labels and rules.

func ClusterRoleRef

func ClusterRoleRef(name string) rbacv1.RoleRef

ClusterRoleRef creates a RoleRef to a ClusterRole

func DataConfigMap

func DataConfigMap(
	name, namespace string,
	labels, annotations, data map[string]string,
) *corev1.ConfigMap

DataConfigMap creates a ConfigMap with the given data.

func EnvVarDownAPI

func EnvVarDownAPI(name, fieldPath string) corev1.EnvVar
EnvVarDownAPI returns corev1.EnvVar{
		Name:      name,
		ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: fieldPath}},
	}

func FileExists

func FileExists(filename string) bool

func HashConfig

func HashConfig(c *corev1.ConfigMap) string

HashConfig returns the hash of the ConfigMap data.

func HashSecret

func HashSecret(s *v1.Secret) string

HashSecret returns the hash of the secret content

func ListGoFiles

func ListGoFiles(root string) ([]string, error)

ListGoFiles returns a list of all go files in the root directory and its children directories

func ListJSONFiles

func ListJSONFiles(root string) ([]string, error)

ListJSONFiles returns a list of all json files in the root directory and its children directories

func ListYAMLFiles

func ListYAMLFiles(root string) ([]string, error)

ListYAMLFiles returns a list of all yaml files in the root directory and its children directories

func ManifestReadFile

func ManifestReadFile(filePath string) ([]string, error)

ManifestReadFile reads a YAML file and splits it into a list of YAML documents.

func ManifestSplit

func ManifestSplit(r io.Reader) ([]string, error)

ManifestSplit splits a YAML manifest where each object is separated by '---' into a list of string containing YAML documents.

func MergeLabels

func MergeLabels(labels ...map[string]string) map[string]string

MergeLabels merges multiple label maps into one. If a label already exists, it will be overwritten by the latest instance.

func Namespace

func Namespace(
	name string,
	labels, annotations map[string]string,
) *corev1.Namespace

func ObjectMeta

func ObjectMeta(
	name, namespace string,
	labels map[string]string,
	annotations map[string]string,
) metav1.ObjectMeta

func P

func P[T any](t T) *T

P returns a pointer to the given value.

func ProbeHTTP

func ProbeHTTP(path string, port int) corev1.ProbeHandler

func Resources

func Resources(cpuWant, memWant, cpuMax, memMax string) corev1.ResourceRequirements

Resources creates a ResourceRequirements struct.

func Role

func Role(
	name, namespace string,
	labels map[string]string,
	rules []rbacv1.PolicyRule,
) *rbacv1.Role

Role creates a Role with the given name, namespace, labels and rules.

func RoleRef

func RoleRef(name string) rbacv1.RoleRef

RoleRef creates a RoleRef to a Role

func RoleSubject

func RoleSubject(name, namespace string) []rbacv1.Subject

RoleSubject creates a Subject for a RoleBinding

func Secret

func Secret(name, namespace string, data map[string][]byte) *v1.Secret

Secret creates a Secret with the given name, namespace, labels, annotations and data.

func SecretEnvVar

func SecretEnvVar(varName, key, secretName string) v1.EnvVar

func ServiceAccount

func ServiceAccount(
	name, namespace string,
	labels, annotations map[string]string,
) *corev1.ServiceAccount

ServiceAccount creates a ServiceAccount with the given name, namespace, labels and annotations.

func SetDeploySA

func SetDeploySA(deploy *appsv1.Deployment, saName string) *appsv1.Deployment

SetDeploySA sets the ServiceAccountName in the deployment.

func SetLabelDefaultContainer

func SetLabelDefaultContainer(
	labels map[string]string,
	name string,
) map[string]string

func SimpleCRB

SimpleCRB creates a ClusterRoleBinding from a service account to a cluster role

func SimpleDeployment

func SimpleDeployment(
	name, namespace string,
	labels map[string]string,
	replicas int32,
	image string,
) *appsv1.Deployment

SimpleDeployment creates a simple deployment with a single container.

func SimpleSA

func SimpleSA(name, namespace string) *corev1.ServiceAccount

SimpleSA creates a simple ServiceAccount with the given name and namespace.

func Txtar2JSON

func Txtar2JSON(ar *txtar.Archive) []byte

Txtar2JSON converts a txtar.Archive to a JSON array of JSON objects. Each file in the txtar.Archive must be a JSON object. No conversion is done, the files are simply concatenated.

func Txtar2YAML

func Txtar2YAML(ar *txtar.Archive) []byte

Txtar2YAML converts a txtar.Archive to a YAML document. Each file in the txtar.Archive must be a YAML document. No conversion is done, the files are simply concatenated.

func TxtarJSON2TxtarYAML

func TxtarJSON2TxtarYAML(ar *txtar.Archive) (*txtar.Archive, error)

TxtarJSON2TxtarYAML converts a txtar.Archive containing JSON files to JSON files.

func TxtarYAML2TxtarJSON

func TxtarYAML2TxtarJSON(ar *txtar.Archive) (*txtar.Archive, error)

TxtarYAML2TxtarJSON converts a txtar.Archive containing YAML files to JSON files.

Types

type ConfigAndMount

type ConfigAndMount struct {
	metav1.ObjectMeta
	VolumeMount corev1.VolumeMount
	Data        map[string]string
}

ConfigAndMount is a helper struct to create a ConfigMap and a VolumeMount

func (ConfigAndMount) ConfigMap

func (m ConfigAndMount) ConfigMap() *corev1.ConfigMap

ConfigMap creates a ConfigMap from the ConfigAndMount

func (ConfigAndMount) EnvConfigMapRef

func (m ConfigAndMount) EnvConfigMapRef(name, key string) corev1.EnvVar

func (ConfigAndMount) Hash

func (m ConfigAndMount) Hash() string

Hash returns the hash of the ConfigMap data.

func (ConfigAndMount) HashEnv

func (m ConfigAndMount) HashEnv(name string) corev1.EnvVar

HashEnv creates an environment variable with the hash of the ConfigMap data.

func (ConfigAndMount) VolumeAndMount

func (m ConfigAndMount) VolumeAndMount() VolumeAndMount

VolumeAndMount creates a VolumeAndMount from the ConfigAndMount

type Meta

type Meta struct {
	Name        string            `json:"name"`
	Namespace   string            `json:"namespace,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

Meta is a struct that holds the metadata of a kubernetes object.

type Metadata

type Metadata struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Meta       Meta   `json:"metadata,omitempty"`
}

Metadata is a struct that holds the metadata of a kubernetes object.

func ExtractMetadata

func ExtractMetadata(data []byte) (*Metadata, error)

ExtractMetadata returns the Metadata of a kubernetes manifest object.

func (*Metadata) GVK

func (m *Metadata) GVK() string

func (*Metadata) String

func (m *Metadata) String() string

type VolumeAndMount

type VolumeAndMount struct {
	corev1.VolumeMount
	// corev1.Volume has just Name and VolumeSource.
	// A name field is already present in the VolumeMount,
	// so we just add the VolumeSource field here directly.
	VolumeSource corev1.VolumeSource
}

VolumeAndMount is a helper struct to create a Volume and a VolumeSource

func (VolumeAndMount) Volume

func (vam VolumeAndMount) Volume() corev1.Volume

Volume creates a Volume from the VolumeAndMount

type VolumesAndMounts

type VolumesAndMounts []VolumeAndMount

VolumesAndMounts is a helper struct to create a list of Volumes and a list of VolumeSource

func (VolumesAndMounts) VolumeMounts

func (vams VolumesAndMounts) VolumeMounts() []corev1.VolumeMount

VolumeMounts creates a list of VolumesMount from the VolumesAndMounts

func (VolumesAndMounts) Volumes

func (vams VolumesAndMounts) Volumes() []corev1.Volume

Volumes creates a list of Volumes from the VolumesAndMounts

Jump to

Keyboard shortcuts

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