Skip to content

Commit

Permalink
Fix helm deployments
Browse files Browse the repository at this point in the history
missing parameter in adv operator and peering request operator
  • Loading branch information
fraborg committed Aug 28, 2020
1 parent 6690103 commit 816f1e5
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 5 deletions.
18 changes: 16 additions & 2 deletions api/cluster-config/v1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"`
}
Expand Down
28 changes: 27 additions & 1 deletion deployments/liqo_chart/crds/policy.liqo.io_clusterconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions deployments/liqo_chart/subcharts/adv_chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ deployment:
image:
repository: "liqo/peering-request-webhook-init"
pullPolicy: "IfNotPresent"
broadcaster:
image:
repository: "liqo/advertisement-broadcaster"
pullPolicy: "IfNotPresent"


suffix: ""
Expand Down
12 changes: 10 additions & 2 deletions docs/pages/User/Configure/cluster-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 816f1e5

Please sign in to comment.