Documentation
¶
Index ¶
- Constants
- Variables
- func SetHostedControlPlaneConditions(hcp *unstructured.Unstructured, operStatus *operv1.NetworkStatus) ([]metav1.Condition, error)
- func SetRestartDateAnnotation(objs []*unstructured.Unstructured, hcpNamespace, restartDate string) error
- type AvailabilityPolicy
- type HostedControlPlane
- type HyperShiftConfig
- type RelatedObject
Constants ¶
const ( // ClusterIDLabel (_id) is the common label used to identify clusters in telemeter. // For hypershift, it will identify metrics produced by the both the control plane // components and guest cluster monitoring stack. ClusterIDLabel = "_id" // HyperShiftConditionTypePrefix is a cluster network operator condition type prefix in hostedControlPlane status HyperShiftConditionTypePrefix = "network.operator.openshift.io/" // RestartDateAnnotation is used to trigger rolling restarts of control plane operands RestartDateAnnotation = "hypershift.openshift.io/restart-date" )
const HostedClusterDefaultAdvertiseAddressIPV4 = "172.20.0.1"
const HostedClusterDefaultAdvertiseAddressIPV6 = "fd00::1"
const HostedClusterDefaultAdvertisePort = int64(6443)
const HostedClusterLocalProxy = "socks5://127.0.0.1:8090"
Variables ¶
var (
HostedControlPlaneGVK = schema.GroupVersionKind{
Group: "hypershift.openshift.io",
Version: "v1beta1",
Kind: "HostedControlPlane",
}
)
Functions ¶
func SetHostedControlPlaneConditions ¶
func SetHostedControlPlaneConditions(hcp *unstructured.Unstructured, operStatus *operv1.NetworkStatus) ([]metav1.Condition, error)
SetHostedControlPlaneConditions updates the hcp status.conditions based on the provided operStatus Returns an updated list of conditions and an error. If there are no changes, the returned list is empty.
func SetRestartDateAnnotation ¶
func SetRestartDateAnnotation(objs []*unstructured.Unstructured, hcpNamespace, restartDate string) error
SetRestartDateAnnotation sets the restart-date annotation on pod templates of Deployment, DaemonSet, and StatefulSet objects in the HCP namespace to trigger a rolling restart. Objects outside the HCP namespace (e.g. guest-cluster DaemonSets) are not modified.
Types ¶
type AvailabilityPolicy ¶
type AvailabilityPolicy string
AvailabilityPolicy specifies a high level availability policy for components.
const ( // HighlyAvailable means components should be resilient to problems across // fault boundaries as defined by the component to which the policy is // attached. This usually means running critical workloads with 3 replicas and // with little or no toleration of disruption of the component. HighlyAvailable AvailabilityPolicy = "HighlyAvailable" // SingleReplica means components are not expected to be resilient to problems // across most fault boundaries associated with high availability. This // usually means running critical workloads with just 1 replica and with // toleration of full disruption of the component. SingleReplica AvailabilityPolicy = "SingleReplica" )
type HostedControlPlane ¶
type HostedControlPlane struct {
Namespace string
ClusterID string
ControllerAvailabilityPolicy AvailabilityPolicy
NodeSelector map[string]string
Labels map[string]string
Tolerations []string
AdvertiseAddress string
AdvertisePort int
PriorityClass string
APIServerSpec *configv1.APIServerSpec
RestartDate string
}
HostedControlPlane represents a subset of HyperShift API definition for HostedControlPlane
func GetHostedControlPlane ¶
func GetHostedControlPlane(client cnoclient.Client) (*HostedControlPlane, error)
GetHostedControlPlane retrieves and parses the HostedControlPlane CR for the current HyperShift cluster. Returns nil if HyperShift is not enabled.
func ParseHostedControlPlane ¶
func ParseHostedControlPlane(hcp *unstructured.Unstructured) (*HostedControlPlane, error)
ParseHostedControlPlane parses the provided unstructured argument into a HostedControlPlane struct
type HyperShiftConfig ¶
type HyperShiftConfig struct {
sync.Mutex
Enabled bool
Name string
Namespace string
RunAsUser string
RelatedObjects []RelatedObject
ReleaseImage string
ControlPlaneImage string
CAConfigMap string
CAConfigMapKey string
}
func NewHyperShiftConfig ¶
func NewHyperShiftConfig() *HyperShiftConfig
func (*HyperShiftConfig) SetRelatedObjects ¶
func (hc *HyperShiftConfig) SetRelatedObjects(relatedObjects []RelatedObject)
type RelatedObject ¶
type RelatedObject struct {
configv1.ObjectReference
ClusterName string
}