Documentation
¶
Index ¶
- Constants
- func AdaptPodDisruptionBudget() option
- func DisableIfAnnotationExist(annotation string) option
- func EnableForPlatform(platform hyperv1.PlatformType) option
- func NewCronJobComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*batchv1.CronJob]
- func NewDeploymentComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.Deployment]
- func NewStatefulSetComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.StatefulSet]
- func WithAdaptFunction[T client.Object](adapt func(cpContext WorkloadContext, resource T) error) option
- func WithPredicate(predicate Predicate) option
- type ComponentOptions
- type ControlPlaneComponent
- type ControlPlaneContext
- type HTTPSOptions
- type KonnectivityContainerOptions
- type NamedComponent
- type Predicate
- type ProxyMode
- type ServiceAccountKubeConfigOpts
- type Socks5Options
- type TokenMinterContainerOptions
- type TokenType
- type WorkloadContext
- type WorkloadProvider
Constants ¶
View Source
const (
ServiceAccountKubeconfigVolumeName = "service-account-kubeconfig"
)
Variables ¶
This section is empty.
Functions ¶
func AdaptPodDisruptionBudget ¶ added in v0.1.51
func AdaptPodDisruptionBudget() option
func DisableIfAnnotationExist ¶
func DisableIfAnnotationExist(annotation string) option
DisableIfAnnotationExist is a helper predicate for the common use case of disabling a resource when an annotation exists.
func EnableForPlatform ¶ added in v0.1.51
func EnableForPlatform(platform hyperv1.PlatformType) option
EnableForPlatform is a helper predicate for the common use case of only enabling a resource for a specific platform.
func NewCronJobComponent ¶ added in v0.1.56
func NewCronJobComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*batchv1.CronJob]
func NewDeploymentComponent ¶
func NewDeploymentComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.Deployment]
func NewStatefulSetComponent ¶
func NewStatefulSetComponent(name string, opts ComponentOptions) *controlPlaneWorkloadBuilder[*appsv1.StatefulSet]
func WithAdaptFunction ¶
func WithAdaptFunction[T client.Object](adapt func(cpContext WorkloadContext, resource T) error) option
func WithPredicate ¶
func WithPredicate(predicate Predicate) option
Types ¶
type ComponentOptions ¶
type ControlPlaneComponent ¶
type ControlPlaneComponent interface {
NamedComponent
Reconcile(cpContext ControlPlaneContext) error
}
type ControlPlaneContext ¶
type ControlPlaneContext struct {
context.Context
// CreateOrUpdateProviderV2 knows how to create/update manifest based resources.
upsert.CreateOrUpdateProviderV2
// Client knows how to perform CRUD operations on Kubernetes objects in the HCP namespace.
Client client.Client
// HCP is the HostedControlPlane object
HCP *hyperv1.HostedControlPlane
// ReleaseImageProvider contains the version and component images related to control-plane release image.
ReleaseImageProvider imageprovider.ReleaseImageProvider
// UserReleaseImageProvider contains the version and component images related to data-plane release image.
UserReleaseImageProvider imageprovider.ReleaseImageProvider
// ImageMetadataProvider returns metadata for a given release image using the given pull secret.
ImageMetadataProvider util.ImageMetadataProvider
// InfraStatus contains all the information about the Hosted cluster's infra services.
InfraStatus infra.InfrastructureStatus
// SetDefaultSecurityContext is used to configure Security Context for containers.
SetDefaultSecurityContext bool
// EnableCIDebugOutput enable extra debug logs.
EnableCIDebugOutput bool
// MetricsSet specifies which metrics to use in the service/pod-monitors.
MetricsSet metrics.MetricsSet
// This is needed for the generic unit test, so we can always generate a fixture for the components deployment/statefulset.
SkipPredicate bool
}
type HTTPSOptions ¶ added in v0.1.52
type HTTPSOptions struct {
// KonnectivityHost is the host name of the Konnectivity server proxy.
KonnectivityHost string
// KonnectivityPort is the port of the Konnectivity server proxy.
KonnectivityPort uint32
// The port that https proxy should serve on.
ServingPort uint32
// ConnectDirectlyToCloudAPIs specifies whether cloud APIs should be bypassed
// by the proxy. This is used by the ingress operator to be able to create DNS records
// before worker nodes are present in the cluster.
// See https://github.com/openshift/hypershift/pull/1601
ConnectDirectlyToCloudAPIs *bool
}
type KonnectivityContainerOptions ¶
type KonnectivityContainerOptions struct {
Mode ProxyMode
// defaults to 'kubeconfig'
KubeconfingVolumeName string
HTTPSOptions HTTPSOptions
Socks5Options Socks5Options
}
type NamedComponent ¶
type NamedComponent interface {
Name() string
}
type Predicate ¶
type Predicate func(cpContext WorkloadContext) bool
type ServiceAccountKubeConfigOpts ¶ added in v0.1.55
type ServiceAccountKubeConfigOpts struct {
Name, Namespace, MountPath, ContainerName string
}
type Socks5Options ¶ added in v0.1.52
type Socks5Options struct {
// KonnectivityHost is the host name of the Konnectivity server proxy.
KonnectivityHost string
// KonnectivityPort is the port of the Konnectivity server proxy.
KonnectivityPort uint32
// The port that socks5 proxy should serve on.
ServingPort uint32
// ConnectDirectlyToCloudAPIs specifies whether cloud APIs should be bypassed
// by the proxy. This is used by the ingress operator to be able to create DNS records
// before worker nodes are present in the cluster.
// See https://github.com/openshift/hypershift/pull/1601
ConnectDirectlyToCloudAPIs *bool
// ResolveFromManagementClusterDNS tells the dialer to fallback to the management
// cluster's DNS (and direct dialer) initially until the konnectivity tunnel is available.
// Once the konnectivity tunnel is available, it no longer falls back on the management
// cluster. This is used by the OAuth server to allow quicker initialization of identity
// providers while worker nodes have not joined.
// See https://github.com/openshift/hypershift/pull/2261
ResolveFromManagementClusterDNS *bool
// ResolveFromGuestClusterDNS tells the dialer to resolve names using the guest
// cluster's coreDNS service. Used by oauth and ingress operator.
ResolveFromGuestClusterDNS *bool
// DisableResolver disables any name resolution by the resolver. This is used by the CNO.
// See https://github.com/openshift/hypershift/pull/3986
DisableResolver *bool
}
type TokenMinterContainerOptions ¶ added in v0.1.56
type TokenMinterContainerOptions struct {
// TokenType defines the token purpose, either to grant cloud access, kube-apiserver access to both.
TokenType TokenType
// ServiceAccountName is the name of the service account for which to mint a token.
ServiceAccountName string
// ServiceAccountNameSpace is the namespace of the service account for which to mint a token.
ServiceAccountNameSpace string
// KubeconfingVolumeName is the volume name which contains the kubeconfig to use mint the token in the target cluster.
// defaults to 'kubeconfig'
KubeconfingVolumeName string
// OneShot, if true, will cause the token-minter container to exit after minting the token.
OneShot bool
}
TokenMinterContainerOptions defines the options for token-minter sidecar container which mints ServiceAccount tokens in the tenant cluster for the given named service account, and then make it available for the main container with a volume mount.
type WorkloadContext ¶ added in v0.1.53
type WorkloadContext struct {
context.Context
// reader client, as workloads should not be creating resources.
Client client.Reader
HCP *hyperv1.HostedControlPlane
ReleaseImageProvider imageprovider.ReleaseImageProvider
UserReleaseImageProvider imageprovider.ReleaseImageProvider
ImageMetadataProvider util.ImageMetadataProvider
InfraStatus infra.InfrastructureStatus
SetDefaultSecurityContext bool
EnableCIDebugOutput bool
MetricsSet metrics.MetricsSet
}
type WorkloadProvider ¶ added in v0.1.56
type WorkloadProvider[T client.Object] interface { // NewObject returns a new object of the generic type. This is useful when getting/deleting the workload. NewObject() T // LoadManifest know how to load the correct workload manifest and return a workload object of the correct type. LoadManifest(componentName string) (T, error) // PodTemplateSpec knows how to extract corev1.PodTemplateSpec field from the given workload object. PodTemplateSpec(object T) *corev1.PodTemplateSpec // PodTemplateSpec knows how to extract replicas field from the given workload object. Replicas(object T) *int32 // ApplyOptionsTo knows how to apply the given deploymentConfig options to the given workload object. // TODO(Mulham): remove all usage of deploymentConfig in cpov2 and remove this function eventually. ApplyOptionsTo(cpContext ControlPlaneContext, object T, oldObject T, deploymentConfig *config.DeploymentConfig) // IsReady returns the status, reason and message describing the readiness status of the workload object. IsReady(object T) (status metav1.ConditionStatus, reason string, message string) // IsProgressing returns the status, reason and message describing the progressing status of the workload object. IsProgressing(object T) (status metav1.ConditionStatus, reason string, message string) }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.