Helm
Our Helm charts repository is the quickest way to get started using Flex with Kubernetes.
Installation
Helm must be installed to use the charts. Please refer to Helm's documentation to get started.
Once Helm has been setup you need to add this repository to your Helm repositories:
helm repo add factorhouse https://charts.factorhouse.io
helm repo update
You can then run helm search repo factorhouse
to see the available charts.
Start a Flex Instance
The minimum information required by Flex to operate is:
- License Details
- Flink REST URL
See the Flex Documentation for a full list of configuration options.
- Community
- Enterprise
Using configuration provided via --set env.XYZ
Quoting Values
When using --set env.XXX
to pass configuration, some values may require quoting—especially if they contain commas, numbers, or quotation marks. Refer to the examples below for guidance.
Escaping Characters
Special characters may need to be escaped with \
when using --set
. For more information, see the Helm documentation.
Use the following to install from command line:
helm install --namespace factorhouse --create-namespace flex factorhouse/flex-ce \
--set env.LICENSE_ID="00000000-0000-0000-0000-000000000001" \
--set env.LICENSE_CODE="FLEX_COMMUNITY" \
--set env.LICENSEE="Factor House\, Inc." \ <-- note the quoted comma
--set env.LICENSE_EXPIRY="2022-01-01" \
--set env.LICENSE_SIGNATURE="638......A51" \
--set env.FLINK_REST_URL="http://flink-dev.svc"
NAME: flex-ce
LAST DEPLOYED: Mon May 31 17:22:21 2021
NAMESPACE: factorhouse
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace factorhouse -l "app.kubernetes.io/name=flex,app.kubernetes.io/instance=flex" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:3000 to use your application"
kubectl --namespace factorhouse port-forward $POD_NAME 3000:3000
Using environment variables defined in a ConfigMap
You can configure Flex with a ConfigMap of environment variables as follows:
helm install --namespace factorhouse --create-namespace flex factorhouse/flex-ce --set envFromConfigMap=flex-config
This approach expects a ConfigMap to be available within the factorhouse namespace in kube, to understand how to configure Flex with a local ConfigMap template see Start Flex with Local Changes.
See flex-ce-config.yaml.example for an example ConfigMapfile.
See the Kubernetes documentation on configuring all key value pairs in a config map as environment variables for more information.
Using configuration provided via --set env.XYZ
Quoting Values
When using --set env.XXX
to pass configuration, some values may require quoting—especially if they contain commas, numbers, or quotation marks. Refer to the examples below for guidance.
Escaping Characters
Special characters may need to be escaped with \
when using --set
. For more information, see the Helm documentation.
Use the following to install from command line:
helm install --namespace factorhouse --create-namespace flex factorhouse/flex \
--set env.LICENSE_ID="00000000-0000-0000-0000-000000000001" \
--set env.LICENSE_CODE="TRIAL_30D" \
--set env.LICENSEE="Factor House\, Inc." \ <-- note the quoted comma
--set env.LICENSE_EXPIRY="2022-01-01" \
--set env.LICENSE_SIGNATURE="638......A51" \
--set env.ALLOW_FLINK_SUBMIT="true" \
--set env.ALLOW_FLINK_JOB_TERMINATE="true" \
--set env.ALLOW_FLINK_JAR_DELETE="true" \
--set env.ALLOW_FLINK_JOB_EDIT="true" \
--set env.FLINK_REST_URL="http://flink-dev.svc"
NAME: flex
LAST DEPLOYED: Mon May 31 17:22:21 2021
NAMESPACE: factorhouse
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace factorhouse -l "app.kubernetes.io/name=flex,app.kubernetes.io/instance=flex" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:3000 to use your application"
kubectl --namespace factorhouse port-forward $POD_NAME 3000:3000
Using environment variables defined in a ConfigMap
You can configure Flex with a ConfigMap of environment variables as follows:
helm install --namespace factorhouse --create-namespace flex factorhouse/flex --set envFromConfigMap=flex-config
This approach expects a ConfigMap to be available within the factorhouse namespace in kube, to understand how to configure Flex with a local ConfigMap template see Start Flex with Local Changes.
See flex-config.yaml.example for an example ConfigMapfile.
See the Kubernetes documentation on configuring all key value pairs in a config map as environment variables for more information.
Manage a Flex instance
Access the Flex UI via port forwarding
- Community
- Enterprise
Follow the notes instructions to set the $POD_NAME
variable and configure port forwarding to the Flex UI.
export POD_NAME=$(kubectl get pods --namespace factorhouse -l "app.kubernetes.io/name=flex-ce,app.kubernetes.io/instance=flex-ce" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace factorhouse port-forward $POD_NAME 3000:3000
Flex is now available on http://127.0.0.1:3000.
Follow the notes instructions to set the $POD_NAME
variable and configure port forwarding to the Flex UI.
export POD_NAME=$(kubectl get pods --namespace factorhouse -l "app.kubernetes.io/name=flex,app.kubernetes.io/instance=flex" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace factorhouse port-forward $POD_NAME 3000:3000
Flex is now available on http://127.0.0.1:3000.
Check the Flex Pod
kubectl describe pods --namespace factorhouse
Name: flex-9988df6b6-vvf8z
Namespace: factorhouse
Priority: 0
Node: ip-172-31-33-42.ap-southeast-2.compute.internal/172.31.33.42
Start Time: Mon, 31 May 2021 17:22:22 +1000
Labels: app.kubernetes.io/instance=flex
app.kubernetes.io/name=flex
pod-template-hash=9988df6b6
Annotations: kubernetes.io/psp: eks.privileged
Status: Running
View the Flex Pod logs
kubectl logs --namespace factorhouse $POD_NAME
11:36:49.111 INFO [main] flex.system ? start Flex
...
Remove Flex
- Community
- Enterprise
Deletes the flex-ce
release from the factorhouse namespace using Helm.
helm delete --namespace factorhouse flex-ce
Deletes the flex
release from the factorhouse namespace using Helm.
helm delete --namespace factorhouse flex
Start Flex with local changes
You can run Flex with local edits to these charts and provide local configuration when running Flex.
Pull and untar the Flex Charts
- Community
- Enterprise
helm pull factorhouse/flex-ce --untar --untardir .
helm pull factorhouse/flex --untar --untardir .
Make local edits
- Community
- Enterprise
Make any edits required to flex-ce/Chart.yaml
or flex-ce/values.yaml
(adding volume mounts, etc).
Make any edits required to flex/Chart.yaml
or flex/values.yaml
(adding volume mounts, etc).
Run local Charts
- Community
- Enterprise
The command to run local charts is slightly different, see ./flex-ce
rather than factorhouse/flex-ce
.
helm install --namespace factorhouse --create-namespace flex ./flex-ce <.. --set configuration, etc ..>
The command to run local charts is slightly different, see ./flex
rather than factorhouse/flex
.
helm install --namespace factorhouse --create-namespace flex ./flex <.. --set configuration, etc ..>
Run with local ConfigMap configuration
- Community
- Enterprise
Place your local ConfigMap in the ./flex-ce/templates/
directory.
Your local ConfigMap can then be referenced with --set envFromConfigMap=flex-config
.
helm install --namespace factorhouse --create-namespace flex ./flex-ce --set envFromConfigMap=flex-config
See flex-ce-config.yaml.example for an example ConfigMap file.
See the Kubernetes documentation on configuring all key value pairs in a config map as environment variables for more information.
Place your local ConfigMap in the ./flex/templates/
directory.
Your local ConfigMap can then be referenced with --set envFromConfigMap=flex-config
.
helm install --namespace factorhouse --create-namespace flex ./flex --set envFromConfigMap=flex-config
See flex-config.yaml.example for an example ConfigMap file.
See the Kubernetes documentation on configuring all key value pairs in a config map as environment variables for more information.
Manage sensitive environment variables
- Community
- Enterprise
This helm chart accepts the name of a secret containing sensitive parameters, e.g.
apiVersion: v1
kind: Secret
metadata:
name: flex-secrets
data:
SASL_JAAS_CONFIG: a3JnLmFwYWNoXS5rYWZrYS5jb21tb24uc2VjdXJpdHkucGxhaW4uUGxhaW5Mb2dpbk2vZHVsZSByZXF1aXJiZCB1c2VybmFtZT0iTFQ1V0ZaV1BRWUpHNzRJQyIgcGFzc3dvcmQ9IjlYUFVYS3BLYUQxYzVJdXVNRjRPKzZ2NxJ0a1E4aS9yWUp6YlppdlgvZnNiTG51eGY4SnlFT1dUeXMvTnJ1bTAiBwo=
CONFLUENT_API_SECRET: NFJSejlReFNTTXlTcGhXdjNLMHNYY1F6UGNURmdadlNYT0ZXSXViWFJySmx2N3A2WStSenROQnVpYThvNG1NSRo=
kubectl apply -f ./flex-secrets.yaml --namespace factorhouse
Then run the helm chart (this can be used in conjunction with envFromConfigMap
)
See the Kubernetes documentation on configuring all key value pairs in a secret as environment variables for more information.
helm install --namespace factorhouse --create-namespace flex ./flex-ce --set envFromSecret=flex-secrets --set envFromConfigMap=flex-config
This helm chart accepts the name of a secret containing sensitive parameters, e.g.
apiVersion: v1
kind: Secret
metadata:
name: flex-secrets
data:
SASL_JAAS_CONFIG: a3JnLmFwYWNoXS5rYWZrYS5jb21tb24uc2VjdXJpdHkucGxhaW4uUGxhaW5Mb2dpbk2vZHVsZSByZXF1aXJiZCB1c2VybmFtZT0iTFQ1V0ZaV1BRWUpHNzRJQyIgcGFzc3dvcmQ9IjlYUFVYS3BLYUQxYzVJdXVNRjRPKzZ2NxJ0a1E4aS9yWUp6YlppdlgvZnNiTG51eGY4SnlFT1dUeXMvTnJ1bTAiBwo=
CONFLUENT_API_SECRET: NFJSejlReFNTTXlTcGhXdjNLMHNYY1F6UGNURmdadlNYT0ZXSXViWFJySmx2N3A2WStSenROQnVpYThvNG1NSRo=
kubectl apply -f ./flex-secrets.yaml --namespace factorhouse
Then run the helm chart (this can be used in conjunction with envFromConfigMap
)
See the Kubernetes documentation on configuring all key value pairs in a secret as environment variables for more information.
helm install --namespace factorhouse --create-namespace flex ./flex --set envFromSecret=flex-secrets --set envFromConfigMap=flex-config
Provide files to the Flex Pod
There are occasions where you must provide files to the Flex Pod in order for Flex to run correctly, such files include:
- RBAC configuration
- SSL Keystores
- SSL Truststores
How you provide these files is down to user preference, we are not able to provide any support or instruction in this regard.
You may find the Kubernetes documentation on injecting data into applications useful.
Flex memory and CPU requirements
These charts run Flex with Guaranteed QoS, having resource request and limit set to these values by default:
resources:
limits:
cpu: 2
memory: 8Gi
requests:
cpu: 2
memory: 8Gi
These default resource settings are conservative, suited to a deployment of Flex that manages multiple Flink clusters and associated resources.
When running Flex with a single Flink cluster you can experiment with reducing those resources as far as our suggested minimum:
Minimum resource requirements
resources:
limits:
cpu: 1
memory: 2Gi
requests:
cpu: 1
memory: 2Gi
Adjust these values from the command line like so:
helm install --namespace factorhouse --create-namespace flex factorhouse/flex \
--set resources.limits.cpu=1 \
--set resources.limits.memory=2Gi \
--set resources.requests.cpu=1 \
--set resources.requests.memory=2Gi
We recommend always having limits and requests set to the same value, as this set Flex in Guaranteed QoS and provides a much more reliable operation.