diff --git a/api/cluster-config/v1/clusterconfig_types.go b/api/cluster-config/v1/clusterconfig_types.go index 90012c77d6..4689b008a5 100644 --- a/api/cluster-config/v1/clusterconfig_types.go +++ b/api/cluster-config/v1/clusterconfig_types.go @@ -25,26 +25,35 @@ import ( // ClusterConfigSpec defines the desired state of ClusterConfig type ClusterConfigSpec struct { + //AdvertisementConfig defines the configuration for the advertisement protocol AdvertisementConfig AdvertisementConfig `json:"advertisementConfig"` DiscoveryConfig DiscoveryConfig `json:"discoveryConfig"` LiqonetConfig LiqonetConfig `json:"liqonetConfig"` DispatcherConfig DispatcherConfig `json:"dispatcherConfig,omitempty"` } +//AdvertisementConfig defines the configuration for the advertisement protocol type AdvertisementConfig struct { + //OutgoingConfig defines the behaviour for the creation of Advertisements on other clusters OutgoingConfig BroadcasterConfig `json:"outgoingConfig"` - IngoingConfig AdvOperatorConfig `json:"ingoingConfig"` + //IngoingConfig defines the behaviour for the acceptance of Advertisements from other clusters + IngoingConfig AdvOperatorConfig `json:"ingoingConfig"` + //KeepaliveThreshold defines the number of failed attempts to contact the foreign cluster your cluster will tolerate before deleting it. // +kubebuilder:validation:Minimum=0 KeepaliveThreshold int32 `json:"keepaliveThreshold,omitempty"` + //After establishing a sharing with a foreign cluster, a keepalive mechanism starts, in order to know if the foreign cluster is reachable or not. + //KeepaliveRetryTime defines the time between an attempt to contact the foreign cluster and the next one. // +kubebuilder:validation:Minimum=0 KeepaliveRetryTime int32 `json:"keepaliveRetryTime,omitempty"` } type BroadcasterConfig struct { + //ResourceSharingPercentage defines the percentage of your cluster resources that you will share with foreign clusters // +kubebuilder:validation:Maximum=100 // +kubebuilder:validation:Minimum=0 ResourceSharingPercentage int32 `json:"resourceSharingPercentage"` - EnableBroadcaster bool `json:"enableBroadcaster"` + //EnableBroadcaster flag allows you to enable/disable the broadcasting of your Advertisement to the foreign clusters + EnableBroadcaster bool `json:"enableBroadcaster"` } // AcceptPolicy defines the policy to accept/refuse an Advertisement @@ -60,8 +69,13 @@ const ( ) type AdvOperatorConfig struct { + // MaxAcceptableAdvertisement defines the maximum number of Advertisements that can be accepted // +kubebuilder:validation:Minimum=0 MaxAcceptableAdvertisement int32 `json:"maxAcceptableAdvertisement"` + // AcceptPolicy defines the policy to accept/refuse an Advertisement. + // Possible values are AutoAcceptWithinMaximum and Manual. + // AutoAcceptWithinMaximum means all the Advertisement received will be accepted until the MaxAcceptableAdvertisement limit is reached; + // Manual means every Advertisement received will need a manual accept/refuse, which can be done by updating its status. // +kubebuilder:validation:Enum="AutoAcceptWithinMaximum";"Manual" AcceptPolicy AcceptPolicy `json:"acceptPolicy"` } diff --git a/deployments/liqo_chart/crds/policy.liqo.io_clusterconfigs.yaml b/deployments/liqo_chart/crds/policy.liqo.io_clusterconfigs.yaml index d4159f6100..a9b8c90b3c 100644 --- a/deployments/liqo_chart/crds/policy.liqo.io_clusterconfigs.yaml +++ b/deployments/liqo_chart/crds/policy.liqo.io_clusterconfigs.yaml @@ -37,17 +37,28 @@ spec: description: ClusterConfigSpec defines the desired state of ClusterConfig properties: advertisementConfig: + description: AdvertisementConfig defines the configuration for the advertisement + protocol properties: ingoingConfig: + description: IngoingConfig defines the behaviour for the acceptance + of Advertisements from other clusters properties: acceptPolicy: description: AcceptPolicy defines the policy to accept/refuse - an Advertisement + an Advertisement. Possible values are AutoAcceptWithinMaximum + and Manual. AutoAcceptWithinMaximum means all the Advertisement + received will be accepted until the MaxAcceptableAdvertisement + limit is reached; Manual means every Advertisement received + will need a manual accept/refuse, which can be done by updating + its status. enum: - AutoAcceptWithinMaximum - Manual type: string maxAcceptableAdvertisement: + description: MaxAcceptableAdvertisement defines the maximum + number of Advertisements that can be accepted format: int32 minimum: 0 type: integer @@ -56,18 +67,33 @@ spec: - maxAcceptableAdvertisement type: object keepaliveRetryTime: + description: After establishing a sharing with a foreign cluster, + a keepalive mechanism starts, in order to know if the foreign + cluster is reachable or not. KeepaliveRetryTime defines the time + between an attempt to contact the foreign cluster and the next + one. format: int32 minimum: 0 type: integer keepaliveThreshold: + description: KeepaliveThreshold defines the number of failed attempts + to contact the foreign cluster your cluster will tolerate before + deleting it. format: int32 minimum: 0 type: integer outgoingConfig: + description: OutgoingConfig defines the behaviour for the creation + of Advertisements on other clusters properties: enableBroadcaster: + description: EnableBroadcaster flag allows you to enable/disable + the broadcasting of your Advertisement to the foreign clusters type: boolean resourceSharingPercentage: + description: ResourceSharingPercentage defines the percentage + of your cluster resources that you will share with foreign + clusters format: int32 maximum: 100 minimum: 0 diff --git a/deployments/liqo_chart/subcharts/adv_chart/templates/adv-deploy.yaml b/deployments/liqo_chart/subcharts/adv_chart/templates/adv-deploy.yaml index d3a1da8f8a..d7c71d3b22 100644 --- a/deployments/liqo_chart/subcharts/adv_chart/templates/adv-deploy.yaml +++ b/deployments/liqo_chart/subcharts/adv_chart/templates/adv-deploy.yaml @@ -62,6 +62,10 @@ spec: - "$(CLUSTER_ID)" - "--kubelet-namespace" - "$(POD_NAMESPACE)" + - "--kubelet-image" + - {{ .Values.virtualKubelet.image.repository }}{{ .Values.global.suffix | default .Values.suffix }}:{{ .Values.global.version | default .Values.version }} + - "--init-kubelet-image" + - {{ .Values.initVk.image.repository }}{{ .Values.global.suffix | default .Values.suffix }}:{{ .Values.global.version | default .Values.version }} env: - name: CLUSTER_ID valueFrom: diff --git a/deployments/liqo_chart/subcharts/adv_chart/values.yaml b/deployments/liqo_chart/subcharts/adv_chart/values.yaml index 200952174d..2f5d715573 100644 --- a/deployments/liqo_chart/subcharts/adv_chart/values.yaml +++ b/deployments/liqo_chart/subcharts/adv_chart/values.yaml @@ -12,5 +12,15 @@ broadcaster: repository: "liqo/advertisement-broadcaster" pullPolicy: "IfNotPresent" +virtualKubelet: + image: + repository: "liqo/virtual-kubelet" + pullPolicy: "IfNotPresent" + +initVk: + image: + repository: "liqo/init-vkubelet" + pullPolicy: "IfNotPresent" + suffix: "" version: "latest" \ No newline at end of file diff --git a/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/templates/peering-request-deploy.yaml b/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/templates/peering-request-deploy.yaml index c1beea22e9..668f5dc34c 100644 --- a/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/templates/peering-request-deploy.yaml +++ b/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/templates/peering-request-deploy.yaml @@ -80,6 +80,8 @@ spec: args: - "--input-env-file" - "/etc/environment/liqo/env" + - "--broadcaster-image" + - {{ .Values.broadcaster.image.repository }}{{ .Values.global.suffix | default .Values.suffix }}:{{ .Values.global.version | default .Values.version }} env: - name: POD_NAMESPACE valueFrom: diff --git a/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/values.yaml b/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/values.yaml index c88a6340d2..00116f5fa2 100644 --- a/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/values.yaml +++ b/deployments/liqo_chart/subcharts/peeringRequestOperator_chart/values.yaml @@ -15,6 +15,10 @@ deployment: image: repository: "liqo/peering-request-webhook-init" pullPolicy: "IfNotPresent" +broadcaster: + image: + repository: "liqo/advertisement-broadcaster" + pullPolicy: "IfNotPresent" suffix: "" diff --git a/docs/pages/User/Configure/cluster-config.md b/docs/pages/User/Configure/cluster-config.md index c3c26b933d..ede2c057d0 100644 --- a/docs/pages/User/Configure/cluster-config.md +++ b/docs/pages/User/Configure/cluster-config.md @@ -12,7 +12,8 @@ There are 3 main sections you can configure: ## Advertisement configuration -In this section you can configure your cluster behaviour regarding the Advertisement broadcasting and acceptance: +In this section you can configure your cluster behaviour regarding the Advertisement broadcasting and acceptance, +and the parameters for the [keepalive check](#keepalive-check): * **OutgoingConfig** defines the behaviour for the creation of the Advertisement for other clusters. - `enableBroadcaster` flag allows you to enable/disable the broadcasting of your Advertisement to the foreign clusters your cluster knows - `resourceSharingPercentage` defines the percentage of your cluster resources that you will share with other clusters @@ -21,7 +22,14 @@ In this section you can configure your cluster behaviour regarding the Advertise - `acceptPolicy` defines the policy to accept or refuse a new Advertisement from a foreign cluster. The possible policies are: - `AutoAcceptWthinMaximum`: every Advertisement is automatically checked considering the configured maximum. - `ManualAccept`: every Advertisement needs to be manually accepted or refused; this mode is not implemented yet. - + +### Keepalive check + +After establishing a sharing with a foreign cluster (i.e. you have received an Advertisement and are using that cluster resources), a keepalive mechanism starts, +in order to know if the foreign cluster is reachable or not. In the AdvertisementConfig you can configure: +* `KeepaliveThreshold`: the number of failed attempts to contact the foreign cluster your cluster will tolerate before deleting it. +* `KeepaliveRetryTime`: the time between an attempt and the next one. + ## Discovery configuration ## Network configuration