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

Implement k8s clustering #15

Merged
merged 6 commits into from
Feb 2, 2024
Merged

Implement k8s clustering #15

merged 6 commits into from
Feb 2, 2024

Conversation

mateoflorido
Copy link
Member

Overview

Implement the Join Cluster process for k8s charm units.

Rationale

This pull request introduces the implementation for joining multiple control plane units into the cluster via the cluster peer relation. This relation utilizes Juju secrets for distributing the cluster join tokens over the relation data.

Juju Events Changes

  • Handlers have been added for the cluster relation (create_cluster_tokens and join_cluster).

@mateoflorido mateoflorido requested a review from a team as a code owner February 2, 2024 14:49
Comment on lines 170 to 175
if self.unit.is_leader():
self._bootstrap_k8s_snap()
self._enable_components()
self._create_cluster_tokens()
else:
self._join_cluster()
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

@mateoflorido mateoflorido force-pushed the KU-291/join-control-units branch from 4fc25a1 to 8286831 Compare February 2, 2024 17:39
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.

This is looking so nice... a few questions still

charms/k8s/src/charm.py Outdated Show resolved Hide resolved
charms/k8s/src/charm.py Outdated Show resolved Hide resolved
@on_error(WaitingStatus("Waiting for Cluster token"), TypeError)
def _join_cluster(self):
"""Retrieve the join token from secret databag and join the cluster."""
if self.api_manager.is_cluster_bootstrapped():
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

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.

100% LGTM

@mateoflorido mateoflorido merged commit fdc58b6 into main Feb 2, 2024
31 checks passed
@mateoflorido mateoflorido deleted the KU-291/join-control-units branch February 2, 2024 21:46
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.

2 participants