Skip to content

Commit

Permalink
Change COS Token user:group
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoflorido committed Oct 24, 2023
1 parent ff5092d commit 3e0088f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

log = logging.getLogger(__name__)

OBSERVABILITY_USER = OBSERVABILITY_ROLE = "system:cos-monitoring-control-plane"
OBSERVABILITY_ROLE = "system:cos"
JobConfig = namedtuple("JobConfig", ["name", "metrics_path", "scheme", "target"])


Expand Down Expand Up @@ -316,8 +316,9 @@ def configure_observability(self):
if self.unit.is_leader():
kubectl("apply", "-f", "templates/observability.yaml")
# Issue a token for metrics scraping
cos_user = f"system:cos:{kubernetes_snaps.get_node_name()}"
auth_webhook.create_token(
uid=self.model.unit.name, username=OBSERVABILITY_USER, groups=[OBSERVABILITY_ROLE]
uid=self.model.unit.name, username=cos_user, groups=[OBSERVABILITY_ROLE]
)

def generate_tokens(self):
Expand Down

0 comments on commit 3e0088f

Please sign in to comment.