-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: wip * chore: wip * chore: wip * chore: wip * chore: wip * chore(manifests): update container entrypoints * chore(deploy): split redis URL in host + port * fix(cli): make Redis flags global * fix(redis): rename port field * fix(runner): try log layer * fix: trigger ci * fix(runner): fix get layer * fix(runner): fix logs layer/repo * chore(deploy): fix RBAC for burrito-runner + ssh known hosts * chore(deploy): add TODO on CM reloading * chore(deploy): helm: add checksums for configmap * chore(deploy): helm: use appVersion for image tag * ci(helm): add CI/CD for Helm chart * ci(helm): test Helm rendering * ci(helm): make Helm render mandatory * fix(helm): appVersion references * ci(helm): trigger on Helm chart files for PR * docs(burrito): fix some typos and markdown lint * chore(manifests): update references to burrito namespace * fix(cmd): add --namespaces flag + update doc * chore(manifests): use burrito NS for manifest install method * docs(burrito): describe 2 installation methods * docs(burrito): describe multi-tenant architecture * fix(helm): update values-example * fix(helm): remove burrito-runner default SA * fix(helm): make tenants a empty array * ci(helm): remove ghcr logout * fix(helm): rename redis default hostname --------- Co-authored-by: Alan <alanl@padok.fr>
- Loading branch information
1 parent
6f45c0b
commit 8f98413
Showing
55 changed files
with
1,404 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Helm CI/CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'deploy/charts/**' | ||
|
||
env: | ||
CHART_NAME: burrito | ||
CHART_PATH: ./deploy/charts/burrito | ||
CHART_REPO: ghcr.io/${{ github.repository_owner }}/charts | ||
|
||
jobs: | ||
helm-render: | ||
name: Helm Render | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Helm Render | ||
run: helm template ${{ env.CHART_PATH }} | ||
|
||
helm-push: | ||
name: Helm Push | ||
runs-on: ubuntu-latest | ||
needs: helm-render | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: GHCR Login | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.repository_owner }} --password-stdin | ||
|
||
- name: Compute versions | ||
shell: bash | ||
run: | | ||
CURRENT_VERSION=$(yq $CHART_PATH/Chart.yaml --expression .version) | ||
if [[ ${{ github.event_name }} == 'pull_request' || ${{ github.event_name }} == 'push' && ${{ github.ref_type }} == 'branch' ]]; then | ||
echo "VERSION=$(echo $CURRENT_VERSION-${{ github.sha }})" >> $GITHUB_ENV | ||
echo "APP_VERSION=${{ github.sha }}" >> $GITHUB_ENV | ||
elif [[ ${{ github.event_name }} == 'push' && ${{ github.ref_type }} == 'tag' ]]; then | ||
echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/v//')" >> $GITHUB_ENV | ||
echo "APP_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV | ||
else | ||
echo "Unsupported event type" | ||
exit 1 | ||
fi | ||
- name: Helm Package | ||
run: helm package ${{ env.CHART_PATH }} -u --version ${{ env.VERSION }} --app-version ${{ env.APP_VERSION }} | ||
|
||
- name: Helm Push | ||
run: helm push ./${{ env.CHART_NAME }}-${{ env.VERSION }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
name: burrito | ||
description: A Helm chart for handling a complete burrito deployment | ||
type: application | ||
version: 0.1.0 | ||
appVersion: "v0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{{- if .Values.config.create }} | ||
|
||
{{- $config := .Values.config.burrito }} | ||
|
||
{{/* | ||
Tenant Namespaces | ||
*/}} | ||
{{- $tenantNamespaces := list }} | ||
{{- range $tenant := .Values.tenants }} | ||
{{- $tenantNamespaces = append $tenantNamespaces $tenant.namespace.name }} | ||
{{- end }} | ||
{{- $_ := set $config.controller "namespaces" (default $tenantNamespaces $config.controller.namespaces) }} | ||
|
||
{{/* | ||
Redis Hostname | ||
*/}} | ||
{{- if .Values.redis.enabled }} | ||
{{- $_ := set $config.redis "hostname" (printf "%s.%s" "burrito-redis" .Release.Namespace) }} | ||
{{- end }} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: burrito-config | ||
labels: | ||
app.kubernetes.io/name: burrito-config | ||
{{- toYaml .Values.global.metadata.labels | nindent 4 }} | ||
{{- with (mergeOverwrite (deepCopy .Values.global.metadata.annotations) .Values.config.annotations) }} | ||
annotations: | ||
{{- range $key, $value := . }} | ||
{{ $key }}: {{ $value | quote }} | ||
{{- end }} | ||
{{- end }} | ||
data: | ||
config.yaml: |- | ||
{{- toYaml $config | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{{ $configChecksum := (include (print $.Template.BasePath "/config.yaml") . | sha256sum) }} | ||
{{ $sshKnownHostsChecksum := (include (print $.Template.BasePath "/ssh-known-hosts.yaml") . | sha256sum) }} | ||
|
||
{{- with mergeOverwrite (deepCopy .Values.global) .Values.controllers }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: burrito-controllers | ||
annotations: | ||
{{- toYaml .metadata.annotations | nindent 4 }} | ||
labels: | ||
{{- toYaml .metadata.labels | nindent 4 }} | ||
spec: | ||
{{- if not .deployment.autoscaling.enabled }} | ||
replicas: {{ .deployment.replicas }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
{{- toYaml .metadata.labels | nindent 6 }} | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/burrito-config: {{ $configChecksum }} | ||
checksum/burrito-ssh-known-hosts: {{ $sshKnownHostsChecksum }} | ||
{{- toYaml .deployment.podAnnotations | nindent 8 }} | ||
labels: | ||
{{- toYaml .metadata.labels | nindent 8 }} | ||
spec: | ||
{{- with .deployment.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
serviceAccountName: burrito-controllers | ||
securityContext: | ||
{{- toYaml .deployment.podSecurityContext | nindent 8 }} | ||
containers: | ||
- name: burrito | ||
command: | ||
{{- toYaml .deployment.command | nindent 12 }} | ||
args: | ||
{{- toYaml .deployment.args | nindent 12 }} | ||
securityContext: | ||
{{- toYaml .deployment.securityContext | nindent 12 }} | ||
image: "{{ .deployment.image.repository }}:{{ .deployment.image.tag | default $.Chart.AppVersion }}" | ||
imagePullPolicy: {{ .deployment.image.pullPolicy }} | ||
ports: | ||
{{- toYaml .deployment.ports | nindent 12 }} | ||
livenessProbe: | ||
{{- toYaml .deployment.livenessProbe | nindent 12 }} | ||
readinessProbe: | ||
{{- toYaml .deployment.readinessProbe | nindent 12 }} | ||
resources: | ||
{{- toYaml .deployment.resources | nindent 12 }} | ||
env: | ||
{{- toYaml .deployment.env | nindent 12 }} | ||
envFrom: | ||
{{- toYaml .deployment.envFrom | nindent 12 }} | ||
volumeMounts: | ||
- name: burrito-config | ||
mountPath: /etc/burrito | ||
readOnly: true | ||
{{- with .deployment.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .deployment.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .deployment.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
volumes: | ||
- name: burrito-config | ||
configMap: | ||
name: burrito-config | ||
{{- if .service.enabled }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: burrito-controllers | ||
labels: | ||
{{- toYaml .metadata.labels | nindent 4}} | ||
annotations: | ||
{{- toYaml .metadata.annotations | nindent 4}} | ||
spec: | ||
type: {{ .type }} | ||
ports: | ||
{{- toYaml .service.ports | nindent 4 }} | ||
selector: | ||
{{- toYaml .metadata.labels | nindent 4 }} | ||
{{- end }} | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: burrito-controllers | ||
labels: | ||
{{- toYaml .metadata.labels | nindent 4 }} | ||
annotations: | ||
{{- toYaml .metadata.annotations | nindent 4 }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: burrito-controllers | ||
labels: | ||
{{- toYaml .metadata.labels | nindent 4 }} | ||
annotations: | ||
{{- toYaml .metadata.annotations | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: burrito-controllers | ||
subjects: | ||
- kind: ServiceAccount | ||
name: burrito-controllers | ||
namespace: {{ $.Release.Namespace }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../manifests/crds/config.terraform.padok.cloud_terraformlayers.yaml |
1 change: 1 addition & 0 deletions
1
deploy/charts/burrito/templates/crds/crd-terraformpullrequests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../manifests/crds/config.terraform.padok.cloud_terraformpullrequests.yaml |
1 change: 1 addition & 0 deletions
1
deploy/charts/burrito/templates/crds/crd-terraformrepositories.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../../manifests/crds/config.terraform.padok.cloud_terraformrepositories.yaml |
Oops, something went wrong.