sameersbn / docker-gitlab

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

Cannot enable HTTPS #2381

Open sheshasb opened 3 years ago

sheshasb commented 3 years ago

Hi, I am using kubernetes version present in master/kubernetes/{deploy.sh}. Default HTTP works fine. However, when I enable HTTPS, the pod keeps restarting. Any help is highly appreciated. Here are my changes -

--- a/kubernetes/gitlab-rc.yml                                        
+++ b/kubernetes/gitlab-rc.yml                                        
@@ -17,9 +17,9 @@ spec:                                               
         image: sameersbn/gitlab:13.12.3                              
         env:                                                         
         - name: TZ                                                   
-          value: Asia/Kolkata                                        
+          value: America/Chicago                                     
         - name: GITLAB_TIMEZONE                                      
-          value: Kolkata                                             
+          value: Central Time (US & Canada)                          

         - name: GITLAB_SECRETS_DB_KEY_BASE                           
           value: long-and-random-alpha-numeric-string                
@@ -29,16 +29,20 @@ spec:                                             
           value: long-and-random-alpha-numeric-string                

         - name: GITLAB_ROOT_PASSWORD                                 
-          value:                                                     
+          value: rootpassword                                        
         - name: GITLAB_ROOT_EMAIL                                    
-          value:                                                     
+          value: root@mycompany.com                                  

         - name: GITLAB_HOST                                          
-          value: git.default.cluster.local                           
+          value: localhost:10443                                     
         - name: GITLAB_PORT                                          
-          value: "80"                                                
+          value: "10443"                                             
         - name: GITLAB_SSH_PORT                                      
           value: "22"                                                
+        - name: GITLAB_HTTPS                                         
+          value: "true"                                              
+        - name: SSL_SELF_SIGNED                                      
+          value: "true"                                              

--- a/kubernetes/gitlab-svc.yml
+++ b/kubernetes/gitlab-svc.yml
@@ -8,10 +8,10 @@ spec:
   type: LoadBalancer
   ports:
     - name: http
-      port: 80
+      port: 10443
       targetPort: http
     - name: ssh
-      port: 22
+      port: 10022
       targetPort: ssh
   selector:
     name: gitlab
kkimurak commented 3 years ago

In a quick check, you should not to contain port number in GITLAB_HOST.

sheshasb commented 3 years ago

Unfortunately, removing port did not improve the situation.

kkimurak commented 3 years ago

hmm.. Sorry for not helpful. Then, could you try setting DEBUG=true to env as described in README.md and provide a log ?
I'm not sure if I could help you more because I'm not using k8s, but it make easier to get advise from someone who running similar structure.

sheshasb commented 3 years ago

Here is kubectl logs of the gitlab pod. I could not find any useful information to identify the issue.

2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/gitaly.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/gitlab-workhorse.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/groups.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/mail_room.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/nginx.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/puma.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/sidekiq.conf" during parsing 2021-07-08 11:53:25,343 INFO Included extra file "/etc/supervisor/conf.d/sshd.conf" during parsing 2021-07-08 11:53:25,347 INFO RPC interface 'supervisor' initialized 2021-07-08 11:53:25,347 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2021-07-08 11:53:25,347 INFO supervisord started with pid 1 2021-07-08 11:53:26,349 INFO spawned: 'gitaly' with pid 648 2021-07-08 11:53:26,352 INFO spawned: 'puma' with pid 649 2021-07-08 11:53:26,355 INFO spawned: 'gitlab-workhorse' with pid 650 2021-07-08 11:53:26,357 INFO spawned: 'sidekiq' with pid 652 2021-07-08 11:53:26,359 INFO spawned: 'sshd' with pid 656 2021-07-08 11:53:26,361 INFO spawned: 'nginx' with pid 657 2021-07-08 11:53:26,363 INFO spawned: 'cron' with pid 658 2021-07-08 11:53:27,455 INFO success: gitaly entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,455 INFO success: puma entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,455 INFO success: gitlab-workhorse entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,455 INFO success: sidekiq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,456 INFO success: sshd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,456 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2021-07-08 11:53:27,456 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

2021-07-08 11:56:49,045 WARN received SIGTERM indicating exit request 2021-07-08 11:56:49,047 INFO waiting for gitaly, puma, gitlab-workhorse, sidekiq, sshd, nginx, cron to die 2021-07-08 11:56:49,048 INFO stopped: cron (terminated by SIGTERM) 2021-07-08 11:56:49,050 INFO stopped: sshd (exit status 0) 2021-07-08 11:56:49,054 INFO stopped: nginx (exit status 0) 2021-07-08 11:56:51,755 INFO stopped: sidekiq (exit status 0) 2021-07-08 11:56:51,759 INFO stopped: gitlab-workhorse (terminated by SIGTERM) 2021-07-08 11:56:52,760 INFO stopped: puma (terminated by SIGQUIT) 2021-07-08 11:56:52,761 INFO reaped unknown pid 830 2021-07-08 11:56:52,761 INFO reaped unknown pid 832 2021-07-08 11:56:52,761 INFO reaped unknown pid 834 2021-07-08 11:56:52,761 INFO waiting for gitaly to die 2021-07-08 11:56:52,781 INFO stopped: gitaly (exit status 0)