kaxil commented on a change in pull request #15937:
URL: https://github.com/apache/airflow/pull/15937#discussion_r635231614
##########
File path: docs/helm-chart/manage-dags-files.rst
##########
@@ -136,3 +137,65 @@ In this approach, Airflow will read the DAGs from a PVC
which has ``ReadOnlyMany
--set dags.persistence.enabled=true \
--set dags.persistence.existingClaim=my-volume-claim
--set dags.gitSync.enabled=false
+
+Mounting DAGs from a private Github repo using Git-Sync sidecar
+---------------------------------------------------------------
+Create a private repo on Github if you have not created one already.
+
+Then create your ssh keys:
+
+.. code-block:: bash
+
+ ssh-keygen -t rsa -b 4096 -C "[email protected]"
+
+and add the public key to your private repo (under ``Settings > Deploy keys``).
+
+Now, you have to create a Kubernetes Secret object with which the Git-Sync
sidecar will authenticate when
+fetching or syncing your DAGs from your private Github repo.
+
+You have to convert the private ssh key to a base64. You can convert the
private ssh key file like so:
+
+.. code-block:: bash
+
+ base64 <my-private-ssh-key> -w 0 > temp.txt
+
+Then copy the string from the ``temp.txt`` file and add it to a yaml file to
create your secret object.
+For example, ``my-ssh-secret.yaml`` should look like this:
+
+.. code-block:: yaml
+
+ apiVersion: v1
+ kind: Secret
+ metadata:
+ name: airflow-ssh-secret
+ data:
+ gitSshKey: '<base64-converted-ssh-private-key>'
+
+And from a terminal then run:
+
+.. code-block:: bash
+
+ kubectl create -f my-ssh-secret.yaml --namespace <your-airflow-namespace>
+
+You can easily create a yaml file to override values of interest in the
``values.yaml`` file. In this example, I will
+create a yaml file called ``override-values.yaml`` to override values in the
``values.yaml`` file.
+
+.. code-block:: yaml
+
+ dags:
+ gitSync:
+ enabled: true
+ repo: ssh://[email protected]/<username>/<private-repo-name>.git
+ branch: <branch-name>
+ subPath: ""
+ sshKeySecret: airflow-ssh-secret
+
+
+Finally, from the context of your Airflow Helm chart directory, you can
install Airflow:
+
+.. code-block:: bash
+
+ helm install airflow --namespace <your-airflow-namespace> . -f
override-values.yaml
Review comment:
Good point, yes.
I will create a PR while releasing the chart to make sure we are consistent
everywhere in the Helm Chart docs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]