Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions helm/cluster-issuer/chart/templates/_helpers.tpl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: wildcard-certificate
description: Wildcard Certificate
name: dns01-certificate
description: DNS01 Certificate

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ spec:
kind: ClusterIssuer
commonName: {{ .Values.domain }}
dnsNames:
- {{ .Values.domain }}
- "*.{{ .Values.domain }}"
{{- range .Values.dnsNameTemplates }}
- {{ tpl . $ | quote }}
{{- end }}
secretTemplate:
annotations:
{{- if .Values.reflectNamespaces }}
Expand Down
23 changes: 23 additions & 0 deletions helm/gateway-config/chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions helm/gateway-config/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: gateway-config
description: Gateway Configuration

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
6 changes: 6 additions & 0 deletions helm/gateway-config/chart/templates/gateway-class.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: envoy
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
Comment on lines +1 to +6
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

GatewayClass is cluster-scoped — beware of multi-release / uninstall coupling.

Packaging a cluster-scoped GatewayClass named envoy inside this chart means a helm uninstall (or a parallel install in another namespace) will delete/conflict on a cluster-global resource that may be in use by Gateways from other releases. Consider either:

  • moving the GatewayClass to a separate, single-instance chart (or directly into Terraform), or
  • gating it behind a value (e.g., {{- if .Values.createGatewayClass }}) so only one release owns it.

27 changes: 27 additions & 0 deletions helm/gateway-config/chart/templates/gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: {{ .Values.name }}
namespace: {{ .Release.Namespace }}
spec:
gatewayClassName: envoy
listeners:
- name: http
protocol: HTTP
port: 80
allowedRoutes:
namespaces:
from: All

- name: https
protocol: HTTPS
port: 443
tls:
mode: Terminate
certificateRefs:
- kind: Secret
group: ""
name: {{ .Values.certificateName }}
allowedRoutes:
namespaces:
from: All
15 changes: 15 additions & 0 deletions helm/gateway-config/chart/templates/http-to-https.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: http-to-https
namespace: {{ .Release.Namespace }}
spec:
parentRefs:
- name: {{ .Values.name }}
sectionName: http
rules:
- filters:
- type: RequestRedirect
requestRedirect:
scheme: https
statusCode: 308
2 changes: 2 additions & 0 deletions helm/gateway-config/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: gateway
certificateName: wildcard-certificate
16 changes: 10 additions & 6 deletions helm/gitlab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ global:
name: ${registry_host}.${domain}
pages:
name: ${pages_host}.${domain}
https: false

ingress:
gatewayApi:
enabled: true
installEnvoy: false
configureCertmanager: false
class: nginx
tls:
enabled: true
secretName: "wildcard-certificate"
gatewayClass: envoy
gateway:
name: gateway
namespace: envoy-gateway-system

ingress:
enabled: false
Comment on lines +18 to +28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

GitLab Helm chart 9.10.3 Gateway API support for Pages HTTPRoute and TLS

💡 Result:

Yes, the GitLab Helm chart version 9.10.3 supports Gateway API for GitLab Pages using HTTPRoute with TLS termination. Gateway API support was introduced starting from chart version 9.7 (corresponding to GitLab 18.7). In 9.10.3, enable it by setting global.gatewayApi.enabled=true in your values.yaml. The chart creates HTTPRoutes for services including Pages, referencing a pages-web listener in the Gateway with TLS mode: Terminate and certificateRefs to a pages-tls secret (wildcard certificate required for Pages domains *.pages.example.com). An optional HTTPRoute redirects HTTP to HTTPS. The chart can bundle Envoy Gateway (global.gatewayApi.installEnvoy=true) or reference an external Gateway API implementation like Envoy Gateway. GitLab Pages requires a user-provided wildcard TLS secret named <release>-pages-tls or customized via gitlab.gitlab-pages.ingress.tls.secretName. Providers must support HTTPRoutes, TCPRoutes (for SSH), RegularExpression matches, and ideally GRPCRoutes.

Citations:


🏁 Script executed:

#!/bin/bash
# Look for any Pages-specific Gateway/HTTPRoute templates produced by the gitlab chart locally
# and any pages-related routing configured in this repo.
rg -nP --hidden -C2 'pages|HTTPRoute|gatewayApi' helm/ terraform/ 2>/dev/null | head -200

Repository: clofour/gitlab-kubernetes

Length of output: 2896


🏁 Script executed:

#!/bin/bash
# Check pages configuration in values.yaml, especially TLS secret settings
rg -A 20 'pages:' helm/gitlab/values.yaml | head -100

Repository: clofour/gitlab-kubernetes

Length of output: 1281


🏁 Script executed:

#!/bin/bash
# Search for pages.ingress or pages TLS configuration more comprehensively
rg -n 'pages.*tls|gitlab-pages|pages.*ingress' helm/gitlab/values.yaml -i

Repository: clofour/gitlab-kubernetes

Length of output: 51


🏁 Script executed:

#!/bin/bash
# Search for pages-tls or pages certificate secret creation anywhere
rg -r 'pages-tls|pages.*certificate|pages.*secret' --iglob '*.yaml' --iglob '*.tf' --iglob '*.md' helm/ terraform/

Repository: clofour/gitlab-kubernetes

Length of output: 1047


🏁 Script executed:

#!/bin/bash
# Look for pages-tls in all files
rg 'pages-tls' helm/ terraform/ --type yaml --type tf

Repository: clofour/gitlab-kubernetes

Length of output: 51


🏁 Script executed:

#!/bin/bash
# Get the entire gitlab section to see gitlab-pages configuration
sed -n '/^gitlab:/,/^[a-z]/p' helm/gitlab/values.yaml | head -150

Repository: clofour/gitlab-kubernetes

Length of output: 583


Provide wildcard TLS secret for GitLab Pages.

The GitLab Helm chart 9.10.3 does support Gateway API for Pages with HTTPRoute and TLS termination. However, the configuration is missing the required wildcard TLS certificate secret. The chart expects either a secret named <release>-pages-tls or explicit configuration via gitlab.gitlab-pages.ingress.tls.secretName, but neither is present in this values.yaml. The Terraform setup includes the wildcard domain *.pages.${domain} in the dns01 certificate, which is correct, but the secret must be created and referenced in the Helm values. Without it, Pages HTTPS will fail. Add the secret or configure gitlab.gitlab-pages.ingress.tls.secretName pointing to the certificate secret.


psql:
host: ${postgres_host}
Expand Down
16 changes: 9 additions & 7 deletions helm/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
grafana:
ingress:
enabled: true
hosts:
- ${grafana_host}.${domain}
tls:
- secretName: wildcard-certificate
hosts:
- ${grafana_host}.${domain}
enabled: false
route:
main:
enabled: true
hostnames:
- ${grafana_host}.${domain}
parentRefs:
- name: gateway
namespace: envoy-gateway-system
Comment thread
clofour marked this conversation as resolved.

prometheus:
prometheusSpec:
Expand Down
62 changes: 0 additions & 62 deletions helm/wildcard-certificate/chart/templates/_helpers.tpl

This file was deleted.

2 changes: 0 additions & 2 deletions helm/wildcard-certificate/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion terraform/dns.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
lb_ip = try(data.kubernetes_service_v1.ingress_nginx.status[0].load_balancer[0].ingress[0].ip, null)
lb_ip = try(data.kubernetes_service_v1.envoy_gateway.status[0].load_balancer[0].ingress[0].ip, null)
records = toset([
var.gitlab_host, var.registry_host, "*.${var.pages_host}", var.grafana_host
])
Expand Down
40 changes: 33 additions & 7 deletions terraform/helm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,44 @@ resource "helm_release" "cluster_issuer" {
depends_on = [helm_release.cert_manager]
}

resource "helm_release" "wildcard_certificate" {
name = "wildcard-certificate"
namespace = kubernetes_namespace_v1.cert_manager.metadata[0].name
chart = "${path.module}/../helm/wildcard-certificate/chart"
resource "helm_release" "dns01_certificate" {
name = "dns01-certificate"
namespace = kubernetes_namespace_v1.envoy_gateway_system.metadata[0].name
chart = "${path.module}/../helm/dns01-certificate/chart"

values = [
templatefile("${path.module}/../helm/wildcard-certificate/values.yaml",
{
yamlencode({
domain = var.domain_name
dnsNameTemplates = [
"{{ .Values.domain }}",
"*.{{ .Values.domain }}",
"*.pages.{{ .Values.domain }}"
]
reflectNamespaces = "${kubernetes_namespace_v1.gitlab.metadata[0].name},${kubernetes_namespace_v1.monitoring.metadata[0].name}"
})
]

depends_on = [helm_release.cert_manager, helm_release.cluster_issuer, helm_release.reflector]
}

resource "helm_release" "envoy_gateway" {
name = "eg"
namespace = kubernetes_namespace_v1.envoy_gateway_system.metadata[0].name
chart = "${path.module}/../helm/gateway-config/chart"

wait = true

depends_on = [ helm_release.cert_manager, helm_release.dns01_certificate ]
}

resource "helm_release" "gateway_config" {
name = "gateway-config"
namespace = kubernetes_namespace_v1.envoy_gateway_system.metadata[0].name
repository = "oci://docker.io/envoyproxy/gateway-helm"
chart = "gateway-helm"
version = "1.7.2"
}
Comment thread
clofour marked this conversation as resolved.
Comment thread
clofour marked this conversation as resolved.

resource "helm_release" "ingress_nginx" {
name = "ingress-nginx"
namespace = kubernetes_namespace_v1.ingress_nginx.metadata[0].name
Expand Down Expand Up @@ -113,10 +135,12 @@ resource "helm_release" "gitlab" {
digitalocean_database_connection_pool.main,
digitalocean_database_cluster.valkey,
helm_release.cert_manager,
helm_release.wildcard_certificate,
helm_release.dns01_certificate,
helm_release.reflector,
helm_release.cluster_issuer,
helm_release.ingress_nginx,
helm_release.envoy_gateway,
helm_release.gateway_config,
digitalocean_record.main,
kubernetes_secret_v1.gitlab_initial_root_password,
kubernetes_secret_v1.gitlab_postgres,
Expand All @@ -140,4 +164,6 @@ resource "helm_release" "kube_prometheus_stack" {
domain = var.domain_name
})
]

depends_on = [ helm_release.envoy_gateway ]
}
Loading