Skip to content

Commit

Permalink
Add Gateway charm options (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
bschimke95 authored Nov 20, 2024
1 parent 5f78ebb commit bfb3166
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions charms/worker/k8s/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ config:
"Retain". If set to "Delete", the storage will be deleted when the
PersistentVolumeClaim is deleted. If set to "Retain", the storage will
be retained when the PersistentVolumeClaim is deleted.
gateway-enabled:
type: boolean
default: false
description: |
Enable/Disable the gateway feature on the cluster.
actions:
get-kubeconfig:
Expand Down
6 changes: 6 additions & 0 deletions charms/worker/k8s/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
ControlPlaneNodeJoinConfig,
CreateClusterRequest,
DNSConfig,
GatewayConfig,
InvalidResponseError,
JoinClusterRequest,
K8sdAPIManager,
Expand Down Expand Up @@ -413,12 +414,17 @@ def _assemble_cluster_config(self) -> UserFacingClusterConfig:
# https://github.com/canonical/k8s-operator/pull/169/files#r1847378214
)

gateway = GatewayConfig(
enabled=self.config.get("gateway-enabled"),
)

cloud_provider = None
if self.xcp.has_xcp:
cloud_provider = "external"

return UserFacingClusterConfig(
local_storage=local_storage,
gateway=gateway,
annotations=self._get_valid_annotations(),
cloud_provider=cloud_provider,
)
Expand Down

0 comments on commit bfb3166

Please sign in to comment.