Skip to content

Commit

Permalink
Merge pull request #58 from sparkfabrik/kas_enable
Browse files Browse the repository at this point in the history
refs platform/2422: Add custom hostname for gitlab kas
  • Loading branch information
paolomainardi authored Sep 6, 2023
2 parents eca96c3 + 6d877ea commit dfd750e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ Then perform the following commands on the root folder:
| gitlab\_incoming\_mail\_k8s\_secret | Kubernetes secret name for storing Incoming Mail account password | `string` | `"gitlab-incomingmail-secret"` | no |
| gitlab\_install\_grafana | Choose whether to install a Grafana instance using the Gitlab chart. Default to false. | `bool` | `false` | no |
| gitlab\_install\_ingress\_nginx | Choose whether to install the ingress nginx controller in the cluster. Default to true. | `bool` | `true` | no |
| gitlab\_install\_kas | Choose whether to install the Gitlab agent server in the cluster. Default to false. | `bool` | `false` | no |
| gitlab\_install\_kas | Choose whether to install the Gitlab agent server in the cluster. Default to false. If enabled with gitlab\_kas\_hostname variable empty, kas address will be defaulted to kas.<domain\_variable\_value> (i.e. for domain set to example.com, kas will be enabled to kas.example.com) | `bool` | `false` | no |
| gitlab\_install\_prometheus | Choose whether to install a Prometheus instance using the Gitlab chart. Default to false. | `bool` | `false` | no |
| gitlab\_install\_runner | Choose whether to install the gitlab runner in the cluster | `string` | `true` | no |
| gitlab\_kas\_hostname | Gitlab custom hostname KAS. If set, this hostname is used with domain set in domain variable (i.e. my\_kas\_hostname.example.com) | `string` | `""` | no |
| gitlab\_monitoring\_allowed\_cidrs | Set the list of the allowed CIDRs for the Gitlab monitoring paths (readiness, liveness and metrics). | `list(string)` | `[]` | no |
| gitlab\_monitoring\_restrict\_to\_pod\_subnet | Restricrt access to the Gitlab monitoring paths (readiness, liveness and metrics) to the pod cidr. If you specify the 'gitlab\_monitoring\_allowed\_cidrs' list, the pod subnet will be automatically added to the list to grant access to the probes. | `bool` | `true` | no |
| gitlab\_namespace | Setup the Kubernetes Namespace where to install gitlab | `string` | `"gitlab"` | no |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ data "google_compute_address" "gitlab" {
locals {
gitlab_address = var.gitlab_address_name == "" ? google_compute_address.gitlab[0].address : data.google_compute_address.gitlab[0].address
domain = var.domain != "" ? var.domain : "${local.gitlab_address}.xip.io"
kas_domain = var.gitlab_kas_hostname != "" ? "${var.gitlab_kas_hostname}.${local.domain}" : ""
gitlab_smtp_user = var.gitlab_enable_smtp ? var.gitlab_smtp_user : ""
gitlab_incomingmail_k8ssecret = var.gitlab_enable_incoming_mail ? var.gitlab_incoming_mail_k8s_secret : ""
gitlab_servicedesk_k8ssecret = var.gitlab_enable_service_desk ? var.gitlab_service_desk_k8s_secret : ""
Expand Down Expand Up @@ -653,6 +654,7 @@ locals {
SERVICE_DESK_IMAP_PORT = var.gitlab_service_desk_imap_port
SERVICE_DESK_MAIL_USER = var.gitlab_service_desk_imap_user
SERVICE_DESK_K8S_SECRET = local.gitlab_servicedesk_k8ssecret
KAS_DOMAIN = local.kas_domain

#Bucket Names
ARTIFACTS_BCKT = google_storage_bucket.gitlab_bucket["artifacts"].name
Expand Down
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ global:
gitlab: {}
externalIP: ${INGRESS_IP}
ssh: ~
kas:
name: ${KAS_DOMAIN}

## doc/charts/globals.md#configure-ingress-settings
ingress:
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,16 @@ variable "gitlab_install_ingress_nginx" {

variable "gitlab_install_kas" {
type = bool
description = "Choose whether to install the Gitlab agent server in the cluster. Default to false."
description = "Choose whether to install the Gitlab agent server in the cluster. Default to false. If enabled with gitlab_kas_hostname variable empty, kas address will be defaulted to kas.<domain_variable_value> (i.e. for domain set to example.com, kas will be enabled to kas.example.com)"
default = false
}

variable "gitlab_kas_hostname" {
type = string
description = "Gitlab custom hostname KAS. If set, this hostname is used with domain set in domain variable (i.e. my_kas_hostname.example.com)"
default = ""
}

variable "gitlab_enable_certmanager" {
type = bool
description = "Choose whether to Install certmanager through Gitlab Helm Chart. Default to true."
Expand Down

0 comments on commit dfd750e

Please sign in to comment.