diff --git a/changelogs/unreleased/249-workhorseconfig.yml b/changelogs/unreleased/249-workhorseconfig.yml new file mode 100644 index 0000000000000000000000000000000000000000..cdb3f2df03fc9a27d0161287adc795261be90cbb --- /dev/null +++ b/changelogs/unreleased/249-workhorseconfig.yml @@ -0,0 +1,5 @@ +--- +title: Added configuration options for workhorse +merge_request: 261 +author: Corey O'Brien +type: added diff --git a/charts/gitlab/charts/unicorn/templates/deployment.yaml b/charts/gitlab/charts/unicorn/templates/deployment.yaml index eb06a22673d0ec6b2338d59ed8cb615c1674fa37..5e3c1218781733c22ccca67d1a3412d0dd3869f7 100644 --- a/charts/gitlab/charts/unicorn/templates/deployment.yaml +++ b/charts/gitlab/charts/unicorn/templates/deployment.yaml @@ -59,12 +59,86 @@ spec: mountPath: '/etc/gitlab' readOnly: true containers: - - name: {{ .Chart.Name }} + - name: unicorn image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - /bin/bash + - -ec + - > + /home/git/gitlab/bin/bundle exec unicorn + -E production + -c /home/git/gitlab/config/unicorn.rb + /home/git/gitlab/config.ru + & exec tail -f /var/log/gitlab/* ports: - containerPort: {{ .Values.service.internalPort }} name: unicorn + env: + - name: GITALY_FEATURE_DEFAULT_ON + value: "1" + - name: CONFIG_TEMPLATE_DIRECTORY + value: '/var/opt/gitlab/templates' + - name: CONFIG_DIRECTORY + value: '/var/opt/gitlab/config/gitlab/' +{{- if .Values.metrics.enabled }} + - name: prometheus_multiproc_dir + value: /metrics +{{- end }} + volumeMounts: +{{- if .Values.metrics.enabled }} + - name: unicorn-metrics + mountPath: '/metrics' +{{- end }} + - name: unicorn-config + mountPath: '/var/opt/gitlab/templates' + - name: unicorn-secrets + mountPath: '/etc/gitlab' + readOnly: true + - name: unicorn-secrets + mountPath: /home/git/gitlab/config/secrets.yml + subPath: rails-secrets/secrets.yml + - name: unicorn-config + mountPath: '/home/git/gitlab/config/initializers/smtp_settings.rb' + subPath: smtp_settings.rb + - name: uploads + mountPath: /home/git/gitlab/public/uploads/tmp + - name: lfs-objects + mountPath: /home/git/gitlab/shared/lfs-objects/tmp + - name: artifacts + mountPath: /home/git/gitlab/shared/artifacts/tmp + livenessProbe: + exec: + command: + - /bin/bash + - -ec + - printf "GET / HTTP/1.1\n\n" > /dev/tcp/127.0.0.1/8080 + initialDelaySeconds: 20 + timeoutSeconds: 30 + periodSeconds: 60 + # readinessProbe: + # httpGet: + # path: / + # port: {{ .Values.service.internalPort }} + resources: +{{ toYaml .Values.resources | indent 12 }} + - name: workhorse + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + args: + - gitlab-workhorse + - -listenAddr + - 0.0.0.0:8181 + - -documentRoot + - /home/git/gitlab/public + - -secretPath + - /home/git/gitlab/.gitlab_workhorse_secret + - -config + - /var/opt/gitlab/config/gitlab/workhorse-config.toml +{{- if .Values.workhorse.extraArgs }} +{{ toYaml .Values.workhorse.extraArgs | indent 12 }} +{{- end }} + ports: - containerPort: {{ .Values.service.workhorseInternalPort }} name: workhorse env: @@ -98,10 +172,18 @@ spec: - name: unicorn-config mountPath: '/home/git/gitlab/config/initializers/smtp_settings.rb' subPath: smtp_settings.rb + - name: uploads + mountPath: /home/git/gitlab/public/uploads/tmp + - name: lfs-objects + mountPath: /home/git/gitlab/shared/lfs-objects/tmp + - name: artifacts + mountPath: /home/git/gitlab/shared/artifacts/tmp livenessProbe: exec: command: - - /scripts/healthcheck + - /bin/bash + - -ec + - printf "GET / HTTP/1.1\n\n" > /dev/tcp/127.0.0.1/8181 initialDelaySeconds: 20 timeoutSeconds: 30 periodSeconds: 60 @@ -110,7 +192,7 @@ spec: # path: / # port: {{ .Values.service.internalPort }} resources: -{{ toYaml .Values.resources | indent 12 }} +{{ toYaml .Values.workhorse.resources | indent 12 }} volumes: {{- if .Values.metrics.enabled }} - name: unicorn-metrics @@ -184,6 +266,12 @@ spec: - name: unicorn-secrets emptyDir: medium: "Memory" + - name: uploads + emptyDir: {} + - name: lfs-objects + emptyDir: {} + - name: artifacts + emptyDir: {} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 8 }} diff --git a/charts/gitlab/charts/unicorn/values.yaml b/charts/gitlab/charts/unicorn/values.yaml index 55d0bfcb3e15008bdb23123d04424884f2837dc0..8e4d6bf2dd9aae50cbca9c4b311709ca61cf347d 100644 --- a/charts/gitlab/charts/unicorn/values.yaml +++ b/charts/gitlab/charts/unicorn/values.yaml @@ -32,6 +32,14 @@ workerProcesses: 2 workerTimeout: 60 workhorse: sentryDSN: "" + extraArgs: [] + resources: + # limits: + # cpu: 1 + # memory: 2G + requests: + cpu: 50m + memory: 200Mi omniauth: providers: [] # - name: google_oauth2 diff --git a/doc/installation/command-line-options.md b/doc/installation/command-line-options.md index 15368dc559a8e6b243cb033373743641cbb962de..8eb3eb785a62307d1399bdb593a52e2b524a26ca 100644 --- a/doc/installation/command-line-options.md +++ b/doc/installation/command-line-options.md @@ -250,8 +250,11 @@ Tables below contain all the possible charts configurations that can be supplied | gitlab.unicorn.registry.certificate.secret | Registry certificate | gitlab-registry | | gitlab.unicorn.registry.certificate.key | Registry certificate key | registry-auth.key | | gitlab.unicorn.resources.requests.cpu | Unicorn minimum cpu | 200m | -| gitlab.unicorn.resources.requests.memory | Unicorn minimum memory | 1.4G | +| gitlab.unicorn.resources.requests.memory | Unicorn minimum memory | 2G | | gitlab.unicorn.workhorse.sentryDSN | DSN for Sentry instance for error reporting | "" | +| gitlab.unicorn.workhorse.extraArgs | Additional options for workhorse | "" | +| gitlab.unicorn.workhorse.resources.requests.cpu | Workhorse minimum cpu | 50m | +| gitlab.unicorn.workhorse.resources.requests.memory | Workhorse minimum memory | 200Mi | | gitlab.migrations.image.repository | Migrations image repository | registry.gitlab.com/gitlab-org/build/cng/gitlab-rails-ee | | gitlab.migrations.image.tag | Migrations image tag | latest | | gitlab.migrations.image.pullPolicy | Migrations pull policy | Always |