UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 5a36f48a authored by Josh Wolf's avatar Josh Wolf
Browse files

feat: add gitlab as optional bigbang addon

parent 21c9a3ce
No related branches found
No related tags found
1 merge request!162Gitlab without custom values interface
Showing
with 373 additions and 27 deletions
......@@ -4,10 +4,48 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
---
## [Unreleased]
## [1.0.3]
* Added [Gitlab](https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab)
* Added ability to provide multiple registry credentials while maintaining current capabilities:
```
registryCredentials:
username: registry1user
password: somesecretpassword
```
or
```
registryCredentials:
- registry: registry1.dso.mil
username: registry1user
password: somesecretpassword
- registry: registry.dsop.io
username: registry1user
password: somesecretpassword
- registry: somewhere.else.io
username: someuser
password: someothersecret
```
will correctly create the ImagePullSecrets for all those registries
## [1.0.2]
### Changed
* Updated istio-controlplane to [1.7.3-bb.5](https://repo1.dso.mil/platform-one/big-bang/apps/core/istio-controlplane/-/tags/1.7.3-bb.5) to allow
for setting ingressgateway to use nodeports
## [1.0.1]
### Changed
* Updated Istio Control plane to support Node Ports for ingressGateway
* Update Istio Control plane to support SSO for Kiali and Jaeger
* Update Authservice to refact definitions of filter chains
* Updated documentation
---
......
......@@ -11,4 +11,4 @@ spec:
interval: 10m
url: https://repo1.dsop.io/platform-one/big-bang/umbrella.git
ref:
tag: 0.0.2
\ No newline at end of file
tag: 1.0.3
\ No newline at end of file
Thank you for supporting PlatformOne!
{{ if $.Values.addons.gitlab.enabled }}
Gitlab is enabled.
Please follow the Gitlab online documentation for proper configuration.
Here is an example of how to configure external perstistent storage for postgres DB and object storage.
addons:
gitlab:
enabled: true
values:
postgresql:
install: false
global:
minio:
enabled: false
psql:
host: postgres-postgresql-headless.postgres.svc.cluster.local
port: 5432
username: postgres
database: postgres
password:
secret: db-credentials
key: PGPASSWORD
registry:
bucket: gitlab-registry-storage
appConfig:
lfs:
bucket: gitlab-lfs
connection:
secret: gitlab-object-storage
key: rails
artifacts:
bucket: gitlab-artifacts
connection:
secret: gitlab-object-storage
key: rails
uploads:
bucket: gitlab-uploads
connection:
secret: gitlab-object-storage
key: rails
packages:
bucket: gitlab-packages
connection:
secret: gitlab-object-storage
key: rails
externalDiffs:
bucket: gitlab-mr-diffs
connection:
secret: gitlab-object-storage
key: rails
terraformState:
enabled: false
bucket: gitlab-terraform-state
connection:
secret: gitlab-object-storage
key: rails
backups:
bucket: gitlab-backup
tmpBucket: gitlab-backup-tmp
gitlab:
task-runner:
psql:
host: postgres-postgresql-headless.postgres.svc.cluster.local
port: 5432
username: postgres
database: postgres
password:
secret: db-credentials
key: PGPASSWORD
backups:
objectStorage:
config:
secret: gitlab-object-storage
key: backups
registry:
storage:
secret: gitlab-object-storage
key: registry
{{- if $.Values.addons.gitlab.values.postgresql.install }}
PLATFORM ONE GITLAB WARNING:
You have enabled an internal postgres database in the values configuration.
PlatformOne does not support this option for production deployments because your persistent data can be permanently lost.
This option should only be used for development or CI pipelines.
{{- end -}}
{{- if $.Values.addons.gitlab.values.global.minio.enabled }}
PLATFORM ONE GITLAB WARNING:
You have enabled a MinIO internal service in the values configuration.
PlatformOne does not support this option for production deployments because your persistent data can be permanently lost.
This option should only be used for development or CI pipelines.
{{- end }}
{{- end }}
{{- define "imagePullSecret" }}
{{- with .Values.registryCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- if .Values.registryCredentials -}}
{{- $credType := typeOf .Values.registryCredentials -}}
{{- /* If we have a list, embed that here directly. This allows for complex configuration from configmap, downward API, etc. */ -}}
{{- if eq $credType "[]interface {}" -}}
{{- include "multipleCreds" . | b64enc }}
{{- else if eq $credType "map[string]interface {}" }}
{{- /* If we have a map, treat those as key-value pairs. */ -}}
{{- with .Values.registryCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end -}}
{{- end }}
{{- end }}
{{- define "multipleCreds" -}}
{
"auths": {
{{- $length := len .Values.registryCredentials }}
{{- range $index, $entry := .Values.registryCredentials }}
"{{- $entry.registry }}": {
"username{{ $index }}":"{{- $entry.username }}",
"password":"{{- $entry.password }}",
"email":"{{- $entry.email }}",
"auth":"{{- (printf "%s:%s" $entry.username $entry.password | b64enc) }}"
}{{- if ne $length (add $index 1) }},{{- end }}
{{- end }}
}
}
{{- end }}
{{/*
......
......@@ -7,7 +7,7 @@ metadata:
name: argocd
---
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -7,7 +7,7 @@ metadata:
name: cluster-auditor
---
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -10,7 +10,7 @@ metadata:
name: gatekeeper-system
---
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
{{- if and (not .Values.offline) .Values.addons.gitlab.enabled }}
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: gitlab
namespace: {{ .Release.Namespace }}
spec:
interval: {{ .Values.flux.interval }}
url: {{ .Values.addons.gitlab.git.repo }}
ref:
{{- include "validRef" .Values.addons.gitlab.git | nindent 4 }}
{{- include "gitCreds" .Values.git | nindent 2 }}
{{- end }}
{{- if .Values.addons.gitlab.enabled }}
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: gitlab
namespace: {{ .Release.Namespace }}
spec:
releaseName: gitlab
targetNamespace: gitlab
chart:
spec:
chart: {{ .Values.addons.gitlab.git.path }}
interval: 5m
sourceRef:
kind: GitRepository
name: gitlab
namespace: {{ .Release.Namespace }}
{{- with .Values.flux }}
interval: {{ .interval }}
test:
enable: false
install:
remediation:
retries: {{ .install.retries }}
upgrade:
remediation:
retries: {{ .upgrade.retries }}
remediateLastFailure: true
cleanupOnFail: true
rollback:
timeout: {{ .rollback.timeout }}
cleanupOnFail: {{ .rollback.cleanupOnFail }}
{{- end }}
valuesFrom:
- name: values
kind: Secret
valuesKey: "gitlab.yaml"
values:
hostname: {{ .Values.hostname }}
istio:
enabled: {{ .Values.istio.enabled }}
monitoring:
enabled: {{ .Values.monitoring.enabled }}
{{- if ( include "imagePullSecret" . ) }}
## values for image pull secrets
redis:
metrics:
image:
pullSecrets:
- private-registry
image:
pullSecrets:
- private-registry
registry:
image:
pullSecrets:
- name: private-registry
shared-secrets:
selfsign:
image:
pullSecrets:
- name: private-registry
gitlab:
task-runner:
image:
pullSecrets:
- name: private-registry
migrations:
image:
pullSecrets:
- name: private-registry
webservice:
image:
pullSecrets:
- name: private-registry
workhorse:
pullSecrets:
- name: private-registry
sidekiq:
image:
pullSecrets:
- name: private-registry
gitaly:
image:
pullSecrets:
- name: private-registry
gitlab-shell:
image:
pullSecrets:
- name: private-registry
gitlab-exporter:
image:
pullSecrets:
- name: private-registry
minio:
pullSecrets:
- name: private-registry
{{- end }}
global:
hosts:
domain: code.{{ .Values.hostname }}
gitlab:
name: code.{{ .Values.hostname }}
registry:
name: registry.{{ .Values.hostname }}
{{- if ( include "imagePullSecret" . ) }}
## values for image pull secrets
certificates:
image:
pullSecrets:
- name: private-registry
kubectl:
image:
pullSecrets:
- name: private-registry
{{ end }}
{{- if or .Values.gatekeeper.enabled .Values.istio.enabled .Values.monitoring.enabled }}
dependsOn:
{{- if .Values.gatekeeper.enabled }}
- name: gatekeeper
namespace: {{ .Release.Namespace }}
{{- end }}
{{- if .Values.istio.enabled }}
- name: istio
namespace: {{ .Release.Namespace }}
{{- end }}
{{- if .Values.monitoring.enabled }}
- name: monitoring
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}
\ No newline at end of file
{{- if .Values.addons.gitlab.enabled }}
apiVersion: v1
kind: Namespace
metadata:
labels:
app: gitlab
name: gitlab
---
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
name: private-registry
namespace: gitlab
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ template "imagePullSecret" . }}
{{- end }}
{{- end }}
\ No newline at end of file
......@@ -3,8 +3,7 @@ apiVersion: v1
kind: Namespace
metadata:
name: istio-system
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
---
apiVersion: v1
kind: Secret
......
......@@ -6,8 +6,7 @@ metadata:
labels:
istio-operator-managed: Reconcile
istio-injection: disabled
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
---
apiVersion: v1
kind: Secret
......
......@@ -5,7 +5,7 @@ metadata:
name: eck-operator
---
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -4,13 +4,8 @@ apiVersion: v1
kind: Namespace
metadata:
name: logging
{{- if .Values.istio.enabled }}
labels:
istio-injection: enabled
{{- end}}
---
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -3,9 +3,8 @@ apiVersion: v1
kind: Namespace
metadata:
name: monitoring
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
---
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -3,9 +3,8 @@ apiVersion: v1
kind: Namespace
metadata:
name: twistlock
{{- if and (ne .Values.registryCredentials.username "") (ne .Values.registryCredentials.password "") }}
---
{{- if ( include "imagePullSecret" . ) }}
apiVersion: v1
kind: Secret
metadata:
......
......@@ -29,4 +29,6 @@ stringData:
{{ toYaml .Values.twistlock.values | indent 4 }}
clusterauditor.yaml: |
{{ toYaml .Values.twistlock.values | indent 4 }}
gitlab.yaml: |
{{ toYaml .Values.addons.gitlab.values | indent 4 }}
data:
......@@ -4,13 +4,28 @@ hostname: bigbang.dev
# TODO: All this does right now is toggle GitRepositories, it is _not_ fully functional
offline: false
# Registry credentials to use from pulling images from private registry, will create an appropriate imagePullSecret in all relevant namespaces
# Regisitires can be an explicit map of registries as provided here
registryCredentials:
registry: registry1.dsop.io
username: ""
password: ""
email: ""
# Or a list of registires:
# registryCredentials:
# - registry: registry1.dsop.io
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
# - registry: registry1.dso.mil
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
# - registry: registry.dso.mil
# username: user.name
# password: user-secret
# email: xxx@xxx.xxx
# Global git values
# Order of precedence is:
# 1. existingSecret
......@@ -153,4 +168,11 @@ addons:
repo: https://repo1.dsop.io/platform-one/big-bang/apps/sandbox/authservice.git
path: "./chart"
tag: "0.1.6-bb.0"
values: {}
\ No newline at end of file
values: {}
gitlab:
enabled: false
git:
repo: https://repo1.dso.mil/platform-one/big-bang/apps/developer-tools/gitlab.git
path: "./chart"
tag: "4.2.0-bb.1"
......@@ -10,6 +10,7 @@ flux check --pre
# Install flux in the cluster
kubectl create ns flux-system || true
# TODO When changing the flux images to .mil this will need to chagne
kubectl create secret docker-registry private-registry -n flux-system \
--docker-server=registry1.dsop.io \
--docker-username='robot$bigbang' \
......@@ -25,8 +26,11 @@ flux check
# Deploy BigBang using dev sized scaling
echo "Installing BigBang"
helm upgrade -i bigbang chart -n bigbang --create-namespace \
--set registryCredentials.username='robot$bigbang' --set registryCredentials.password=${REGISTRY1_PASSWORD} \
-f tests/ci/k3d/values.yaml
--set registryCredentials[0].username='robot$bigbang' --set registryCredentials[0].password=${REGISTRY1_PASSWORD} \
--set registryCredentials[0].registry=registry1.dsop.io \
--set registryCredentials[1].username='robot$bigbang' --set registryCredentials[1].password=${REGISTRY1_PASSWORD} \
--set registryCredentials[1].registry=registry1.dso.mil \
-f tests/ci/k3d/values.yaml
## Apply secrets kustomization pointing to current branch
echo "Deploying secrets from the ${CI_COMMIT_REF_NAME} branch"
......
......@@ -3,7 +3,7 @@
set -e
## This is an array to instantiate the order of wait conditions
ORDERED_HELMRELEASES="gatekeeper istio-operator istio monitoring eck-operator ek fluent-bit twistlock cluster-auditor"
ORDERED_HELMRELEASES="gatekeeper istio-operator istio monitoring eck-operator ek fluent-bit twistlock cluster-auditor gitlab"
## This the actual deployed helmrelease objects in the cluster
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment