Skip to content

Commit 686fbbd

Browse files
committed
wip
1 parent 2afcc9f commit 686fbbd

24 files changed

+179
-216961
lines changed

Tiltfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,11 @@ k8s_yaml(device_yaml())
4242
k8s_resource(new_name='leaf1', objects=['leaf1:device', 'secret-basic-auth:secret'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
4343

4444
k8s_yaml('./config/samples/v1alpha1_interface.yaml')
45-
k8s_yaml('./config/samples/cisco/nx/v1alpha1_portchannelconfig.yaml')
4645
k8s_resource(new_name='lo0', objects=['lo0:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
4746
k8s_resource(new_name='lo1', objects=['lo1:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
4847
k8s_resource(new_name='eth1-1', objects=['eth1-1:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
4948
k8s_resource(new_name='eth1-2', objects=['eth1-2:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
5049
k8s_resource(new_name='svi-10', objects=['svi-10:interface'], resource_deps=['vlan-10'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
51-
k8s_resource(new_name='eth1-10', objects=['eth1-10:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
52-
# Interface resources relevant to vPC configuration are defined below in the "vpcdomain" sample
53-
#k8s_resource(new_name='po1-cfg', objects=['po1-cfg:portchannelconfig'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
54-
#k8s_resource(new_name='po2', objects=['po2:interface'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)
5550

5651
k8s_yaml('./config/samples/v1alpha1_banner.yaml')
5752
k8s_resource(new_name='banner', objects=['banner:banner'], trigger_mode=TRIGGER_MODE_MANUAL, auto_init=False)

api/cisco/nx/v1alpha1/portchannelconfig_types.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

api/cisco/nx/v1alpha1/vpcdomain_types.go

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,16 @@ type KeepAlive struct {
141141
Source string `json:"source"`
142142

143143
// VRFRef is an optional reference to a VRF resource.
144-
// If specified, the keepalive will use this VRF for routing keepalive packets.
145-
// Typically used when keepalive is over a management VRF.
146-
// Maps to: "peer-keepalive destination <Destination> source <Source> vrf <VRFRef.Name>"
147-
// The VRF must exist on the Device referenced by the parent VPCDomain resource.
144+
// If specified, the keepalive will use this VRF for routing keepalive packets,
145+
// e.g., the management VRF.
148146
// If omitted, the default VRF is used.
147+
// Maps to: "peer-keepalive destination <Destination> source <Source> vrf <VRFRef.Name>"
149148
// +optional
150149
VRFRef *corev1.LocalObjectReference `json:"vrfRef,omitempty"`
151150
}
152151

153-
// AutoRecovery holds auto-recovery settings.
154-
// It allows a vPCDomain peer to automatically restore vPCDomain operation after detecting
155-
// that the peer is no longer reachable via keepalive link.
152+
// AutoRecovery holds settings to automatically restore vPCDomain operation after detecting
153+
// that the peer is no longer reachable via the keepalive link.
156154
// +kubebuilder:validation:XValidation:rule="self.enabled ? has(self.reloadDelay) : !has(self.reloadDelay)",message="reloadDelay must be set when enabled and absent when disabled"
157155
type AutoRecovery struct {
158156
// Enabled indicates whether auto-recovery is enabled.
@@ -162,8 +160,7 @@ type AutoRecovery struct {
162160
Enabled bool `json:"enabled,omitempty"`
163161

164162
// ReloadDelay is the time in seconds (60-3600) to wait before assuming the peer is dead
165-
// and automatically recovering vPCDomain operation.
166-
// Must be set when Enabled is true.
163+
// and automatically attempting to restore the communication with the peer.
167164
// Maps to: "auto-recovery reload-delay <ReloadDelay>"
168165
// +optional
169166
// +kubebuilder:validation:Minimum=60
@@ -177,7 +174,16 @@ type VPCDomainStatus struct {
177174
// Standard conditions include:
178175
// - Ready: overall readiness of the vPCDomain domain
179176
// - Configured: whether the vPCDomain configuration was successfully applied to the device
180-
// - Operational: whether the vPCDomain domain is operationally up (peer-link and keepalive status)
177+
// - Operational: whether the vPCDomain domain is operationally up. This condition is true when
178+
// the status fields `PeerLinkIfOperStatus`, `KeepAliveStatus`, and `PeerStatus` are all set
179+
// to `UP`.
180+
// - Degraded: whether the vPCDomain peerlink or the keepalive sessions are in a degraded state.
181+
//
182+
// For this Cisco model there is not one single unique operational property that reflects the
183+
// operational status of the vPC domain. The combination of peer status, keepalive status, and
184+
// the interface used as peer-link determine the overall health and operational condition of
185+
// the vPC domain.
186+
//
181187
//+listType=map
182188
//+listMapKey=type
183189
//+patchStrategy=merge
@@ -190,24 +196,38 @@ type VPCDomainStatus struct {
190196
DomainID uint16 `json:"domainId,omitempty"`
191197

192198
// Role indicates the current operational role of this vPCDomain peer.
193-
// Possible values:
194-
// - Primary: This switch is the primary vPCDomain peer (lower role priority or elected)
195-
// - Secondary: This switch is the secondary vPCDomain peer
196-
// - Unknown: Role has not been established (e.g., peer-link down, domain not formed)
197199
// +optional
198200
Role VPCDomainRole `json:"role,omitempty"`
199201

200-
// KeepaliveStatus indicates the status of the peer via the keepalive link.
202+
// KeepAliveStatus indicates the status of the peer via the keepalive link.
203+
// +optional
204+
KeepAliveStatus Status `json:"keepaliveStatus,omitempty"`
205+
206+
// KeepAliveStatusMsg provides additional information about the keepalive status as comma separated codes, as returned by the device.
201207
// +optional
202-
KeepaliveStatus KeepAliveStatus `json:"keepaliveStatus,omitempty"`
208+
KeepAliveStatusMsg string `json:"keepaliveStatusMsg,omitempty"`
203209

204-
// PeerStatus indicates the status of the vPCDomain peer-link.
210+
// PeerStatus indicates the status of the vPCDomain peer-link in the latest consistency check with the peer. This means that if
211+
// the adjacency is lost, e.g., due to a shutdown link, the device will not be able to perform such check and the reported status
212+
// will remain unchanged (with the value of the last check).
205213
// +optional
206-
PeerStatus PeerStatus `json:"peerStatus,omitempty"`
214+
PeerStatus Status `json:"peerStatus,omitempty"`
215+
216+
// PeerStatusMsg provides additional information about the peer status as comma separated codes, as returned by the device.
217+
// +optional
218+
PeerStatusMsg string `json:"peerStatusMsg,omitempty"`
207219

208220
// PeerUptime indicates how long the vPCDomain peer has been up and reachable via keepalive.
209221
// +optional
210222
PeerUptime metav1.Duration `json:"peerUptime,omitempty"`
223+
224+
// PeerLinkIf is the name of the interface used as the vPCDomain peer-link.
225+
// +optional
226+
PeerLinkIf string `json:"peerLinkIf,omitempty"`
227+
228+
// PeerLinkIfOperStatus is the Operational status of `PeerLinkIf`.
229+
// +optional
230+
PeerLinkIfOperStatus Status `json:"peerLinkIfOperStatus,omitempty"`
211231
}
212232

213233
// The VPCDomainRole type represents the operational role of a vPCDomain peer as returned by the device.
@@ -221,18 +241,12 @@ const (
221241
VPCDomainRoleUnknown VPCDomainRole = "Unknown"
222242
)
223243

224-
type KeepAliveStatus string
225-
226-
const (
227-
KeepAliveStatusUp KeepAliveStatus = "Up"
228-
KeepAliveStatusDown KeepAliveStatus = "Down"
229-
)
230-
231-
type PeerStatus string
244+
type Status string
232245

233246
const (
234-
PeerStatusUp PeerStatus = "Up"
235-
PeerStatusDown PeerStatus = "Down"
247+
StatusUnknown Status = "Unknown"
248+
StatusUp Status = "Up"
249+
StatusDown Status = "Down"
236250
)
237251

238252
// +kubebuilder:object:root=true
@@ -246,10 +260,12 @@ const (
246260
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
247261
// +kubebuilder:printcolumn:name="Configured",type=string,JSONPath=`.status.conditions[?(@.type=="Configured")].status`,priority=1
248262
// +kubebuilder:printcolumn:name="Operational",type=string,JSONPath=`.status.conditions[?(@.type=="Operational")].status`,priority=1
249-
// +kubebuilder:printcolumn:name="Role",type=string,JSONPath=`.status.role`,priority=1
250-
// +kubebuilder:printcolumn:name="KeepAliveStatus",type=string,JSONPath=`.status.keepaliveStatus`,priority=1
251263
// +kubebuilder:printcolumn:name="PeerStatus",type=string,JSONPath=`.status.peerStatus`,priority=1
252-
// +kubebuilder:printcolumn:name="PeerUptime",type="string",JSONPath=`.status.peerUptime`,priority=1
264+
// +kubebuilder:printcolumn:name="Role",type=string,JSONPath=`.status.role`,priority=1
265+
// +kubebuilder:printcolumn:name="PeerLinkIf",type="string",JSONPath=".status.peerLinkIf",priority=1
266+
// +kubebuilder:printcolumn:name="PeerLinkIfOperSt",type="string",JSONPath=".status.peerLinkIfOperStatus",priority=1
267+
// +kubebuilder:printcolumn:name="KA-PeerStatus",type=string,JSONPath=`.status.keepaliveStatus`,priority=1
268+
// +kubebuilder:printcolumn:name="KA-PeerUptime",type="string",JSONPath=`.status.peerUptime`,priority=1
253269
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
254270

255271
// VPCDomain is the Schema for the VPCDomains API

api/cisco/nx/v1alpha1/zz_generated.deepcopy.go

Lines changed: 0 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/core/v1alpha1/groupversion_info.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ const (
7575
// intended (e.g., a interface is up). It corresponds to the "oper-status" commonly found
7676
// in the OpenConfig models (or "operSt" on Cisco).
7777
OperationalCondition = "Operational"
78+
79+
// DegradedCondition indicates whether the resource is in a degraded state.
80+
// This condition indicates whether the resource is experiencing issues that impact its performance
81+
// or functionality, but does not render it completely non-functional.
82+
DegradedCondition = "Degraded"
7883
)
7984

8085
// Reasons that are used across different objects.

api/core/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/nx.cisco.networking.metal.ironcore.dev_portchannelconfigs.yaml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)