Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Network"
crdName: networks.config.openshift.io
featureGates:
- NetworkDiagnosticsConfig
tests:
onCreate:
- name: Should be able to set network diagnostics sourcePlacement and targetPlacement when mode is not set
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Network"
crdName: networks.config.openshift.io
featureGates:
- NetworkLiveMigration
tests:
onCreate:
- name: Should be able to set status conditions
Expand Down
4 changes: 1 addition & 3 deletions config/v1/types_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Network struct {
// As a general rule, this SHOULD NOT be read directly. Instead, you should
// consume the NetworkStatus, as it indicates the currently deployed configuration.
// Currently, most spec fields are immutable after installation. Please view the individual ones for further details on each.
// +openshift:validation:FeatureGateAwareXValidation:featureGate=NetworkDiagnosticsConfig,rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled"
// +kubebuilder:validation:XValidation:rule="!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode) || self.networkDiagnostics.mode!='Disabled' || !has(self.networkDiagnostics.sourcePlacement) && !has(self.networkDiagnostics.targetPlacement)",message="cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement when networkDiagnostics.mode is Disabled"
type NetworkSpec struct {
// IP address pool to use for pod IPs.
// This field is immutable after installation.
Expand Down Expand Up @@ -85,7 +85,6 @@ type NetworkSpec struct {
// the network diagnostics feature will be disabled.
//
// +optional
// +openshift:enable:FeatureGate=NetworkDiagnosticsConfig
NetworkDiagnostics NetworkDiagnostics `json:"networkDiagnostics"`
}

Expand Down Expand Up @@ -119,7 +118,6 @@ type NetworkStatus struct {
// +optional
// +listType=map
// +listMapKey=type
// +openshift:enable:FeatureGate=NetworkDiagnosticsConfig
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

Expand Down
3 changes: 1 addition & 2 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,7 @@ networks.config.openshift.io:
CRDName: networks.config.openshift.io
Capability: ""
Category: ""
FeatureGates:
- NetworkDiagnosticsConfig
FeatureGates: []
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,152 @@ spec:
x-kubernetes-list-type: atomic
type: object
type: object
networkDiagnostics:
description: |-
networkDiagnostics defines network diagnostics configuration.

Takes precedence over spec.disableNetworkDiagnostics in network.operator.openshift.io.
If networkDiagnostics is not specified or is empty,
and the spec.disableNetworkDiagnostics flag in network.operator.openshift.io is set to true,
the network diagnostics feature will be disabled.
properties:
mode:
description: |-
mode controls the network diagnostics mode

When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is All.
enum:
- ""
- All
- Disabled
type: string
sourcePlacement:
description: |-
sourcePlacement controls the scheduling of network diagnostics source deployment

See NetworkDiagnosticsSourcePlacement for more details about default values.
properties:
nodeSelector:
additionalProperties:
type: string
description: |-
nodeSelector is the node selector applied to network diagnostics components

When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is `kubernetes.io/os: linux`.
type: object
tolerations:
description: |-
tolerations is a list of tolerations applied to network diagnostics components

When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is an empty list.
items:
description: |-
The pod this Toleration is attached to tolerates any taint that matches
the triple <key,value,effect> using the matching operator <operator>.
properties:
effect:
description: |-
Effect indicates the taint effect to match. Empty means match all taint effects.
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: |-
Key is the taint key that the toleration applies to. Empty means match all taint keys.
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
type: string
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
type: string
tolerationSeconds:
description: |-
TolerationSeconds represents the period of time the toleration (which must be
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
it is not set, which means tolerate the taint forever (do not evict). Zero and
negative values will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: |-
Value is the taint value the toleration matches to.
If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
targetPlacement:
description: |-
targetPlacement controls the scheduling of network diagnostics target daemonset

See NetworkDiagnosticsTargetPlacement for more details about default values.
properties:
nodeSelector:
additionalProperties:
type: string
description: |-
nodeSelector is the node selector applied to network diagnostics components

When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is `kubernetes.io/os: linux`.
type: object
tolerations:
description: |-
tolerations is a list of tolerations applied to network diagnostics components

When omitted, this means the user has no opinion and the platform is left
to choose reasonable defaults. These defaults are subject to change over time.
The current default is `- operator: "Exists"` which means that all taints are tolerated.
items:
description: |-
The pod this Toleration is attached to tolerates any taint that matches
the triple <key,value,effect> using the matching operator <operator>.
properties:
effect:
description: |-
Effect indicates the taint effect to match. Empty means match all taint effects.
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
type: string
key:
description: |-
Key is the taint key that the toleration applies to. Empty means match all taint keys.
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
type: string
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
type: string
tolerationSeconds:
description: |-
TolerationSeconds represents the period of time the toleration (which must be
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
it is not set, which means tolerate the taint forever (do not evict). Zero and
negative values will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: |-
Value is the taint value the toleration matches to.
If the operator is Exists, the value should be empty, otherwise just a regular string.
type: string
type: object
type: array
x-kubernetes-list-type: atomic
type: object
type: object
networkType:
description: |-
networkType is the plugin that is to be deployed (e.g. OVNKubernetes).
Expand Down Expand Up @@ -142,6 +288,12 @@ spec:
pattern: ^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])-([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
type: string
type: object
x-kubernetes-validations:
- message: cannot set networkDiagnostics.sourcePlacement and networkDiagnostics.targetPlacement
when networkDiagnostics.mode is Disabled
rule: '!has(self.networkDiagnostics) || !has(self.networkDiagnostics.mode)
|| self.networkDiagnostics.mode!=''Disabled'' || !has(self.networkDiagnostics.sourcePlacement)
&& !has(self.networkDiagnostics.targetPlacement)'
status:
description: status holds observed values from the cluster. They may not
be overridden.
Expand Down Expand Up @@ -169,6 +321,68 @@ spec:
clusterNetworkMTU:
description: clusterNetworkMTU is the MTU for inter-pod networking.
type: integer
conditions:
description: |-
conditions represents the observations of a network.config current state.
Known .status.conditions.type are: "NetworkDiagnosticsAvailable"
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
migration:
description: migration contains the cluster network migration configuration.
properties:
Expand Down
Loading