1.6.0 Updates
- Front envvars supplied by .env.production for vite build - Backend API is now prefixed at /v1/api - New push-all builds both backend and frontend images - helm chart adds a postgres database with services and a persistent volume using nfsmaster
parent
55e0a10d01
commit
310da309e2
@ -1,27 +1,37 @@
|
||||
REGISTRY_NAME=registry.runcible.io
|
||||
FRONTEND_IMAGE_NAME=$(REGISTRY_NAME)/demo-helm-frontend
|
||||
FRONTEND_IMAGE_VERSION=1.4.0-dev
|
||||
FRONTEND_IMAGE_VERSION=1.6.0
|
||||
API_IMAGE_NAME=$(REGISTRY_NAME)/demo-helm-api
|
||||
API_IMAGE_VERSION=1.4.0-dev
|
||||
API_IMAGE_VERSION=1.6.0
|
||||
|
||||
push-all: push-app-image push-api-image
|
||||
.PHONY: push-all
|
||||
|
||||
push-app-image: build-app-image
|
||||
docker push $(FRONTEND_IMAGE_NAME):$(FRONTEND_IMAGE_VERSION)
|
||||
.PHONY: push-app-image
|
||||
|
||||
build-app-image:
|
||||
docker build -t $(FRONTEND_IMAGE_NAME):$(FRONTEND_IMAGE_VERSION) ./app
|
||||
.PHONY: build-app-image
|
||||
|
||||
push-api-image: build-api-image
|
||||
docker push $(API_IMAGE_NAME):$(API_IMAGE_VERSION)
|
||||
.PHONY: push-api-image
|
||||
|
||||
build-api-image:
|
||||
docker build -t $(API_IMAGE_NAME):$(API_IMAGE_VERSION) ./api
|
||||
.PHONY: build-api-image
|
||||
|
||||
update-API-deps:
|
||||
pip-compile -o api/requirements.txt api/requirements.in
|
||||
.PHONY: update-API-deps
|
||||
|
||||
sync-virtualenv:
|
||||
pip-sync dev_requirements.txt api/requirements.txt
|
||||
.PHONY: sync-virtualenv
|
||||
|
||||
check-images:
|
||||
echo $(FRONTEND_IMAGE_NAME):$(FRONTEND_IMAGE_VERSION)
|
||||
echo $(API_IMAGE_NAME):$(API_IMAGE_VERSION)
|
||||
.PHONY: check-images
|
@ -0,0 +1 @@
|
||||
VITE_BACKEND_URI = "https://lab.runcible.io/v1/api"
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
apiVersion: v2
|
||||
name: demo-helm
|
||||
appVersion: 1.2.0
|
||||
appVersion: 1.6.0
|
||||
description: A Helm chart to practice helm
|
||||
version: 0.3.0
|
||||
version: 0.4.0
|
||||
type: application
|
||||
|
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-database-service
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
ports:
|
||||
- port: 5432
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
@ -0,0 +1,55 @@
|
||||
# This is a singleton postgres pod with a Persistent Volume Claim to an
|
||||
# NFS backed volume. See nfs-volume.yaml and nfs-volume-claim.yaml
|
||||
# It will be exposed as a service to the runcible namespace in mypostgres-service.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: ReplicaSet
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
||||
namespace: {{ .Values.namespace }}
|
||||
labels:
|
||||
app: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
||||
spec:
|
||||
# Since this is a singleton
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Release.Name }}-{{ .Chart.Name }}-database
|
||||
image: {{ .Values.services.database.image_name }}
|
||||
# This is a dev server effectively
|
||||
resources:
|
||||
requests:
|
||||
cpu: 1
|
||||
memory: 2Gi
|
||||
env:
|
||||
# Convert this over to use secrets instead
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.services.database.database_secret }}
|
||||
key: {{ .Values.services.database.database_passwd_key }}
|
||||
- name: POSTGRES_USER
|
||||
value: {{ .Values.services.database.database_user }}
|
||||
- name: POSTGRES_DB
|
||||
value: {{ .Values.services.database.database_name }}
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: 5432
|
||||
initialDelaySeconds: 180
|
||||
periodSeconds: 10
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
# The name of our pvc
|
||||
claimName: {{ .Values.services.database.persistent_volume_claim }}
|
@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: {{ .Values.services.database.persistent_volume }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
nfs:
|
||||
server: {{ .Values.services.database.nfs_server }}
|
||||
path: {{ .Values.services.database.nfs_path }}
|
@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Values.services.database.persistent_volume_claim }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
# By specifying a PersistentVolume in a PersistentVolumeClaim, you declare a binding between that specific PV and PVC.
|
||||
volumeName: {{ .Values.services.database.persistent_volume }}
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
# Empty string must be explicitly set otherwise default StorageClass will be set
|
||||
storageClassName: ''
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
@ -1,12 +1,24 @@
|
||||
---
|
||||
image_pull_secret: regcred
|
||||
image_pull_secret: "regcred"
|
||||
namespace: "demo-helm"
|
||||
services:
|
||||
frontend:
|
||||
image_name: "registry.runcible.io/demo-helm-frontend"
|
||||
image_version: "1.4.0"
|
||||
image_version: "1.6.0"
|
||||
replicas: 1
|
||||
backend:
|
||||
image_name: "registry.runcible.io/demo-helm-api"
|
||||
image_version: "1.4.0"
|
||||
image_version: "1.6.0"
|
||||
replicas: 1
|
||||
database:
|
||||
database_name: "demo_helm"
|
||||
database_user: "toor"
|
||||
database_secret: "database-secret"
|
||||
database_passwd_key: "password"
|
||||
image_name: "postgres:12-alpine"
|
||||
nfs_path: "/volume1/expanse/demo_helm"
|
||||
nfs_server: "nas1.runcible.io"
|
||||
persistent_volume: "demo-helm-db-pv"
|
||||
persistent_volume_claim: "demo-helm-db-pvc"
|
||||
|
||||
random: "tis-random-default"
|
Loading…
Reference in New Issue