Documentation ¶
Index ¶
- Constants
- func AddDeploymentReadyCheck(cw *ConditionWaiter, instance *appsv1.Deployment)
- func AddStatefulSetReadyCheck(cw *ConditionWaiter, instance *appsv1.StatefulSet)
- func AppLabels(instance, app string) map[string]string
- func AppliedHash(obj metav1.Object) string
- func BidirectionalVolumeMount(name, mountPath string) corev1.VolumeMount
- func Combine(parts ...string) string
- func ConfigMapEnvVar(name, cmName, cmKey string) corev1.EnvVar
- func ConfigMapVolume(name, configMapName string, defaultMode *int32) corev1.Volume
- func CreateJob(ctx context.Context, c client.Client, instance *batchv1.Job, log logr.Logger) error
- func CreateSecret(ctx context.Context, c client.Client, instance *corev1.Secret, log logr.Logger) error
- func DecodeManifest(encoded string) (*unstructured.Unstructured, error)
- func DeleteJob(ctx context.Context, c client.Client, instance *batchv1.Job, log logr.Logger) error
- func EmptyDirVolume(name string) corev1.Volume
- func Ensure[T CopyableObject[T]](ctx context.Context, c client.Client, instance T, log logr.Logger, ...) error
- func EnsureConfigMap(ctx context.Context, c client.Client, instance *corev1.ConfigMap, ...) error
- func EnsureDaemonSet(ctx context.Context, c client.Client, instance *appsv1.DaemonSet, ...) error
- func EnsureDeployment(ctx context.Context, c client.Client, instance *appsv1.Deployment, ...) error
- func EnsureIngress(ctx context.Context, c client.Client, instance *netv1.Ingress, log logr.Logger) error
- func EnsurePersistentVolumeClaim(ctx context.Context, c client.Client, instance *corev1.PersistentVolumeClaim, ...) error
- func EnsureResource(ctx context.Context, c client.Client, instance *unstructured.Unstructured, ...) error
- func EnsureRole(ctx context.Context, c client.Client, instance *rbacv1.Role, log logr.Logger) error
- func EnsureRoleBinding(ctx context.Context, c client.Client, instance *rbacv1.RoleBinding, ...) error
- func EnsureSecret(ctx context.Context, c client.Client, instance *corev1.Secret, log logr.Logger) error
- func EnsureService(ctx context.Context, c client.Client, instance *corev1.Service, ...) error
- func EnsureServiceAccount(ctx context.Context, c client.Client, instance *corev1.ServiceAccount, ...) error
- func EnsureStatefulSet(ctx context.Context, c client.Client, instance *appsv1.StatefulSet, ...) error
- func EnvFromConfigMap(name string) corev1.EnvFromSource
- func EnvFromSecret(name string) corev1.EnvFromSource
- func EnvFromSecretPrefixed(name, prefix string) corev1.EnvFromSource
- func EnvVar(name, value string) corev1.EnvVar
- func FieldEnvVar(name, fieldPath string) corev1.EnvVar
- func GenericConfigMap(name, namespace string, labels map[string]string) *corev1.ConfigMap
- func GenericDaemonSet(component Component) *appsv1.DaemonSet
- func GenericDeployment(component Component) *appsv1.Deployment
- func GenericIngress(name, namespace string, spec *openstackv1beta1.IngressSpec, ...) *netv1.Ingress
- func GenericIngressWithTLS(name, namespace string, spec *openstackv1beta1.IngressSpec, ...) *netv1.Ingress
- func GenericJob(component Component) *batchv1.Job
- func GenericRole(name, namespace string, labels map[string]string, rules []rbacv1.PolicyRule) *rbacv1.Role
- func GenericRoleBinding(name, namespace string, labels map[string]string) *rbacv1.RoleBinding
- func GenericSecret(name, namespace string, labels map[string]string) *corev1.Secret
- func GenericService(name, namespace string, labels map[string]string) *corev1.Service
- func GenericServiceAccount(name, namespace string, labels map[string]string) *corev1.ServiceAccount
- func GenericStatefulSet(component Component) *appsv1.StatefulSet
- func HeadlessServiceName(name string) string
- func HostPathVolume(name, path string) corev1.Volume
- func IngressServiceBackend(svcName, portName string) netv1.IngressBackend
- func Labels(instance, app, component string) map[string]string
- func MatchesAppliedHash(obj metav1.Object, expected string) bool
- func MergeINI(cfg *ini.File, extraCfg openstackv1beta1.ExtraConfig)
- func MergeStringMaps(maps ...map[string]string) map[string]string
- func MustDecodeManifest(encoded string) *unstructured.Unstructured
- func MustEncodeYAML(in interface{}) []byte
- func MustGenerateFernetKey() string
- func MustGeneratePassword() string
- func MustLoadINI(app, filename string) *ini.File
- func MustLoadINITemplate(app, filename string, values interface{}) *ini.File
- func MustOutputINI(file *ini.File) *bytes.Buffer
- func MustParseINI(encoded string) *ini.File
- func MustReadFile(app, filename string) string
- func MustRenderFile(app, filename string, values interface{}) string
- func NodePodAntiAffinity(labels map[string]string) *corev1.PodAntiAffinity
- func ObjectHash(i interface{}) (string, error)
- func PersistentVolume(name, claimName string) corev1.Volume
- func PersistentVolumeClaim(name string, labels map[string]string, spec openstackv1beta1.VolumeSpec) corev1.PersistentVolumeClaim
- func ReadFile(app, filename string) (string, error)
- func ReadOnlyVolumeMount(name, mountPath string) corev1.VolumeMount
- func RenderFile(app, filename string, values interface{}) (string, error)
- func RoleRef(name string) rbacv1.RoleRef
- func SSHKeypairSecret(name, namespace string, labels map[string]string) (*corev1.Secret, error)
- func SecretEnvVar(name, secretName, secretKey string) corev1.EnvVar
- func SecretVolume(name, secretName string, defaultMode *int32) corev1.Volume
- func SetAppliedHash(obj metav1.Object, hash string)
- func SetAppliedHashUnstructured(instance *unstructured.Unstructured, hash string)
- func StorageResources(capacity string) corev1.VolumeResourceRequirements
- func SubPathVolumeMount(name, mountPath, subPath string) corev1.VolumeMount
- func VolumeMount(name, mountPath string) corev1.VolumeMount
- type Component
- type ConditionWaiter
- func (cw *ConditionWaiter) AddCheck(instance client.Object, conditionType string, ready bool) *ConditionWaiter
- func (cw *ConditionWaiter) AddReadyCheck(instance client.Object, conditions []metav1.Condition) *ConditionWaiter
- func (cw *ConditionWaiter) Wait(ctx context.Context, report ReportFunc) (ctrl.Result, error)
- type CopyableObject
- type JobRunner
- type ReportFunc
- type Reporter
- func (r *Reporter) UpdateCompletedCondition(ctx context.Context, status metav1.ConditionStatus, reason, message string, ...) error
- func (r *Reporter) UpdateCondition(ctx context.Context, conditionType string, status metav1.ConditionStatus, ...) error
- func (r *Reporter) UpdateReadyCondition(ctx context.Context, status metav1.ConditionStatus, reason, message string, ...) error
Constants ¶
View Source
const ( AppLabel = "app.kubernetes.io/name" ComponentLabel = "app.kubernetes.io/component" InstanceLabel = "app.kubernetes.io/instance" )
View Source
const (
AppliedHashAnnotation = "openstack.ospk8s.com/applied-hash"
)
View Source
const Finalizer = "openstack.ospk8s.com/finalizer"
Variables ¶
This section is empty.
Functions ¶
func AddDeploymentReadyCheck ¶
func AddDeploymentReadyCheck(cw *ConditionWaiter, instance *appsv1.Deployment)
func AddStatefulSetReadyCheck ¶
func AddStatefulSetReadyCheck(cw *ConditionWaiter, instance *appsv1.StatefulSet)
func AppliedHash ¶
func BidirectionalVolumeMount ¶
func BidirectionalVolumeMount(name, mountPath string) corev1.VolumeMount
func ConfigMapEnvVar ¶
func ConfigMapVolume ¶
func CreateSecret ¶
func DecodeManifest ¶
func DecodeManifest(encoded string) (*unstructured.Unstructured, error)
func EmptyDirVolume ¶
func EnsureConfigMap ¶
func EnsureDaemonSet ¶
func EnsureDeployment ¶
func EnsureIngress ¶
func EnsureResource ¶
func EnsureResource(ctx context.Context, c client.Client, instance *unstructured.Unstructured, log logr.Logger) error
func EnsureRole ¶
func EnsureRoleBinding ¶
func EnsureSecret ¶
func EnsureService ¶
func EnsureServiceAccount ¶
func EnsureStatefulSet ¶
func EnvFromConfigMap ¶
func EnvFromConfigMap(name string) corev1.EnvFromSource
func EnvFromSecret ¶
func EnvFromSecret(name string) corev1.EnvFromSource
func EnvFromSecretPrefixed ¶
func EnvFromSecretPrefixed(name, prefix string) corev1.EnvFromSource
func FieldEnvVar ¶
func GenericConfigMap ¶
func GenericDaemonSet ¶
func GenericDeployment ¶
func GenericDeployment(component Component) *appsv1.Deployment
func GenericIngress ¶
func GenericIngress(name, namespace string, spec *openstackv1beta1.IngressSpec, labels map[string]string) *netv1.Ingress
func GenericIngressWithTLS ¶
func GenericIngressWithTLS(name, namespace string, spec *openstackv1beta1.IngressSpec, tlsSpec openstackv1beta1.TLSServerSpec, labels map[string]string) *netv1.Ingress
func GenericJob ¶
func GenericRole ¶
func GenericRoleBinding ¶
func GenericRoleBinding(name, namespace string, labels map[string]string) *rbacv1.RoleBinding
func GenericSecret ¶
func GenericService ¶
func GenericServiceAccount ¶
func GenericServiceAccount(name, namespace string, labels map[string]string) *corev1.ServiceAccount
func GenericStatefulSet ¶
func GenericStatefulSet(component Component) *appsv1.StatefulSet
func HeadlessServiceName ¶
func HostPathVolume ¶
func IngressServiceBackend ¶
func IngressServiceBackend(svcName, portName string) netv1.IngressBackend
func MergeINI ¶
func MergeINI(cfg *ini.File, extraCfg openstackv1beta1.ExtraConfig)
func MustDecodeManifest ¶
func MustDecodeManifest(encoded string) *unstructured.Unstructured
func MustEncodeYAML ¶
func MustEncodeYAML(in interface{}) []byte
func MustGenerateFernetKey ¶
func MustGenerateFernetKey() string
func MustGeneratePassword ¶
func MustGeneratePassword() string
func MustLoadINI ¶
func MustLoadINI(app, filename string) *ini.File
func MustLoadINITemplate ¶
func MustLoadINITemplate(app, filename string, values interface{}) *ini.File
func MustOutputINI ¶
func MustParseINI ¶
func MustParseINI(encoded string) *ini.File
func MustReadFile ¶
func MustRenderFile ¶
func NodePodAntiAffinity ¶
func NodePodAntiAffinity(labels map[string]string) *corev1.PodAntiAffinity
func ObjectHash ¶
ObjectHash creates a deep object hash and return it as a safe encoded string
func PersistentVolume ¶
func PersistentVolumeClaim ¶
func PersistentVolumeClaim(name string, labels map[string]string, spec openstackv1beta1.VolumeSpec) corev1.PersistentVolumeClaim
func ReadOnlyVolumeMount ¶
func ReadOnlyVolumeMount(name, mountPath string) corev1.VolumeMount
func RenderFile ¶
func SSHKeypairSecret ¶
func SecretEnvVar ¶
func SetAppliedHash ¶
func SetAppliedHashUnstructured ¶
func SetAppliedHashUnstructured(instance *unstructured.Unstructured, hash string)
func StorageResources ¶
func StorageResources(capacity string) corev1.VolumeResourceRequirements
func SubPathVolumeMount ¶
func SubPathVolumeMount(name, mountPath, subPath string) corev1.VolumeMount
func VolumeMount ¶
func VolumeMount(name, mountPath string) corev1.VolumeMount
Types ¶
type Component ¶
type Component struct { Namespace string Labels map[string]string Replicas int32 Affinity *corev1.Affinity NodeSelector map[string]string InitContainers []corev1.Container Containers []corev1.Container SecurityContext *corev1.PodSecurityContext Volumes []corev1.Volume VolumeClaimTemplates []corev1.PersistentVolumeClaim }
type ConditionWaiter ¶
type ConditionWaiter struct {
// contains filtered or unexported fields
}
func NewConditionWaiter ¶
func NewConditionWaiter(scheme *runtime.Scheme, log logr.Logger) *ConditionWaiter
func (*ConditionWaiter) AddCheck ¶
func (cw *ConditionWaiter) AddCheck(instance client.Object, conditionType string, ready bool) *ConditionWaiter
func (*ConditionWaiter) AddReadyCheck ¶
func (cw *ConditionWaiter) AddReadyCheck(instance client.Object, conditions []metav1.Condition) *ConditionWaiter
func (*ConditionWaiter) Wait ¶
func (cw *ConditionWaiter) Wait(ctx context.Context, report ReportFunc) (ctrl.Result, error)
type JobRunner ¶
type JobRunner struct {
// contains filtered or unexported fields
}
func NewJobRunner ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter provides a generic way to report the status of a resource.
func NewReporter ¶
func (*Reporter) UpdateCompletedCondition ¶
func (*Reporter) UpdateCondition ¶
func (*Reporter) UpdateReadyCondition ¶
Click to show internal directories.
Click to hide internal directories.