Skip to content

Commit

Permalink
Merge branch 'main' into m/1.31-literal
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoflorido committed Nov 22, 2024
2 parents 0f40eb1 + 9909a91 commit 8cd92b6
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 128 deletions.
2 changes: 1 addition & 1 deletion charms/worker/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ bases:

config:
options:
labels:
node-labels:
default: ""
type: string
description: |
Expand Down
164 changes: 136 additions & 28 deletions charms/worker/k8s/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,59 @@ config:
Example:
e.g.: key1=value1 key2=value2
containerd_custom_registries:
bootstrap-datastore:
default: dqlite
type: string
description: |
The datastore to use in Canonical Kubernetes. This cannot be changed
after deployment. Allowed values are "dqlite" and "etcd". If "etcd" is
chosen, the charm should be integrated with the etcd charm.
bootstrap-node-taints:
type: string
default: ""
description: |
Space-separated list of taints to apply to this node at registration time.
This config is only used at bootstrap time when Kubelet first registers the
node with Kubernetes. To change node taints after deploy time, use kubectl
instead.
For more information, see the upstream Kubernetes documentation about
taints:
https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
bootstrap-pod-cidr:
type: string
default: "10.1.0.0/16"
description: |
Comma-separated CIDR blocks for IP addresses that can be assigned
to pods within the cluster. Can contain at most 2 blocks, one for IPv4
and one for IPv6.
After deployment it is not possible to change the size of
the IP range.
Examples:
- "192.0.2.0/24"
- "2001:db8::/32"
- "192.0.2.0/24,2001:db8::/32"
- "2001:db8::/32,192.0.2.0/24"
bootstrap-service-cidr:
type: string
default: 10.152.183.0/24
description: |
Comma-separated CIDR blocks for IP addresses that can be assigned
to services within the cluster. Can contain at most 2 blocks, one for IPv4
and one for IPv6.
After deployment it is not possible to change the size of
the IP range.
Examples:
- "192.0.2.0/24"
- "2001:db8::/32"
- "192.0.2.0/24,2001:db8::/32"
- "2001:db8::/32,192.0.2.0/24"
containerd-custom-registries:
type: string
default: "[]"
description: |
Expand Down Expand Up @@ -127,40 +179,85 @@ config:
"cert_file": "'"$(base64 -w 0 < ~/my.custom.cert.pem)"'",
"key_file": "'"$(base64 -w 0 < ~/my.custom.key.pem)"'",
}]'
datastore:
default: dqlite
dns-enabled:
type: boolean
default: true
description: |
Enable/Disable the DNS feature on the cluster.
dns-cluster-domain:
type: string
default: "cluster.local"
description: |
The datastore to use in Canonical Kubernetes. This cannot be changed
after deployment. Allowed values are "dqlite" and "etcd". If "etcd" is
chosen, the charm should be integrated with the etcd charm.
labels:
Sets the local domain of the cluster
dns-service-ip:
type: string
default: ""
description: |
Sets the IP address of the dns service. If omitted defaults to the IP address
of the Kubernetes service created by the feature.
Can be used to point to an external dns server when feature is disabled.
dns-upstream-nameservers:
type: string
default: ""
description: |
Labels can be used to organize and to select subsets of nodes in the
cluster. Declare node labels in key=value format, separated by spaces.
register-with-taints:
Space-separated list of upstream nameservers used to forward queries for out-of-cluster
endpoints.
If omitted defaults to `/etc/resolv.conf` and uses the nameservers on each node.
gateway-enabled:
type: boolean
default: false
description: |
Enable/Disable the gateway feature on the cluster.
load-balancer-enabled:
type: boolean
default: false
description: |
Enable/Disable the load balancer feature on the cluster.
load-balancer-cidrs:
type: string
default: ""
description: |
Space-separated list of taints to apply to this node at registration time.
This config is only used at deploy time when Kubelet first registers the
node with Kubernetes. To change node taints after deploy time, use kubectl
instead.
For more information, see the upstream Kubernetes documentation about
taints:
https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
service-cidr:
Space-separated list of CIDRs to use for the load balancer. This is
only used if load-balancer-enabled is set to true.
load-balancer-l2-mode:
type: boolean
default: false
description: |
Enable/Disable L2 mode for the load balancer. This is only used if
load-balancer-enabled is set to true.
load-balancer-l2-interfaces:
type: string
default: 10.152.183.0/24
default: ""
description: |
CIDR to use for Kubernetes services. After deployment it is
only possible to increase the size of the IP range. It is not possible to
change or shrink the address range after deployment.
Space-separated list of interfaces to use for the load balancer. This
is only used if load-balancer-l2-mode is set to true. if unset, all
interfaces will be used.
load-balancer-bgp-mode:
type: boolean
default: false
description: |
Enable/Disable BGP mode for the load balancer. This is only used if
load-balancer-enabled is set to true.
load-balancer-bgp-local-asn:
type: int
default: 64512
description: |
Local ASN for the load balancer. This is only used if load-balancer-bgp-mode
is set to true.
load-balancer-bgp-peer-address:
type: string
default: ""
description: |
Address of the BGP peer for the load balancer. This is only used if
load-balancer-bgp-mode is set to true.
load-balancer-bgp-peer-port:
type: int
default: 179
description: |
Port of the BGP peer for the load balancer. This is only used if
load-balancer-bgp-mode is set to true.
local-storage-enabled:
type: boolean
default: true
Expand All @@ -184,11 +281,22 @@ 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:
metrics-server-enabled:
type: boolean
default: false
default: true
description: |
Enable/Disable the gateway feature on the cluster.
Enable/Disable the metrics-server feature on the cluster.
network-enabled:
type: boolean
default: true
description: |
Enables or disables the network feature.
node-labels:
default: ""
type: string
description: |
Labels can be used to organize and to select subsets of nodes in the
cluster. Declare node labels in key=value format, separated by spaces.
resources:
snap-installation:
Expand Down
8 changes: 4 additions & 4 deletions charms/worker/k8s/lib/charms/k8s/v0/k8sd_api_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ class LoadBalancerConfig(BaseModel, allow_population_by_field_name=True):
Attributes:
enabled: Optional flag which represents the status of LoadBalancer.
cidrs: List of CIDR blocks for the load balancer.
l2_enabled: Optional flag to enable or disable layer 2 functionality.
l2_mode: Optional flag to enable or disable layer 2 mode.
l2_interfaces: List of layer 2 interfaces for the load balancer.
bgp_enabled: Optional flag to enable or disable BGP.
bgp_mode: Optional flag to enable or disable BGP.
bgp_local_asn: The local ASN for BGP configuration.
bgp_peer_address: The peer address for BGP configuration.
bgp_peer_asn: The peer ASN for BGP configuration.
Expand All @@ -241,9 +241,9 @@ class LoadBalancerConfig(BaseModel, allow_population_by_field_name=True):

