Skip to content

Commit 7e2366a

Browse files
AvetrisAitor VelezSdgJlbl
authored
doc: update how to deploy guide (#445)
* Update how to deployment Signed-off-by: Aitor Velez <[email protected]> * Apply suggestions from code review * Fix warnings for CI * Fix warnings for CI --------- Signed-off-by: Aitor Velez <[email protected]> Co-authored-by: Aitor Velez <[email protected]> Co-authored-by: SdgJlbl <[email protected]>
1 parent 46ff3fb commit 7e2366a

File tree

4 files changed

+55
-8
lines changed

4 files changed

+55
-8
lines changed

docs/source/how-to/deploying-substra/walkthrough/20-orchestrator-deployment.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ To setup TLS, follow these steps:
126126
127127
rm orchestrator-cert.csr orchestrator-ca.srl
128128
129-
#. Create a Kubernetes ConfigMap for the CA certificate:
129+
#. Create a Kubernetes Secret for the CA certificate:
130130

131131
.. code-block:: bash
132132
133-
kubectl create configmap orchestrator-tls-cacert --from-file=ca.crt=orchestrator-ca.crt
133+
kubectl create secret generic orchestrator-tls-cacert --from-file=ca.crt=orchestrator-ca.crt
134134
135135
#. Create a Kubernetes Secret for the orchestrator TLS key and certificate:
136136

docs/source/how-to/deploying-substra/walkthrough/30-backend-deployment.rst

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,12 @@ To configure your values:
4949
host: ORCHESTRATOR_HOSTNAME
5050
port: ORCHESTRATOR_PORT
5151
mspID: ingen
52+
sameCluster: ORCHESTRATOR_SAME_CLUSTER
53+
5254
5355
| ``ORCHESTRATOR_HOSTNAME`` should be ``orchestrator.cluster-1.DOMAIN`` if you are _outside_ the cluster, but if we are working on ``cluster-1`` we should use its local name ``orchestrator-server.orchestrator`` (following the ``service-name.namespace`` convention).
5456
| ``ORCHESTRATOR_PORT`` should be ``443`` if TLS is enabled, otherwise ``80``.
57+
| ``ORCHESTRATOR_SAME_CLUSTER`` should be ``true`` if the backend is in the same cluster as the orchestrator, otherwise ``false``.
5558
5659
.. _backend-channel-config:
5760

@@ -126,4 +129,28 @@ Deploy the Chart
126129

127130
.. code-block:: javascript
128131
129-
{"detail":"Authentication credentials were not provided."}
132+
{"detail":"Authentication credentials were not provided."}
133+
134+
Execution Problems
135+
==================
136+
137+
Once everything is deployed, if there are execution problems when adding a function to substra, it can be related with the network policy.
138+
139+
#. Check the log of the pod ``backend-substra-backend-builder-0``
140+
141+
.. code-block:: bash
142+
143+
kubectl logs backend-substra-builder-0 -n ingen
144+
145+
#. If there there is ```HTTPSConnectionPool(host='10.43.0.1', port=443)``` error, modify the next network policies:
146+
147+
Remove all the network policies except the ```substra-backend-internet-egress``` network policy.
148+
149+
Add the next lines inside the to section for the ```substra-backend-api-server-egress``` network policy:
150+
151+
.. code-block:: yaml
152+
153+
- to:
154+
- ipBlock:
155+
cidr: 0.0.0.0/0
156+

docs/source/how-to/deploying-substra/walkthrough/40-connect-organizations.rst

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Update your Helm values
1010
=======================
1111

1212
This guide assume that you have two organization in your network, one named ``ingen`` and the other ``biotechnica``.
13-
The process would be the same if you have more organizations as we have to pair them. For example with three orgs you would repeat it for (org1, org2), (org1, org3) and (org2, org3).
13+
The process would be the same if you have more organizations as we have to pair them. We have also to pair the organization with itself. For example with three orgs you would repeat it for (org1, org1), (org2, org2), (org3, org3), (org1, org2), (org1, org3) and (org2, org3).
1414

1515
In this setup we want ``ingen`` to exchange assets with ``biotechnica``.
1616
We are assuming that you have two values files with the configuration for your existing deployment, one for each organization named: ``backend-ingen-values.yaml``, ``backend-biotechnica-values.yaml``.
@@ -28,7 +28,7 @@ Configure matching values for your 2 :term:`Organizations <Organization>`:
2828
secret: SECRET_ORG1_ORG2
2929
channel: our-channel
3030
31-
| ``SECRET_ORG1_ORG2`` is a password ``biotechnica`` needs to download assets from ``ingen``.
31+
| ``SECRET_ORG1_ORG2`` is a pbkdf2_sha2 encrypted password ``biotechnica`` needs to download assets from ``ingen``.
3232
| ``our-channel`` was defined in the :ref:`backend channel configuration <backend-channel-config>` -- both ``ingen`` and ``biotechnica`` are members of it.
3333
3434
#. Create an account for ``ingen`` on ``biotechnica``.
@@ -51,7 +51,7 @@ Configure matching values for your 2 :term:`Organizations <Organization>`:
5151
- name: biotechnica
5252
secret: SECRET_ORG2_ORG1
5353
54-
| ``SECRET_ORG2_ORG1`` must naturally be the same as earlier.
54+
| ``SECRET_ORG2_ORG1`` must naturally be the same as earlier, but without pbkdf2_sha2 encryption.
5555
5656
#. Configure ``biotechnica`` to use the right password when connecting to ``ingen``.
5757
In ``backend-biotechnica-values.yaml`` add the following content under the ``addAccountOperator`` key:
@@ -93,6 +93,25 @@ in ``backend-ingen-values.yaml``, and:
9393
in ``backend-biotechnica-values.yaml``.
9494

9595

96+
For linking organizations we also provide a small utility on the Substra backend server. Follow these steps on each organization to achieve the same result:
97+
98+
#. Connect to the Substra backend pod:
99+
100+
.. code-block:: bash
101+
102+
kubectl exec -it $(kubectl get pod -l "app.kubernetes.io/name=substra-backend-server" -o name) -- /bin/bash
103+
104+
This opens a shell on the backend server pod.
105+
106+
#. Create incoming and outgoing organization:
107+
108+
.. code-block:: bash
109+
110+
./manage.py create_incoming_organization "<organization_id>" "<password>"
111+
./manage.py create_outgoing_organization "<organization_id>" "<password>"
112+
113+
The utility will encrypt the password authomatically.
114+
96115
Deploy the updated chart
97116
========================
98117

docs/source/how-to/deploying-substra/walkthrough/50-frontend-deployment.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Tell the backend to set the proper headers for cross-origin resources, by adding
1616
.. code-block:: yaml
1717
1818
config:
19-
CORS_ORIGIN_WHITELIST: '["substra.cluster-1.DOMAIN"]' # this is a string parsed as a JSON list
20-
CORS_ALLOW_CREDENTIALS: True
19+
CORS_ORIGIN_WHITELIST: '["https://substra.cluster-1.DOMAIN"]' # this is a string parsed as a JSON list
20+
CSRF_TRUSTED_ORIGINS: '["https://substra.cluster-1.DOMAIN"]'
21+
CORS_ALLOW_CREDENTIALS: 'true'
2122
# you should already have ALLOWED_HOSTS under "config"
2223
2324
Prepare your Helm values

0 commit comments

Comments
 (0)