Mount CVMFS repositories on Kubernetes
The CVMFS CSI Plugin isn't stable yet, so we have to do it the old way: using hostPath
.
Helm and Docker resources
The Helm resources are stored on ClusterFactory Git Repository.
The Dockerfile is described in the git repository cvmfs/cvmfs.
A Docker image can be pulled with:
docker pull docker.io/cvmfs/cvmfs:latest
1. AppProject
Apply the AppProject:
kubectl apply -f argo/cvmfs/app-project.yaml
2. Secrets
Create a SealedSecret which contains the keys of the repositories:
- Create a
-secret.yaml.local
file:
apiVersion: v1
kind: Secret
metadata:
name: cvmfs-keys-secret
namespace: cvmfs
type: Opaque
stringData:
software.sion.csquare.run.pub: |
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
- Seal the secret:
cfctl kubeseal
- Apply the SealedSecret:
kubectl apply -f argo/cvmfs/secrets/cvmfs-keys-sealed-secret.yaml
3. Editing cvmfs-service-app.yaml
to use the fork
Change the repoURL
to the URL used to pull the fork. Also add the values-production.yaml
file to customize the values.
source:
# You should have forked this repo. Change the URL to your fork.
repoURL: git@github.com:<your account>/ClusterFactory.git
# You should use your branch too.
targetRevision: HEAD
path: helm/cvmfs-service
helm:
releaseName: cvmfs-service
# Create a values file inside your fork and change the values.
valueFiles:
- values-production.yaml
4. Adding custom values to the chart
Read the values.yaml
to see all the default values.
4.a. Create the values file
Create the values file values-production.yaml
inside the helm/cvmfs-service/
directory.
4.b. Select the CVMFS repositories
repositories:
- name: software-sion-csquare-run
repository: software.sion.csquare.run
4.c. Configure the CVMFS client
# ...
configs:
default.local:
mountPath: default.local
contents: |
CVMFS_QUOTA_LIMIT=-1
CVMFS_USE_GEOAPI=no
CVMFS_HTTP_PROXY="DIRECT"
CVMFS_KEYS_DIR="/etc/cvmfs/keys"
CVMFS_SERVER_URL="http://cvmfs.ch1.deepsquare.run/cvmfs/@fqrn@"
CVMFS_USER=root
4.d. Configure the keys
# ...
keys:
secretName: 'cvmfs-keys-secret'
The keys will be mounted on the /etc/cvmfs/keys
directory. If you wish to change the path of each key:
#...
keys:
secretName: 'cvmfs-keys-secret'
items:
- key: software.sion.csquare.run.pub
path: sion.csquare.run/software.sion.csquare.run.pub
The key will be moved to the path /etc/cvmfs/keys/sion.csquare.run/software.sion.csquare.run.pub
.
5. Deploy the CVMFS service
Commit and push:
git add .
git commit -m "Added CVMFS service"
git push
And deploy the Argo CD application:
kubectl apply -f argo/provisioning/apps/cvmfs-service-app.yaml