-
Notifications
You must be signed in to change notification settings - Fork 686
Description
The research institute I am working for has its own GitLab instance. My team has its own group and inside we have subgroups and what not. The repository I would like to use has the following URL (placeholders used due to privacy):
https://gitlab.example.com/institute/department/research-group/cloud-computing/administration/k8s-playground.git
As you can see the structure is nested:
institute- the name of the institutedepartment- the name of the department with focus on specific research area(s)research-group- the name of the team with focus on specific research area(s)cloud-computing- a sub-group of the my team's group I have created (I am the owner) to put everything related to cloud in itadministration- a sub-group of thecloud-computinggroup for admin tasks (e.g. GitOps for managing the infrastructure)k8s-playground- the actual project that will be used byfluxto sync the Kubernetes (in my case an Ubuntu 22.04 Server withmicrok8s; for setting upfluxto work withmicrok8ssee here )
I am quite new to GitOps and Kubernetes in general but I do believe that flux is rather confusing when it comes to anything that is not in the form of
https://gitlab.example.com/USER/REPOSITORY.git
The URL I have used at the beginning needs to be split into chunks that, given the name of the argument --owner, is anything but helpful. It took me half an hour trying to figure out what's going on:
flux bootstrap gitlab --hostname=https://gitlab.example.com --repository=k8s-playground --branch=main --path=./clusters/playground/ --token-auth --owner=institute/department/research-group/cloud-computing/administration
Notice the absence of trailing/leading /, which is an extra thing the user needs to consider not to mention the absence of .git suffix. I do realize that internally a lot of concatenation is going on and this is how I managed to figure out what to put where.
However in the end --owner=institute/department/research-group/cloud-computing/administration is not really the owner but rather a nested structure.
I would suggest to rename the owner to something like url-path or similar. Best would be remove that completely and just go with the full URL for the --repository argument since most people are familiar with that anyway. I would further suggest to remove the requirement to discard the .git suffix and remove --hostname:
flux bootstrap gitlab --repository=https://gitlab.example.com/institute/department/research-group/cloud-computing/administration/k8s-playground.git --branch=main --path=./clusters/playground/ --token-auth
In the end hostname can be extracted inside flux itself (plenty of regexes out there for doing that).