Deploy SuperNode using HelmΒΆ
Note
Flower Helm charts are a Flower Enterprise feature. See Flower Enterprise for details.
The Flower Framework offers a unified approach to federated learning, analytics, and evaluation, allowing you to federate any workload, machine learning framework, or programming language.
This Helm chart installs the client-side components of the Flower Framework, specifically setting up the SuperNode.
The default installation configuration aims to replicate the functionality and setup of the provided Flower Framework releases.
Multi Project SetupΒΆ
To install multiple types of SuperNodes, such as a federation for running PyTorch and another for TensorFlow, you need to install the Helm Chart multiple times with different names. This allows each deployment to have its own configurations and dependencies.
For instance, you can install the Chart for the PyTorch setup by adjusting the values.yaml file as shown below:
supernode:
superlink:
address: my-superlink.example.com
port: 9092
node:
config:
partition-id: 0
num-partitions: 2
image:
registry: myregistry.example.com
repository: flwr/supernode
tag: 1.20.0-pytorch
Install this configuration using the following command:
$ helm install pytorch . --values values.yaml
This will deploy 10 SuperNodes named pytorch-flower-client-supernode-<random>
.
For a TensorFlow setup, modify the values.yaml
file as follows:
supernode:
replicas: 3
superlink:
address: my-other-superlink.example.com
port: 9092
node:
config:
partition-id: 1
num-partitions: 2
image:
registry: myregistry.example.com
repository: flwr/supernode
tag: 1.20.0-tensorflow
Install this configuration using the following command:
$ helm install tensorflow . --values values.yaml
This will deploy 3 SuperNodes named tensorflow-flower-client-supernode-<random>
.
Deploy Flower Framework with TLSΒΆ
To ensure TLS communication within the Flower framework, you need to configure your deployment with proper TLS certificates.
Note: If global.insecure
is set to False
, you must pre-provide a secret of
type kubernetes.io/tls
named flower-client-tls
.
Example configuration for TLS deployment:
global:
insecure: false
Deploy Flower Framework without TLSΒΆ
For testing or internal use, you might want to deploy the Flower framework without TLS. Be cautious as this exposes your deployment to potential security risks.
Example configuration for insecure deployment:
global:
insecure: true
Node AuthenticationΒΆ
To enable Node Authentication, you need to specify a private key in either PKCS8 or OpenSSH
(PEM-like) format. This example assumes that the SuperLink is also configured for Node
Authentication and recognizes the ecdsa-sha2-nistp384 [...]
public key of this SuperNode.
global:
insecure: false
[...]
nodeAuth:
enabled: true
authSupernodePrivateKey: |+
-----BEGIN OPENSSH PRIVATE KEY-----
[...]
-----END OPENSSH PRIVATE KEY-----
authSupernodePublicKey: ecdsa-sha2-nistp384 [...]
supernode:
enabled: true
superlink:
address: my-superlink.example.com
port: 9092
clientapp:
enabled: true
supernode:
address: my-supernode.example.com
port: 443
Isolated SetupΒΆ
Isolation All-in-OneΒΆ
To install SuperNode in isolation mode using the βprocessβ configuration, both the ClientApp and
SuperNode need to be enabled. By default, the ClientApp connects to the SuperNode internally
within the cluster, so there is no need to set supernode.address
and supernode.port
unless the
connection is external. This setup assumes that both components are running within the same cluster.
[...]
supernode:
enabled: true
[...]
isolationMode: process
[...]
clientapp:
enabled: true
[...]
Isolation DistributedΒΆ
You can also deploy the SuperNode and ClientApp separately. To do this, you need to deploy the
chart twice: once with supernode.enabled=true
and once with clientapp.enabled=true
. To allow
the ClientApp to connect to the SuperNode in this configuration, enable the SuperNode ingress by
setting supernode.ingress.enabled=true
. This setup is intended for scenarios where the components
run on different clusters or a hybrid environment involving Kubernetes and ClientApp native
installations.
[...]
supernode:
enabled: true
ingress:
enabled: true
[...]
[...]
clientapp:
enabled: true
supernode:
address: my-supernode.example.com
port: 443
[...]
Node ConfigurationΒΆ
You can add a node configuration to configure a SuperNode. The YAML datatype is preserved when passing it in the Python application:
supernode:
node:
config:
bool: false
int: 1
negative_int: -1
float: 21.23
negative_float: -1.34
string: value 1
int-as-string: "1"
ParametersΒΆ
Helm parametersΒΆ
Name |
Description |
Value |
---|---|---|
|
Replaces the name of the chart in the Chart.yaml |
|
|
Completely replaces the generated name. |
|
Global parametersΒΆ
Name |
Description |
Value |
---|---|---|
|
Default Annotations |
|
|
Default Labels |
|
|
Default PodLabels |
|
|
Default Domain |
|
|
Decide if you deploy the Flower Framework with TLS |
|
|
Default IngressClass |
|
|
Default node selector for all components |
|
|
Default tolerations for all components |
|
|
Default affinity preset for all components |
|
|
Default pod anti-affinity rules. Either: |
|
|
Default node affinity rules. Either: |
|
|
Default match expressions for node affinity |
|
|
Default Cert-Manager certificate annotations |
|
|
Enables or Disables Node-Authentication SuperLink <-> SuperNode |
|
|
Specifies the ecdsa-sha2-nistp384 private key |
|
|
Specifies the ecdsa-sha2-nistp384 public key |
|
|
Set Security Context runAsUser |
|
|
Set Security Context runAsGroup |
|
|
Set Security Context fsGroup |
|
|
Set Security Context runAsNonRoot |
|
|
Set Security Context readOnlyRootFilesystem |
|
|
Set Security Context allowPrivilegeEscalation |
|
|
Set Security Context seccompProfile |
|
|
Set Security Context capabilities |
|
|
Default environment variables |
|
|
Default image pullPolicy |
|
Component SuperNodeΒΆ
Name |
Description |
Value |
---|---|---|
|
Name of the SuperNode |
|
|
Enable or disable SuperNode |
|
|
Set container requests and limits for different resources like CPU or memory (essential for production workloads) |
|
|
|
|
|
The isolation mode of the SuperNode |
|
|
Set container requests and limits for different resources like CPU or memory (essential for production workloads) |
|
|
Address of the SuperLink the SuperNodes should connect to |
|
|
Port of the SuperLink the SuperNodes should connect to |
|
|
Specify a list of volumes for the SuperNode pod(s) |
|
|
Allows to specify additional VolumeMounts |
|
|
Automount SA-Token into the pod. |
|
|
Enable a service account for this component |
|
|
Annotations applied to enabled service account |
|
|
Labels applied to enabled service account |
|
|
Automount SA-Token |
|
|
Valid are ClusterIP, NodePort or Loadbalancer |
|
|
Prefix of the SuperNode ClientAppIO API port |
|
|
Port to expose for the SuperNode ClientAppIO API |
|
|
Node port for SuperNode ClientAppIO API |
|
|
Container port for SuperNode ClientAppIO API |
|
|
|
|
|
The number of SuperNode pods to run |
|
|
Extra labels for SuperNode pods |
|
|
Add extra arguments to the default arguments for the SuperNode |
|
|
Node labels for SuperNode pods which merges with global.nodeSelector |
|
|
Node tolerations for SuperNode pods which merges with global.tolerations |
|
|
SuperNode deployment strategy type |
|
|
SuperNode deployment rolling update configuration parameters |
|
|
Node affinity for SuperNode pods which merges with global.affinity |
|
|
Array with extra environment variables to add to SuperNode nodes which merges with global.env |
|
|
Enable the ingress resource |
|
|
Additional annotations for the ingress |
|
|
Defines which ingress controller which implement the resource |
|
|
Ingress TLS configuration |
|
|
Enable an ingress resource for SuperNode ClientAppIO |
|
|
Ingress hostname for the SuperNode ClientAppIO ingress |
|
|
SuperNode ClientAppIO ingress path |
|
|
Ingress path type. One of Exact, Prefix or ImplementationSpecific |
|
|
SuperNode container(s) to automate configuration before or after startup |
|
|
Additional custom annotations for SuperNode |
|
|
Extra selectorLabels for SuperNode pods |
|
|
Annotations for SuperNode pods |
|
|
Extra podLabels for SuperNode pods |
|
|
SuperNode image pull secrets which overrides global.imagePullSecrets |
|
|
SuperNode image registry |
|
|
SuperNode image repository |
|
|
Image tag of SuperNode |
|
|
Image digest of SuperNode |
|
|
Components image pullPolicy |
|
|
Specifies whether a NetworkPolicy should be created |
|
|
Allow external ingress traffic |
|
|
Allow unrestricted egress traffic |
|
|
Add extra ingress rules to the NetworkPolicy |
|
|
Add extra ingress rules to the NetworkPolicy (ignored if allowExternalEgress=true) |
|
|
Labels to match to allow traffic from other pods. Ignored if |
|
|
Labels to match to allow traffic from other namespaces. Ignored if |
|
|
Pod labels to match to allow traffic from other namespaces. Ignored if |
|
Component ClientAppΒΆ
Name |
Description |
Value |
---|---|---|
|
Name of the ClientApp |
|
|
Enable or disable ClientApp component |
|
|
|
|
|
Set container requests and limits for different resources like CPU or memory (essential for production workloads) |
|
|
Address of the supernode the ClientApp should connect to |
|
|
Specify a list of volumes for the ClientApp pod(s) |
|
|
Allows to specify additional VolumeMounts |
|
|
Automount SA-Token into the pod. |
|
|
Enable a service account for this component |
|
|
Annotations applied to enabled service account |
|
|
Labels applied to enabled service account |
|
|
Automount SA-Token |
|
|
Valid are ClusterIP, NodePort or Loadbalancer |
|
|
Prefix of the ClientApp ClientAppIO API port |
|
|
Ports to expose for the ClientApp ClientAppIO API |
|
|
Node port for ClientApp ClientAppIO API |
|
|
Container port for ClientApp ClientAppIO API |
|
|
|
|
|
The number of ClientApp pods to run |
|
|
Extra labels for ClientApp pods |
|
|
Add extra arguments to the default arguments for the ClientApp |
|
|
Node labels for ClientApp pods which merges with global.nodeSelector |
|
|
Node tolerations for ClientApp pods which merges with global.tolerations |
|
|
ClientApp deployment strategy type |
|
|
ClientApp deployment rolling update configuration parameters |
|
|
Node affinity for ClientApp pods which merges with global.affinity |
|
|
Array with extra environment variables to add to ClientApp nodes which merges with global.env |
|
|
ClientApp container(s) to automate configuration before or after startup |
|
|
Additional custom annotations for ClientApp |
|
|
Extra selectorLabels for ClientApp pods |
|
|
Annotations for ClientApp pods |
|
|
Extra podLabels for ClientApp pods |
|
|
ClientApp image pull secrets which overrides global.imagePullSecrets |
|
|
ClientApp image registry |
|
|
ClientApp image repository |
|
|
Image tag of ClientApp |
|
|
Image digest of ClientApp |
|
|
Components image pullPolicy |
|
|
Specifies whether a NetworkPolicy should be created |
|
|
Allow unrestricted egress traffic |
|
|
Add extra ingress rules to the NetworkPolicy (ignored if allowExternalEgress=true) |
|