-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(helm): add live logs deployment (#827) #827
feat(helm): add live logs deployment (#827) #827
Conversation
17afbaa
to
c56a418
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #827 +/- ##
==========================================
+ Coverage 29.80% 31.08% +1.27%
==========================================
Files 26 26
Lines 2486 2487 +1
==========================================
+ Hits 741 773 +32
+ Misses 1745 1714 -31
|
c56a418
to
ba8d585
Compare
ba8d585
to
ea1fb45
Compare
a526d7d
to
c8239fb
Compare
c8239fb
to
5746bf0
Compare
5746bf0
to
38da2a1
Compare
38da2a1
to
657e739
Compare
657e739
to
2be0faf
Compare
3f72a94
to
62dd874
Compare
62dd874
to
372f8cf
Compare
372f8cf
to
52766e0
Compare
52766e0
to
47e35de
Compare
47e35de
to
7377233
Compare
7377233
to
467be7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely 👍
I have squashed the two OpenSearch commits together, slightly rephrased the reana-dev
PyPAML commit, and switched off OpenSearch/FluentBit in the developer configuration for now until we put up a fix for that /var/reana/opensearch
directory ownership issue. (Just in case anyone may be trying master
out there).
diff --git a/helm/configurations/values-dev.yaml b/helm/configurations/values-dev.yaml
index ecf9d7a..e97f0e8 100644
--- a/helm/configurations/values-dev.yaml
+++ b/helm/configurations/values-dev.yaml
@@ -15,7 +15,7 @@ components:
environment:
REANA_RUNTIME_KUBERNETES_KEEP_ALIVE_JOBS_WITH_STATUSES: failed
REANA_OPENSEARCH_USE_SSL: false
- REANA_OPENSEARCH_ENABLED: false
+ REANA_OPENSEARCH_ENABLED: true
reana_workflow_engine_cwl:
image: docker.io/reanahub/reana-workflow-engine-cwl
reana_workflow_engine_yadage:
@@ -36,7 +36,7 @@ pgbouncer:
# OpenSearch configuration for dev environment
opensearch:
- enabled: false
+ enabled: true
tls:
generate: false
singleNode: true
@@ -67,7 +67,7 @@ opensearch:
# FluentBit configuration for dev environment
fluent-bit:
- enabled: false
+ enabled: true
outputConfig:
tls: "Off"
tlsCaFile: ""
Closes #824
OpenSearch
Optionally deploy OpenSearch alongside REANA (
enabled: false
by default).In dev environment, deploy one instance with security features off (i. e. no TLS, no authn/authz)
In prod, also only one OpenSearch node is configured. To add more nodes, each of these nodes needs to have its own
PersistentVolumeClaim
andPersistentVolume
as each node writes to a directory with the same name, but different contents - this will not work with currentreana-shared-persistent-volume
orreana-infrastructure-persistent-volume
. It is possible to usevolumeClaimTemplates
with theStorageClass
of choice (configured in OpenSearch Helm chartpersistence.storageClass
).Volumes configuration tested with nfs-ganesha-server-and-external-provisioner/nfs-server-provisioner, for one and multiple nodes.
OpenSearch allows deploying nodes of different types, e. g.
master
anddata
. This configuration would not allow to do it, we need to add the secondopensearch
dependency, e. g.opensearch-master
, and use the same Helm chart with different configuration. I think it is an overkill at this stage, as this is needed for bigger clusters.TLS certificates for OpenSearch nodes are generated automatically by a Helm function, similar to how it is done for Ingress, but without automatic rotation on each
helm upgrade
. It is possible for a user to supply his own certificates, by putting them in a secret and mounting to an OpenSearch pod (inopensearch.secretMounts
). Admin TLS certificates provide superadmin permissions to whoever uses them, and are stored in the same secret - there is no specific admin user.Two users are configured -
reana
andfluentbit
. Their passwords need to be prepared by first spinning up environment with Opensearch and runninghash.sh
script (described in docs):After getting the hashes for the passwords, they should be supplied to Helm with
--set opensearch.customSecurityConfig.internalUsers.reana.hash='$So$Me$pASsWOrD.HasH' --set opensearch.customSecurityConfig.internalUsers.fluentbit.hash='$So$Me$pASsWOrD.HasH'
.Also enabled SSL cert reload, which allows updating SSL certs without restarting OpenSearch instance. Link to docs provided in the comments for those who will want to use it.
FluentBit
Optionally deploy FluentBit alongside REANA (
enabled: false
by default). Collects job and workflow logs withtail
input plugin and pushes logs to OpenSearch. Allows configuring custom TLS certificates for OpenSearch connection.reana-dev
The command breaks Helm configuration if it contains long (multiline) strings. PyYAML library first reads the YAML config file, converts multiline strings to one long string delimited with
"
and then wraps it whiledump
ing, i. e.:If the string is used with Helm template values (
tpl
function), it adds whitespaces in places where\
was used, which results in malformed configuration for OpenSearch and FluentBit.dump(width=100000)
will add\
only if the string is longer than 100000 characters.It also requires user to escape certain characters in YAML values like
$
and\
. PyYAML converts|
strings to""
and Helm command is supplied with bad values.To avoid errors when loading/dumping
values.yaml
file, skip its loading altogether as there is no need to load it explicitly as it is always loaded by Helm itself. In casereleasehelm
mode is used forreana-dev cluster-deploy
, just use an empty dict for values and add overrides into it,values.yaml
will be loaded by default by Helm.How to test
Checkout reanahub/reana-workflow-controller#602 and reanahub/reana-job-controller#468 to retrieve live logs in REANA components. Checkout and install reanahub/reana-client#731 to watch live logs via CLI.
Dev setup
Deploy REANA as usual and run:
Prod setup
Deploy REANA as usual then run: