From d02ff7311688bc93a8f78d452cef8b8126e9c165 Mon Sep 17 00:00:00 2001 From: Nailia Iskhakova Date: Mon, 9 Aug 2021 19:25:52 +0300 Subject: [PATCH 1/2] Add initial 2k hybrid chart Signed-off-by: Nailia Iskhakova --- examples/ref/2k.yaml | 180 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 examples/ref/2k.yaml diff --git a/examples/ref/2k.yaml b/examples/ref/2k.yaml new file mode 100644 index 0000000000..7e9c1dd087 --- /dev/null +++ b/examples/ref/2k.yaml @@ -0,0 +1,180 @@ +gitlab: + # n1-highcpu-8 in GKE is + # - cpu: 7950m + # - memory: 5507813Ki + webservice: + # Min pods recommended to be set to 75% of max to start + maxReplicas: 6 + maxUnavailable: 3 + minReplicas: 4 + hpa: + targetAverageValue: 1600m + ingress: + proxyBodySize: 0 # To allow large file uploads like imports + nodeSelector: + workload: webservice + resources: + limits: + memory: 2.6G # roughly, 1.3GB/worker + requests: + cpu: 2 # requests.cpu <= workerProcesses + memory: 2.5G # roughly, 1.25GB/worker + workerProcesses: 2 + sidekiq: + maxReplicas: 2 + minReplicas: 1 + hpa: + targetAverageValue: 700m + nodeSelector: + workload: sidekiq + resources: + # Running up to 2 pods with a ratio of roughly 1 vCPU to 2 GB RAM as a starting point for requests. + # Per the 2k reference architecture (https://docs.gitlab.com/ee/administration/reference_architectures/2k_users.html), + # consider the resource limitations in play: + # For an n1-standard-2 node in GKE: 2 vCPU, 7.5 GB memory + # - 2 nodes x 2 vCPU = 4 cores in total + # - 2 nodes x 7.5 GB = 15Gb of memory in total + # - 15GB memory / 4 cores = ~3.75 GB memory / core, excluding overhead + # Each Sidekiq node has the following resources allocatable (roughly): + # - cpu: 1930m + # - memory: 5761719Ki + # Notice that there is actually only <2 vCPU and <6GB memory allocatable. + limits: + memory: 4G + requests: + cpu: 900m # Assume single-process, 1 CPU + memory: 2G + task-runner: + backups: + # Below, GCS is used an example for the ObjectStorage section. + # All ObjectStorage options are documented here: + # https://docs.gitlab.com/ee/administration/reference_architectures/3k_users.html#configure-the-object-storage + objectStorage: + backend: gcs + config: + gcpProject: example-gcp-projectname + key: gcs.json + secret: example-connection-secret + migrations: + # Migrations pod must point directly to PostgreSQL primary + psql: + host: example-postgresql-primary-ip + password: + secret: example-postgresql-secret + key: password + port: example-postgresql-primary-port + +global: + appConfig: + # For context on the ObjectStorage configuration below, see: + # https://docs.gitlab.com/ee/administration/reference_architectures/3k_users.html#configure-the-object-storage + object_store: + enabled: true + connection: + secret: example-storage-secret + key: password + artifacts: + bucket: example-artifacts-bucket-name + backups: + bucket: example-backups-bucket-name + dependencyProxy: + bucket: example-dependency-proxy-bucket-name + externalDiffs: + bucket: example-external-diffs-bucket-name + # Recommend to only store older External Diffs in Object Storage for performance reasons + when: outdated + lfs: + bucket: example-lfs-bucket-name + packages: + bucket: example-packages-bucket-name + terraformState: + bucket: example-terraform-state-bucket-name + uploads: + bucket: example-uploads-bucket-name + shell: + authToken: + secret: example-shell-secret + key: password + gitaly: + authToken: + secret: example-gitaly-external-token + key: password + enabled: false # Run Gitaly outside of cluster + external: + - name: default + hostname: default.gitaly.com + port: example-gitaly-port + gitlab: + license: + secret: example-gitlab-license + grafana: + enabled: true + hosts: + domain: example.com + minio: + enabled: false + psql: + host: db.example.com + password: + secret: example-postgresql-secret + key: password + port: example-postgresql-port + redis: + host: example-redis + password: + key: password + secret: example-redis-secret + registry: + bucket: example-registry-storage + +# https://docs.gitlab.com/ee/ci/runners/#configuring-runners-in-gitlab +gitlab-runner: + install: false + +# Below, we use nodeSelectors to send certain +# workloads to a node separate from the nodes +# used for the Webservice and Sidekiq workloads. +# This helps to ensure Webservice and Sidekiq have +# sufficient resources to schedule enough pods to +# meet the 3k reference architecture specifications. +grafana: + nodeSelector: + workload: "" +nginx-ingress: + controller: + nodeSelector: + workload: "" + defaultBackend: + nodeSelector: + workload: "" +prometheus: + alertmanager: + nodeSelector: + workload: "" + install: true + kubeStateMetrics: + nodeSelector: + workload: "" + nodeExporter: + nodeSelector: + workload: "" + pushgateway: + nodeSelector: + workload: "" + server: + nodeSelector: + workload: "" + +# Run Redis outside of cluster +redis: + install: false + +registry: + storage: + extraKey: gcs.json + key: registry-config + secret: gcs-secret-example + +# Database run outside of cluster +postgresql: + install: false -- GitLab From 31821dadcada2a4436c7e6ecbd52f81bde40cdde Mon Sep 17 00:00:00 2001 From: Nailia Iskhakova Date: Mon, 9 Aug 2021 20:42:30 +0300 Subject: [PATCH 2/2] Update links to 2k docs Signed-off-by: Nailia Iskhakova --- examples/ref/2k.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ref/2k.yaml b/examples/ref/2k.yaml index 7e9c1dd087..1b97575642 100644 --- a/examples/ref/2k.yaml +++ b/examples/ref/2k.yaml @@ -48,7 +48,7 @@ gitlab: backups: # Below, GCS is used an example for the ObjectStorage section. # All ObjectStorage options are documented here: - # https://docs.gitlab.com/ee/administration/reference_architectures/3k_users.html#configure-the-object-storage + # https://docs.gitlab.com/ee/administration/reference_architectures/2k_users.html#configure-the-object-storage objectStorage: backend: gcs config: @@ -67,7 +67,7 @@ gitlab: global: appConfig: # For context on the ObjectStorage configuration below, see: - # https://docs.gitlab.com/ee/administration/reference_architectures/3k_users.html#configure-the-object-storage + # https://docs.gitlab.com/ee/administration/reference_architectures/2k_users.html#configure-the-object-storage object_store: enabled: true connection: @@ -136,7 +136,7 @@ gitlab-runner: # used for the Webservice and Sidekiq workloads. # This helps to ensure Webservice and Sidekiq have # sufficient resources to schedule enough pods to -# meet the 3k reference architecture specifications. +# meet the 2k reference architecture specifications. grafana: nodeSelector: workload: "" -- GitLab