Documentation
¶
Overview ¶
GetWindowsNodes returns Windows nodes, optionally filtering the list of nodes with the given filter functions.
Index ¶
- Constants
- func GetExpectedTyphaScale(nodes int) int
- func HasWindowsNodes(c client.Client) (bool, error)
- func MapExistsOrInitialize(m map[string]string) map[string]string
- func MergeMaps(current, desired map[string]string) map[string]string
- func MergeOwnerReferences(desired, current []metav1.OwnerReference) []metav1.OwnerReference
- func MetricsEnabled() bool
- func MetricsTLSEnabled() bool
- func OperatorKey() types.NamespacedName
- func OperatorName() string
- func OperatorNamespace() string
- func OperatorServiceAccount() string
- func WindowsEnabled(installation operatorv1.InstallationSpec) bool
- type VersionInfo
Constants ¶
const ( CalicoNamespace = "calico-system" TyphaDeploymentName = "calico-typha" NodeDaemonSetName = "calico-node" KubeControllersDeploymentName = "calico-kube-controllers" WindowsDaemonSetName = "calico-node-windows" // Monitor + Prometheus related const TigeraPrometheusNamespace = "tigera-prometheus" // ThreatDefenseFeature feature name ThreatDefenseFeature = "threat-defense" // ExportLogsFeature to 3rd party systems feature name ExportLogsFeature = "export-logs" // TiersFeature enables creation/update of Tiers TiersFeature = "tiers" // EgressAccessControl enables creation/update of NetworkPolicy with Domains EgressAccessControlFeature = "egress-access-control" // PolicyRecommendation feature name PolicyRecommendationFeature = "policy-recommendation" // MultipleOwnersLabel used to indicate multiple owner references. // If the render code places this label on an object, the object mergeState machinery will merge owner // references with any that already exist on the object rather than replace the owner references. Further // the controller in the owner reference will not be set. MultipleOwnersLabel = "operator.tigera.io/multipleOwners" // HostNetworkedPodLabel marks pods that run with hostNetwork=true and are // managed by the operator. The podiprecovery controller uses this label // to identify pods that need their IPs re-checked after a node IP change // (Kubernetes does not refresh status.podIPs for existing hostNetwork pods; // see https://github.com/kubernetes/kubernetes/issues/93897). It is // applied centrally by setStandardSelectorAndLabels in pkg/controller/utils // to any pod template with Spec.HostNetwork == true, so render packages // do not need to apply it themselves. HostNetworkedPodLabel = "operator.tigera.io/host-networked" // Sidecar common names SidecarMutatingWebhookConfigName = "tigera-sidecar-webhook-configuration" )
const (
CalicoWindowsUpgradeResourceName = "calico-windows-upgrade"
)
Variables ¶
This section is empty.
Functions ¶
func GetExpectedTyphaScale ¶ added in v1.15.1
GetExpectedTyphaScale will return the number of Typhas needed for the number of nodes.
Nodes Replicas
1-2 1 3-4 2 <200 3 >400 4 >600 5 >800 6 >1000 7 ... >2000 12 ... >3600 20
func MapExistsOrInitialize ¶ added in v1.27.17
MapExistsOrInitialize returns the given map if non-nil or returns an empty map.
func MergeMaps ¶ added in v1.27.17
MergeMaps merges current and desired maps. If both current and desired maps contain the same key, the desired map's value is used. MergeMaps does not copy operator-managed annotations from the current map.
func MergeOwnerReferences ¶ added in v1.29.2
func MergeOwnerReferences(desired, current []metav1.OwnerReference) []metav1.OwnerReference
MergeOwnerReferences merges desired and current owner references, removing the duplicates. A UID identifies an owner, so desired's version of a reference wins over current's.
The result is sorted by UID, which keeps the merge convergent when more than one controller writes the object. Each caller passes its own reference in desired, so an order that followed the arguments would put a different reference first depending on who wrote last, and the two controllers would rewrite the object in turn for as long as both keep reconciling. Order carries no meaning to Kubernetes: owner references are a set, and the controller reference is identified by its Controller field rather than its position.
func MetricsEnabled ¶ added in v1.43.0
func MetricsEnabled() bool
MetricsEnabled returns true when the operator metrics endpoint is enabled via METRICS_ENABLED=true.
func MetricsTLSEnabled ¶ added in v1.43.0
func MetricsTLSEnabled() bool
MetricsTLSEnabled returns true when the operator metrics endpoint should use mTLS (METRICS_SCHEME=https).
func OperatorKey ¶ added in v1.40.0
func OperatorKey() types.NamespacedName
func OperatorName ¶ added in v1.40.0
func OperatorName() string
OperatorName returns the name of the operator deployment.
func OperatorNamespace ¶ added in v1.23.0
func OperatorNamespace() string
OperatorNamespace returns the namespace the operator is running in. The value returned is based on the following priority (these are evaluated at startup):
If the OPERATOR_NAMESPACE environment variable is non-empty then that is return. If the file /var/run/secrets/kubernetes.io/serviceaccount/namespace is non-empty then the contents is returned. The default "tigera-operator" is returned.
func OperatorServiceAccount ¶ added in v1.24.2
func OperatorServiceAccount() string
OperatorServiceAccount returns the ServiceAccount name the operator is running in. The value returned is based on the following priority (these are evaluated at startup):
If the OPERATOR_SERVICEACCOUNT environment variable is non-empty then that is return. If the file /var/run/secrets/kubernetes.io/serviceaccount/namespace is non-empty then the contents is returned. The default "tigera-operator" is returned.
func WindowsEnabled ¶ added in v1.32.0
func WindowsEnabled(installation operatorv1.InstallationSpec) bool
WindowsEnabled returns true if the given Installation enables Windows, false otherwise.
Types ¶
type VersionInfo ¶ added in v1.18.0
VersionInfo contains information about the version of Kubernetes API the cluster is using Major and Minor fields map to the v<Major>.<Minor>+ part of the version string
func GetKubernetesVersion ¶ added in v1.18.0
func GetKubernetesVersion(clientset kubernetes.Interface) (*VersionInfo, error)
func (*VersionInfo) ProvidesCertV1API ¶ added in v1.18.0
func (v *VersionInfo) ProvidesCertV1API() bool
ProvidesCertV1API returns if k8s.io/api/certificates/v1 is supported given the current k8s version
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package discovery exposes helpers for detecting cluster shape (provider, multi-tenancy, served APIs) at operator startup.
|
Package discovery exposes helpers for detecting cluster shape (provider, multi-tenancy, served APIs) at operator startup. |