Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Upgrade Status #216

Merged
merged 6 commits into from
Dec 13, 2024
Merged

Enhance Upgrade Status #216

merged 6 commits into from
Dec 13, 2024

Conversation

mateoflorido
Copy link
Member

@mateoflorido mateoflorido commented Dec 11, 2024

Overview

Enhance status visibility during cluster upgrades.

Rationale

To better surface the current state of the cluster upgrade, this pull request introduces an improvement for the k8s leader unit to track and report the upgrade status. This includes showing how many control plane and worker units are still pending upgrade in the unit status message.

Example

Model        Controller      Cloud/Region         Version  SLA          Timestamp
k8s-cluster  lxd-controller  localhost/localhost  3.6.1    unsupported  14:53:30-05:00

App         Version  Status   Scale  Charm       Channel  Rev  Exposed  Message
k8s         1.31.3   waiting      2  k8s                    2  no       Upgrading 2 Worker units
k8s-worker  1.31.2   active       2  k8s-worker             0  no       Ready

Unit           Workload  Agent  Machine  Public address                          Ports     Message
k8s-worker/0*  active    idle   2        10.65.65.88                                       Ready
k8s-worker/1   active    idle   3        10.65.65.188                                      Ready
k8s/0*         waiting   idle   0        10.65.65.233                            6443/tcp  Upgrading 2 Worker units
k8s/1          active    idle   1        fd42:4317:5983:ea1c:216:3eff:fe98:be57  6443/tcp  Ready

Machine  State    Address                                 Inst id        Base          AZ  Message
0        started  10.65.65.233                            juju-dca78a-0  [email protected]      Running
1        started  fd42:4317:5983:ea1c:216:3eff:fe98:be57  juju-dca78a-1  [email protected]      Running
2        started  10.65.65.88                             juju-dca78a-2  [email protected]      Running
3        started  10.65.65.188                            juju-dca78a-3  [email protected]      Running

@mateoflorido mateoflorido requested a review from a team as a code owner December 11, 2024 21:16
Copy link
Contributor

@eaudetcobello eaudetcobello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits to improve the user-facing output, great work otherwise!

charms/worker/k8s/src/charm.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/charm.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/charm.py Outdated Show resolved Hide resolved
charms/worker/k8s/src/charm.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@addyess addyess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets go

Copy link
Contributor

Test coverage for 3e9c4ba

coverage-report: install_deps /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> python -I -m pip install 'coverage[toml]'
coverage-report: commands[0] /home/runner/work/k8s-operator/k8s-operator/charms/worker/k8s> coverage report
Name                                    Stmts   Miss  Cover
-----------------------------------------------------------
lib/charms/k8s/v0/k8sd_api_manager.py     278     29    90%
src/charm.py                              497    250    50%
src/cloud_integration.py                   80      3    96%
src/config/extra_args.py                   29      2    93%
src/containerd.py                         140     16    89%
src/cos_integration.py                     33     12    64%
src/events/update_status.py                51     10    80%
src/inspector.py                           40      4    90%
src/kube_control.py                        39     31    21%
src/literals.py                            21      0   100%
src/protocols.py                           26      5    81%
src/reschedule.py                          77      4    95%
src/snap.py                               185     26    86%
src/token_distributor.py                  181    109    40%
src/upgrade.py                            105     48    54%
-----------------------------------------------------------
TOTAL                                    1782    549    69%
coverage-report: OK (1.26=setup[1.04]+cmd[0.21] seconds)
congratulations :) (1.31 seconds)

Static code analysis report

Run started:2024-12-13 17:12:54.809390

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 3818
  Total lines skipped (#nosec): 3
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@mateoflorido mateoflorido merged commit 543b9de into main Dec 13, 2024
61 checks passed
@mateoflorido mateoflorido deleted the KU-1698/upgrade-status branch December 13, 2024 19:20
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.

4 participants