enabled: Optional[bool] = Field(default=None)
cidrs: Optional[List[str]] = Field(default=None)
l2_enabled: Optional[bool] = Field(default=None, alias="l2-enabled")
l2_mode: Optional[bool] = Field(default=None, alias="l2-mode")
l2_interfaces: Optional[List[str]] = Field(default=None, alias="l2-interfaces")
bgp_enabled: Optional[bool] = Field(default=None, alias="bgp-enabled")
bgp_mode: Optional[bool] = Field(default=None, alias="bgp-mode")
bgp_local_asn: Optional[int] = Field(default=None, alias="bgp-local-asn")
bgp_peer_address: Optional[str] = Field(default=None, alias="bgp-peer-address")
bgp_peer_asn: Optional[int] = Field(default=None, alias="bgp-peer-asn")
Expand Down
2 changes: 1 addition & 1 deletion charms/worker/k8s/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
charm-lib-contextual-status @ git+https://github.com/charmed-kubernetes/charm-lib-contextual-status@255dd4a23defc16dcdac832306e5f460a0f1200c
charm-lib-interface-external-cloud-provider @ git+https://github.com/charmed-kubernetes/charm-lib-interface-external-cloud-provider@e1c5fc69e98100a7d43c0ad5a7969bba1ecbcd40
charm-lib-node-base @ git+https://github.com/charmed-kubernetes/layer-kubernetes-node-base@9b212854e768f13c26cc907bed51444e97e51b50#subdirectory=ops
charm-lib-node-base @ git+https://github.com/charmed-kubernetes/layer-kubernetes-node-base@a14d685237302711113ac651920476437b3b9785#subdirectory=ops
charm-lib-reconciler @ git+https://github.com/charmed-kubernetes/charm-lib-reconciler@f818cc30d1a22be43ffdfecf7fbd9c3fd2967502
ops-interface-kube-control @ git+https://github.com/charmed-kubernetes/interface-kube-control.git@main#subdirectory=ops
ops.interface_aws @ git+https://github.com/charmed-kubernetes/interface-aws-integration@main#subdirectory=ops
Expand Down
Loading

0 comments on commit 8cd92b6

Please sign in to comment.