Skip to content

cEOS: make the RESTCONF bootstrap actually reach a running server - #17

Merged
mbakalarski merged 1 commit into
mainfrom
ceos-restconf-ssl-profile
Jul 30, 2026
Merged

cEOS: make the RESTCONF bootstrap actually reach a running server#17
mbakalarski merged 1 commit into
mainfrom
ceos-restconf-ssl-profile

Conversation

@mbakalarski

Copy link
Copy Markdown
Member

RESTCONF never came up on a cEOS node. The startup-config configures ssl profile restconf before the Job that creates the certificate it names, so EOS marks the profile invalid at boot — and creating the certificate afterwards does not revisit that verdict. management api restconf stayed at "SSL profile not in valid state", nothing listened on 6020, and the Job reported success throughout.

Found while exercising netclab-xp's RESTCONF scenarios against a real lab: every Request failed to connect, and ss -tnl on the device showed only 443.

Three fixes, each of which the lab needed on its own

Re-apply the SSL profile after generating the certificate. Only a config change re-evaluates the profile, and re-entering the same certificate ... key ... line is a no-op — so the profile is removed and re-added. Idempotent on re-runs.

Make the Job's checks honest. curl exits 0 on an HTTP 404, and during boot nginx answers on 443 with Page not found before eAPI is registered — so the old if ! curl reported "Certificate generated successfully" without ever having reached the device. Now --fail-with-body plus a check for "result", and a second request that asks the device whether RESTCONF is actually enabled.

Wait for the device in the container, not via restartPolicy. With OnFailure the whole cEOS boot had to fit inside backoffLimit restarts of a growing backoff. One node made it on the 3rd restart; the other exhausted all 6 and the Job failed. The wait is now an explicit 600s deadline, which leaves backoffLimit for real failures.

Verified

kind, two cEOS 4.36.1F nodes, cold boot, no manual intervention:

  • both Jobs Complete in ~2min with 0 restarts (previously: one Job Failed, one needed 2 restarts)
  • both logs show RESTCONF not up yet, retrying... before succeeding — the SSL profile is re-evaluated asynchronously, so that second loop is load-bearing too
  • both devices answer HTTP 200 on RESTCONF 6020 and eAPI 443

Note: chart-install-test.yml installs with the default values, whose only node is srlinux — so this cEOS path is not covered by CI.

Chart version bumped to 0.5.10.

🤖 Generated with Claude Code

RESTCONF never came up. The startup-config configures `ssl profile
restconf` before the Job that creates the certificate it names, so EOS
marks the profile invalid at boot -- and creating the certificate
afterwards does not revisit that verdict. `management api restconf`
stayed at "SSL profile not in valid state", nothing listened on 6020,
and the Job reported success throughout.

Three fixes, each of which the lab needed on its own:

- Re-apply the SSL profile after generating the certificate. Only a
  config change re-evaluates it, and re-entering the same `certificate`
  line is a no-op -- so the profile is removed and re-added.
- Make the Job's checks honest. curl exits 0 on an HTTP 404, and during
  boot nginx answers on 443 with "Page not found" before eAPI is
  registered, so the old `if ! curl` reported success without reaching
  the device. Now --fail-with-body plus a check for `"result"`, and a
  second request that asks the device whether RESTCONF is enabled.
- Wait for the device in the container instead of via restartPolicy.
  With OnFailure the whole cEOS boot had to fit inside backoffLimit
  restarts of a growing backoff; a slower node lost that race and the
  Job failed. The wait is now an explicit 600s deadline, which leaves
  backoffLimit for real failures.

Verified on kind with two cEOS 4.36.1F nodes: both Jobs complete in
~2min with no restarts, and both devices answer HTTP 200 on RESTCONF
6020 and eAPI 443 from a cold boot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mbakalarski
mbakalarski merged commit 3099928 into main Jul 30, 2026
1 check passed
@mbakalarski
mbakalarski deleted the ceos-restconf-ssl-profile branch July 30, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant