Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add netpol to allow gitaly to perform repository mirroring actions #226

Merged
merged 4 commits into from
Nov 1, 2024
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
11 changes: 11 additions & 0 deletions charts/config/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,17 @@ spec:
{{- end }}
description: "Gitlab Pages Storage"

# Gitaly
{{ if .Values.mirroring.enabled }}
- direction: Egress
selector:
app: gitaly
remoteGenerated: Anywhere
ports:
{{- .Values.mirroring.ports | toYaml | nindent 10 }}
description: Gitaly repository mirroring
{{- end }}

# Custom rules for unanticipated scenarios
{{- range .Values.custom }}
- direction: {{ .direction }}
Expand Down
11 changes: 11 additions & 0 deletions charts/config/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ runner:
app: gitlab-runner
namespace: gitlab-runner
sandboxNamespace: gitlab-runner-sandbox

# Gitaly is responsible for mirroring actions, and there are 4 valid protocols with the following ports
# ssh: 22
# http: 80
# https: 443
# git: 9418
mirroring:
enabled: false
ports:
corang marked this conversation as resolved.
Show resolved Hide resolved
- 443

# custom:
# # Notice no `remoteGenerated` field here on custom internal rule
# - direction: Ingress
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Network policies are controlled via the `uds-gitlab-config` chart in accordance
- `storage`: sets network policies for accessing object storage from all GitLab services (`registry`, `pages`, `webservice`, `toolbox`, `sidekiq`)
- `redis`: sets network policies for accessing a Redis-compatible server from all GitLab services (`webservice`, `toolbox`, `sidekiq`, `migrations`, `gitlab-exporter`)
- `postgres`: sets network policies for accessing a Postgres database from all GitLab services (`webservice`, `toolbox`, `sidekiq`, `migrations`, `gitlab-exporter`)
- `mirroring`: sets network policies that allow the gitlab repository mirroring feature to work. It defaults to only `https` (443) but can be set to allow the other protocols gitlab supports via the `ports` key.
- `custom`: sets custom network policies for the GitLab namespace - this allows for custom integrations with other services (i.e. Jira)

> [!NOTE]
Expand Down
Loading