Skip to content

Commit

Permalink
added config status printout
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Mar 30, 2023
1 parent 0b6a7ed commit 5f02e1c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,25 @@ Note, that controller logs can be viewed live with:
kubectl logs --follow -n srlinux-controller $(kubectl get pods -A | grep srlinux-controller | awk '{print $2}')
```

This will deploy the SR Linux nodes and will create k8s services as per the topology configuration. The services will be exposed via MetalLB and can be queried as:
This will deploy the SR Linux nodes and will create k8s services as per the topology configuration.

SR Linux custom resources can be queried as:

```bash
kubectl get srlinux -A

NAMESPACE NAME AGE IMAGE STATUS READY CONFIG
2-srl-ixr6 srl1 42s ghcr.io/nokia/srlinux:latest Running true failed
2-srl-ixr6 srl2 42s ghcr.io/nokia/srlinux:latest Running true loaded
```

Available statuses:

- `STATUS`: `Running` when the underlying pod is running. The status is copied from the pod status.
- `READY`: `true` when the SR Linux node is ready to accept configuration. The status is `true` when SR Linux management servers is ready to accept connections and configurations.
- `CONFIG`: `loaded` when the startup-configuration is succesfully applied. The status is `failed` when errors occured during startup-configuration load.

The services will be exposed via MetalLB and can be queried as:

```text
❯ kubectl -n 3node-srlinux get svc
Expand Down
1 change: 1 addition & 0 deletions api/v1/srlinux_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type StartupConfigStatus struct {
// +kubebuilder:printcolumn:name="Image",type="string",JSONPath=".status.image"
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.status"
// +kubebuilder:printcolumn:name="Ready",type="boolean",JSONPath=".status.ready"
// +kubebuilder:printcolumn:name="Config",type="string",JSONPath=".status.startup-config.phase"
type Srlinux struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/kne.srlinux.dev_srlinuxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ spec:
- jsonPath: .status.ready
name: Ready
type: boolean
- jsonPath: .status.startup-config.phase
name: Config
type: string
name: v1
schema:
openAPIV3Schema:
Expand Down

0 comments on commit 5f02e1c

Please sign in to comment.