Skip to content

Commit

Permalink
Merge pull request #254 from StatCan/feat-gitea-prot-b
Browse files Browse the repository at this point in the history
feat(gitea): split gitea into two controller deployment
  • Loading branch information
cboin1996 authored Jun 14, 2022
2 parents 9d3cd8a + 42252b9 commit 1146524
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 8 deletions.
2 changes: 1 addition & 1 deletion stable/profiles-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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.3.2
version: 0.4.2

# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "profiles-controller.fullname" . }}-gitea
name: {{ include "profiles-controller.fullname" . }}-gitea-protected-b
labels:
{{- include "profiles-controller.labels" . | nindent 4 }}
spec:
Expand Down Expand Up @@ -36,15 +36,17 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- gitea
- --argocdnamespace
- {{ .Values.components.gitea.namespace }}
envFrom:
{{- toYaml .Values.components.gitea.envFrom | nindent 14 }}
{{- toYaml .Values.components.giteaProtectedB.envFrom | nindent 14 }}
env:
{{- range $env := .Values.extraEnv }}
- name: {{ $env.name }}
value: "{{ $env.value }}"
{{- end }}
{{- range $env := .Values.components.giteaProtectedB.env }}
- name: {{ $env.name }}
value: "{{ $env.value }}"
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "profiles-controller.fullname" . }}-gitea-unclassified
labels:
{{- include "profiles-controller.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "profiles-controller.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "profiles-controller.selectorLabels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "profiles-controller.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- gitea
envFrom:
{{- toYaml .Values.components.giteaUnclassified.envFrom | nindent 14 }}
env:
{{- range $env := .Values.extraEnv }}
- name: {{ $env.name }}
value: "{{ $env.value }}"
{{- end }}
{{- range $env := .Values.components.giteaUnclassified.env }}
- name: {{ $env.name }}
value: "{{ $env.value }}"
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
55 changes: 52 additions & 3 deletions stable/profiles-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,61 @@ components:
# comma seperated vault mounts, e.g. "minio_standard,minio_premium"
instances: ""

gitea:
# argocd namespace
namespace: "argocd"
giteaUnclassified:
envFrom:
- secretRef:
name: "gitea-postgres-connection-unclassified"
env:
- name: GITEA_CLASSIFICATION
value: "unclassified"
- name: GITEA_SERVICE_URL
value: "gitea-unclassified-http"
- name: GITEA_URL_PREFIX
value: "gitea-unclassified"
- name: GITEA_SERVICE_PORT
value: 80
- name: GITEA_BANNER_CONFIGMAP_NAME
value: "gitea-banner-unclassified"
- name: GITEA_ARGOCD_NAMESPACE
value: "profiles-argocd-system"
- name: GITEA_ARGOCD_SOURCE_REPO_URL
value: https://github.com/StatCan/aaw-argocd-manifests.git
- name: GITEA_ARGOCD_SOURCE_TARGET_REVISION
value: "aaw-dev-cc-00"
- name: GITEA_ARGOCD_SOURCE_PATH
value: "profiles-argocd-system/template/gitea/unclassified"
- name: GITEA_ARGOCD_PROJECT
value: "default"
- name: GITEA_SOURCE_CONTROL_ENABLED_LABEL
value: "sourcecontrol.statcan.gc.ca/enabled"

giteaProtectedB:
envFrom:
- secretRef:
name: "gitea-postgres-connection-protected-b"
env:
- name: GITEA_CLASSIFICATION
value: "protected-b"
- name: GITEA_SERVICE_URL
value: "gitea-protected-b-http"
- name: GITEA_URL_PREFIX
value: "gitea-protected-b"
- name: GITEA_SERVICE_PORT
value: 80
- name: GITEA_BANNER_CONFIGMAP_NAME
value: "gitea-banner-protected-b"
- name: GITEA_ARGOCD_NAMESPACE
value: "profiles-argocd-system"
- name: GITEA_ARGOCD_SOURCE_REPO_URL
value: https://github.com/StatCan/aaw-argocd-manifests.git
- name: GITEA_ARGOCD_SOURCE_TARGET_REVISION
value: "aaw-dev-cc-00"
- name: GITEA_ARGOCD_SOURCE_PATH
value: "profiles-argocd-system/template/gitea/protected-b"
- name: GITEA_ARGOCD_PROJECT
value: "default"
- name: GITEA_SOURCE_CONTROL_ENABLED_LABEL
value: "sourcecontrol.statcan.gc.ca/enabled"

blobcsi:
config: |
Expand Down

0 comments on commit 1146524

Please sign in to comment.