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

Draft: fix: Restructure HELM charts, secrets encryption #20

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ LABEL maintainer.organisation="ELIXIR Cloud & AAI"

RUN groupadd -r pubgrade --gid 1000 && useradd -d /home/pubgrade -ms /bin/bash -r -g pubgrade pubgrade --uid 1000

RUN apt update && apt install -y \
curl \
gnupg \
&& apt clean && rm -rf /var/lib/apt/lists/*

ENV SOPS_VERSION v3.8.0

RUN curl -Lo /usr/local/bin/sops https://github.com/getsops/sops/releases/download/${SOPS_VERSION}/sops-${SOPS_VERSION}.linux.amd64 && \
chmod +x /usr/local/bin/sops

## Copy remaining app files
COPY --chown=1000:1000 ./ /app

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IMAGE_NAME_PUBGRADE=akash7778/pubgrade
IMAGE_NAME_PUBGRADE=akash7778/pubgrade:test_build_1
IMAGE_NAME_UPDATER=akash7778/pubgrade-updater
APP_NAME=pubgrade

Expand All @@ -21,7 +21,7 @@ test: ## Runs unit tests and shows coverage.
coverage report -m

install-pubgrade: # build ## Install pubgrade on cluster using helm.
kubectl create namespace $(APP_NAME) --dry-run=client -o yaml | kubectl apply -f -
# kubectl create namespace $(APP_NAME) --dry-run=client -o yaml | kubectl apply -f -
sed -i 's#akash7778/pubgrade:test_build#$(IMAGE_NAME_PUBGRADE)#g' deployment/values.yaml
sed -i 's#akash7778/notify-completion#$(IMAGE_NAME_UPDATER)#g' deployment/values.yaml
helm upgrade --install $(APP_NAME) deployment/ -n $(APP_NAME)
Expand Down
40 changes: 0 additions & 40 deletions deployment/templates/deployment.yaml

This file was deleted.

32 changes: 0 additions & 32 deletions deployment/templates/mongodb/mongodb-deployment.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions deployment/templates/mongodb/mongodb-pvc.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions deployment/templates/mongodb/mongodb-service.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions deployment/templates/notify-completion-deployment.yaml

This file was deleted.

63 changes: 0 additions & 63 deletions deployment/templates/pubgrade-pvc.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions deployment/templates/services.yaml

This file was deleted.

33 changes: 0 additions & 33 deletions deployment/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion deployment/Chart.yaml → helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
apiVersion: v1
name: pubgrade
description: A Helm chart for Kubernetes
type: application
Expand Down
25 changes: 25 additions & 0 deletions helm/templates/pubgrade-build-complete-updater/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: build-complete-updater
spec:
replicas: {{ .Values.pubgrade_build_complete_updater.replicaCount }}
selector:
matchLabels:
app: {{ .Values.appName }}
template:
metadata:
labels:
app: {{ .Values.appName }}
spec:
serviceAccountName: {{ .Values.pubgrade_webserver.serviceAccountName }}
automountServiceAccountToken: true
containers:
- image: {{ .Values.pubgrade_build_complete_updater.image }}
name: pubgrade_build_complete_updater
imagePullPolicy: {{ .Values.pubgrade_build_complete_updater.imagePullPolicy }}
env:
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: BROKER_URL
value: {{ .Values.pubgrade_url }}
32 changes: 32 additions & 0 deletions helm/templates/pubgrade-mongodb/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.pubgrade_mongodb.name }}
labels:
app: db
spec:
replicas: {{ .Values.pubgrade_mongodb.replicaCount }}
selector:
matchLabels:
app: db
template:
metadata:
labels:
app: db
spec:
securityContext:
runAsUser: {{ .Values.pubgrade_mongodb.securityContext.runAsUser }}
containers:
- name: mongodb
image: {{ .Values.pubgrade_mongodb.image }}
ports:
- containerPort: {{ .Values.pubgrade_mongodb.port }}
name: db-container
volumeMounts:
- mountPath: /data/db
name: {{ .Values.pubgrade_mongodb.volume.name }}
volumes:
- name: {{ .Values.pubgrade_mongodb.volume.name }}
persistentVolumeClaim:
claimName: {{ .Values.pubgrade_mongodb.volume.claimName }}

30 changes: 30 additions & 0 deletions helm/templates/pubgrade-mongodb/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{ if .Values.pubgrade_mongodb.volume.storageActive }}
{{ if .Values.pubgrade_mongodb.volume.deployLocalPv }}
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-pv
labels:
type: local
spec:
storageClassName: {{ .Values.pubgrade_mongodb.volume.storageClass }}
capacity:
storage: {{ .Values.pubgrade_mongodb.volume.size }}
accessModes:
- ReadWriteOnce
hostPath:
path: {{ .Values.pubgrade_mongodb.volume.pathToLocalDir }}
{{ end }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.pubgrade_mongodb.volume.claimName }}
spec:
storageClassName: {{ .Values.pubgrade_mongodb.volume.storageClass }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.pubgrade_mongodb.volume.size }}
{{ end }}
Loading