sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.9k stars 2.14k forks source link

Include builtin-kas in docker image provided by @kkimurak #2736

Open yougotborked opened 1 year ago

yougotborked commented 1 year ago

I would like to request builtin-kas be added to the image. See the fork provided by @kkimurak


As already reported above (https://github.com/sameersbn/docker-gitlab/pull/2598#issuecomment-1172864976), this image currently does not provides built-in KAS. This PR requires external KAS is exists.

If you have time to do that, could you please try to build and test my support-builtin-kas branch ?
In addition to the work done by @antt1995, I've made sure to build gitlab-kas when building the image and add setting for supervisord to launch kas if enabled. Also I have added configuration file for KAS and minimal configuration parameters.

I have never used Kubernetes so never tested if the registration success, but made sure the gitlab-kas service starts without exiting.
Here are new entries for env of docker-compose.yml on test:

services:
  gitlab:
    environment:
      GITLAB_KAS_ENABLED: 'true'
      # If we don't set this, built-in gitlab-kas will exit with an error
      # See https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/8069d9b79763859b5bcead437a28f4dc73b66ae8/cmd/kas/kasapp/configured_app.go#L96-98
      OWN_PRIVATE_API_URL: grpc://127.0.0.1:8155

Originally posted by @kkimurak in https://github.com/sameersbn/docker-gitlab/issues/2598#issuecomment-1225428725

kkimurak commented 1 year ago

Hi @yougotborked , thanks for your request. Since you quoted me, I will write my stance on it. Sorry, but I am not going to create a pull request about it, at least not right now.

I was hoping that someone who needed it would test it, but there was no response. Unfortunately, I am a very selfish contributor and I am not going to spend my time testing a feature that I have no intention of using.

So, as we are not customer but community, if anyone is interested in this feature, I would appreciate it if you could confirm that it works (and possibly fix the problem) and open a pull request. I'll help if needed.

yougotborked commented 1 year ago

Sorry for the delay in responding, I finally had some time to try to get it working today.

yougotborked commented 1 year ago

Sorry didn't mean to close, I'll add more detail in a bit

yougotborked commented 1 year ago

So far these are the changes I've had to make to even get things to start running, @kkimurak is the latest version of your changes pushed to your fork/branch?

When I attempt to register an agent with a repository, I get this eror

image

I have the following in my docker-compose

    - GITLAB_KAS_ENABLED=true
    - OWN_PRIVATE_API_URL=grpc://127.0.0.1:8150
    - GITLAB_KAS_EXTERNAL=wws://git.myurl.com/-/kubernetes-agent/
    - GITLAB_KAS_PROXY=https://git.myurl.com/-/kubernetes-agent/k8s-proxy/
kkimurak commented 1 year ago

First of all, I am thankful for taking the time to verify this code. And sorry but I have noticed that there is no change to assets/build/install.sh to build built-in KAS. It seems that I have dropped some commit during git-rebase by mistake.

I will restore the work and update my branch tonight (at least 7~8 hours later), so could you be so kind to wait for the work?

yougotborked commented 1 year ago

Sure, no problem. thanks for taking a look

kkimurak commented 1 year ago

@yougotborked Sorry for late, I have pushed support-builtin-kas_wip branch (kkimurak@08310de3). I have confirmed that built-in kas (v15.10.0) launches successfully, but got "GRPC::Unauthenticated" on registering agent and not sure what configuration am I missing.

image

I'll try to solve it, but if you have time, I'd appreciate it if you could build it yourself and see if it works.

Also, please note that there are some changes to configuration parameters


changelog

cristianorevil commented 1 year ago

Hi there, i'm interesting to have this feature, there is some news?

yougotborked commented 1 year ago

Hi there, i'm interesting to have this feature, there is some news?

I have not had a chance to test the changes yet, but its on my to do list at some point.

Just so everyone knows my use case here, I'm self-hosting gitlab on a truenas scale VM running docker at the moment, and want to move it into the Truenas scale kubernetes feature. the only way to connect gitlab to their kubernetes implementation is via the kas agent running in the cluster node. They lock down manual manipulation of many features since they try to treat it more like an appliance rather than debian with a truenas GUI on top.

I also have gitlab runners deploying to docker running on vms now, but want them to be able to deploy directly to the truenas cluster.

th-2021 commented 7 months ago

I tried to set it up (using https://github.com/kkimurak/docker-gitlab/tree/support-builtin-kas). I'm getting Error: not a valid boolean value: '' in section 'program:gitlab_kas' (file: '/etc/supervisor/conf.d/gitlab-kas.conf')

Am I missing something?

These are my settings: (gitlab runs within kubernetes cluster)

th-2021 commented 7 months ago

Looks like /home/git/gitlab-agent/gitlab-kas_config.yaml is missing.

th-2021 commented 7 months ago

Another setting is required:

Now I get:

Failed to register an agent GRPC::Unimplemented

What else could be missing?

kkimurak commented 7 months ago

@th-2021 Thank you for trying my patch. I rebased all the working branches on hand and it may cause problems (I did a build with gitlab 16.0.1 combined against gitlab-agent (KAS) 16.0.1, which is now gitlab 16.9.2 combined).

I just (mostly) finished my work #2917 so I'll work on it - or should I submit a draft pull request to have stable discussion?

th-2021 commented 7 months ago

I'm following the branch on your site. That's ok for me. A draft PR might attract addional testers.I have another issue: my gitlab instance runs at a relative path and KAS doesn't support this (at least not in the UI). So I cannot register the agent. Any idea how I can register the agent from rails console?Am 24.03.2024 13:26 schrieb Kazunori Kimura @.***>: @th-2021 Thank you for trying my patch. I rebased all the working branches on hand and it may cause problems (I did a build with gitlab 16.0.1 combined against gitlab-agent (KAS) 16.0.1, which is now gitlab 16.9.2 combined). I just (mostly) finished my work #2917 so I'll work on it - or should I submit a draft pull request to have stable discussion?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

th-2021 commented 1 month ago

Could you register an agent with gitlab under relative url? The popup window has imho a wrong link for "this repository" (relative part is missing). Is there a workaround?

kkimurak commented 1 month ago

I'm also running with relative url and have not been able to register an agent yet. I'm busy with my business task, but I think I'll have time next month..