Advertisement
AtomicOs

gitlab.rb

Jun 24th, 2021
2,723
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Avoid running unnecessary services on the Sidekiq server
  2. gitaly['enable'] = true
  3. postgresql['enable'] = true
  4. redis['enable'] = true
  5. puma['enable'] = false
  6. gitlab_workhorse['enable'] = false
  7. prometheus['enable'] = false
  8. alertmanager['enable'] = true
  9. grafana['enable'] = false
  10. gitlab_exporter['enable'] = false
  11. nginx['enable'] = true
  12.  
  13. # Redis
  14. ## Redis connection details
  15. ## First cluster that will host the cache
  16. gitlab_rails['redis_cache_instance'] = 'redis://:<REDIS_PRIMARY_PASSWORD_OF_FIRST_CLUSTER>@gitlab-redis-cache'
  17.  
  18. gitlab_rails['redis_cache_sentinels'] = [
  19.   {host: '10.6.0.71', port: 26379},
  20.   {host: '10.6.0.72', port: 26379},
  21.   {host: '10.6.0.73', port: 26379},
  22. ]
  23.  
  24. ## Second cluster that will host the queues, shared state, and actioncable
  25. gitlab_rails['redis_queues_instance'] = 'redis://:<REDIS_PRIMARY_PASSWORD_OF_SECOND_CLUSTER>@gitlab-redis-persistent'
  26. gitlab_rails['redis_shared_state_instance'] = 'redis://:<REDIS_PRIMARY_PASSWORD_OF_SECOND_CLUSTER>@gitlab-redis-persistent'
  27. gitlab_rails['redis_actioncable_instance'] = 'redis://:<REDIS_PRIMARY_PASSWORD_OF_SECOND_CLUSTER>@gitlab-redis-persistent'
  28.  
  29. gitlab_rails['redis_queues_sentinels'] = [
  30.   {host: '10.6.0.81', port: 26379},
  31.   {host: '10.6.0.82', port: 26379},
  32.   {host: '10.6.0.83', port: 26379},
  33. ]
  34. gitlab_rails['redis_shared_state_sentinels'] = [
  35.   {host: '10.6.0.81', port: 26379},
  36.   {host: '10.6.0.82', port: 26379},
  37.   {host: '10.6.0.83', port: 26379},
  38. ]
  39. gitlab_rails['redis_actioncable_sentinels'] = [
  40.   {host: '10.6.0.81', port: 26379},
  41.   {host: '10.6.0.82', port: 26379},
  42.   {host: '10.6.0.83', port: 26379},
  43. ]
  44.  
  45. # Gitaly
  46. # git_data_dirs get configured for the Praefect virtual storage
  47. # Address is Internal Load Balancer for Praefect
  48. # Token is praefect_external_token
  49. git_data_dirs({
  50.   "default" => {
  51.     "gitaly_address" => "tcp://10.6.0.40:2305", # internal load balancer IP
  52.     "gitaly_token" => '<praefect_external_token>'
  53.   }
  54. })
  55.  
  56. # PostgreSQL
  57. gitlab_rails['db_host'] = '10.6.0.20' # internal load balancer IP
  58. gitlab_rails['db_port'] = 6432
  59. gitlab_rails['db_password'] = '<postgresql_user_password>'
  60. gitlab_rails['db_adapter'] = 'postgresql'
  61. gitlab_rails['db_encoding'] = 'unicode'
  62. ## Prevent database migrations from running on upgrade automatically
  63. gitlab_rails['auto_migrate'] = false
  64.  
  65. # Sidekiq
  66. sidekiq['enable'] = true
  67. sidekiq['listen_address'] = "0.0.0.0"
  68.  
  69. ## Set number of Sidekiq queue processes to the same number as available CPUs
  70. sidekiq['queue_groups'] = ['*'] * 4
  71.  
  72. ## Set number of Sidekiq threads per queue process to the recommend number of 10
  73. sidekiq['max_concurrency'] = 10
  74.  
  75. # Monitoring
  76. consul['enable'] = true
  77. consul['monitoring_service_discovery'] =  true
  78.  
  79. consul['configuration'] = {
  80.    retry_join: %w(10.6.0.11 10.6.0.12 10.6.0.13)
  81. }
  82.  
  83. # Set the network addresses that the exporters will listen on
  84. node_exporter['listen_address'] = '127.0.0.1:9001'
  85.  
  86. ## Add the monitoring node's IP address to the monitoring whitelist
  87. gitlab_rails['monitoring_whitelist'] = ['10.6.0.151/32', '127.0.0.0/8']
  88.  
  89. # Object storage
  90. ## This is an example for configuring Object Storage on GCP
  91. ## Replace this config with your chosen Object Storage provider as desired
  92. gitlab_rails['object_store']['connection'] = {
  93.   'provider' => 'Google',
  94.   'google_project' => '<gcp-project-name>',
  95.   'google_json_key_location' => '<path-to-gcp-service-account-key>'
  96. }
  97. gitlab_rails['object_store']['objects']['artifacts']['bucket'] = "<gcp-artifacts-bucket-name>"
  98. gitlab_rails['object_store']['objects']['external_diffs']['bucket'] = "<gcp-external-diffs-bucket-name>"
  99. gitlab_rails['object_store']['objects']['lfs']['bucket'] = "<gcp-lfs-bucket-name>"
  100. gitlab_rails['object_store']['objects']['uploads']['bucket'] = "<gcp-uploads-bucket-name>"
  101. gitlab_rails['object_store']['objects']['packages']['bucket'] = "<gcp-packages-bucket-name>"
  102. gitlab_rails['object_store']['objects']['dependency_proxy']['bucket'] = "<gcp-dependency-proxy-bucket-name>"
  103. gitlab_rails['object_store']['objects']['terraform_state']['bucket'] = "<gcp-terraform-state-bucket-name>"
  104.  
  105. gitlab_rails['backup_upload_connection'] = {
  106.   'provider' => 'Google',
  107.   'google_project' => '<gcp-project-name>',
  108.   'google_json_key_location' => '<path-to-gcp-service-account-key>'
  109. }
  110. gitlab_rails['backup_upload_remote_directory'] = "<gcp-backups-state-bucket-name>"
  111.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement