Add bstein-dev-home deployment and Jenkins job
This commit is contained in:
parent
449574d59f
commit
6f6fb363b3
@ -9,3 +9,4 @@ resources:
|
||||
- ../../services/monitoring
|
||||
- ../../services/pegasus
|
||||
- ../../services/vault
|
||||
- ../../services/bstein-dev-home
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
# clusters/atlas/flux-system/applications/bstein-dev-home/image-automation.yaml
|
||||
apiVersion: image.toolkit.fluxcd.io/v1
|
||||
kind: ImageUpdateAutomation
|
||||
metadata:
|
||||
name: bstein-dev-home
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 1m0s
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: flux-system
|
||||
namespace: flux-system
|
||||
git:
|
||||
checkout:
|
||||
ref:
|
||||
branch: feature/ci-gitops
|
||||
commit:
|
||||
author:
|
||||
email: ops@bstein.dev
|
||||
name: flux-bot
|
||||
messageTemplate: "chore(bstein-dev-home): update images to {{range .Updated.Images}}{{.}}{{end}}"
|
||||
push:
|
||||
branch: feature/ci-gitops
|
||||
update:
|
||||
strategy: Setters
|
||||
path: services/bstein-dev-home
|
||||
@ -0,0 +1,15 @@
|
||||
# clusters/atlas/flux-system/applications/bstein-dev-home/kustomization.yaml
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: bstein-dev-home
|
||||
namespace: flux-system
|
||||
spec:
|
||||
interval: 10m
|
||||
path: ./services/bstein-dev-home
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: flux-system
|
||||
targetNamespace: bstein-dev-home
|
||||
wait: false
|
||||
@ -9,6 +9,8 @@ resources:
|
||||
- monerod/kustomization.yaml
|
||||
- pegasus/kustomization.yaml
|
||||
- pegasus/image-automation.yaml
|
||||
- bstein-dev-home/kustomization.yaml
|
||||
- bstein-dev-home/image-automation.yaml
|
||||
- harbor/kustomization.yaml
|
||||
- harbor/image-automation.yaml
|
||||
- jellyfin/kustomization.yaml
|
||||
|
||||
48
services/bstein-dev-home/backend-deployment.yaml
Normal file
48
services/bstein-dev-home/backend-deployment.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
# services/bstein-dev-home/backend-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: bstein-dev-home-backend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: bstein-dev-home-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: bstein-dev-home-backend
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: arm64
|
||||
node-role.kubernetes.io/worker: "true"
|
||||
imagePullSecrets:
|
||||
- name: harbor-bstein-robot
|
||||
containers:
|
||||
- name: backend
|
||||
image: registry.bstein.dev/bstein/bstein-dev-home-backend:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8080
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /api/healthz
|
||||
port: http
|
||||
initialDelaySeconds: 2
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /api/healthz
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 300m
|
||||
memory: 256Mi
|
||||
12
services/bstein-dev-home/backend-service.yaml
Normal file
12
services/bstein-dev-home/backend-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bstein-dev-home-backend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
selector:
|
||||
app: bstein-dev-home-backend
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 8080
|
||||
48
services/bstein-dev-home/frontend-deployment.yaml
Normal file
48
services/bstein-dev-home/frontend-deployment.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
# services/bstein-dev-home/frontend-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: bstein-dev-home-frontend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
replicas: 2
|
||||
revisionHistoryLimit: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app: bstein-dev-home-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: bstein-dev-home-frontend
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: arm64
|
||||
node-role.kubernetes.io/worker: "true"
|
||||
imagePullSecrets:
|
||||
- name: harbor-bstein-robot
|
||||
containers:
|
||||
- name: frontend
|
||||
image: registry.bstein.dev/bstein/bstein-dev-home-frontend:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 2
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 300m
|
||||
memory: 256Mi
|
||||
12
services/bstein-dev-home/frontend-service.yaml
Normal file
12
services/bstein-dev-home/frontend-service.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: bstein-dev-home-frontend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
selector:
|
||||
app: bstein-dev-home-frontend
|
||||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
48
services/bstein-dev-home/image.yaml
Normal file
48
services/bstein-dev-home/image.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
# services/bstein-dev-home/image.yaml
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImageRepository
|
||||
metadata:
|
||||
name: bstein-dev-home-frontend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
image: registry.bstein.dev/bstein/bstein-dev-home-frontend
|
||||
interval: 1m0s
|
||||
---
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImagePolicy
|
||||
metadata:
|
||||
name: bstein-dev-home-frontend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
imageRepositoryRef:
|
||||
name: bstein-dev-home-frontend
|
||||
filterTags:
|
||||
pattern: '^v?(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+(?:[-.][0-9A-Za-z]+)?)$'
|
||||
extract: '$version'
|
||||
policy:
|
||||
semver:
|
||||
range: ">=0.1.0"
|
||||
---
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImageRepository
|
||||
metadata:
|
||||
name: bstein-dev-home-backend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
image: registry.bstein.dev/bstein/bstein-dev-home-backend
|
||||
interval: 1m0s
|
||||
---
|
||||
apiVersion: image.toolkit.fluxcd.io/v1beta2
|
||||
kind: ImagePolicy
|
||||
metadata:
|
||||
name: bstein-dev-home-backend
|
||||
namespace: bstein-dev-home
|
||||
spec:
|
||||
imageRepositoryRef:
|
||||
name: bstein-dev-home-backend
|
||||
filterTags:
|
||||
pattern: '^v?(?P<version>[0-9]+\\.[0-9]+\\.[0-9]+(?:[-.][0-9A-Za-z]+)?)$'
|
||||
extract: '$version'
|
||||
policy:
|
||||
semver:
|
||||
range: ">=0.1.0"
|
||||
31
services/bstein-dev-home/ingress.yaml
Normal file
31
services/bstein-dev-home/ingress.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
# services/bstein-dev-home/ingress.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: bstein-dev-home
|
||||
namespace: bstein-dev-home
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: traefik
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||
cert-manager.io/cluster-issuer: letsencrypt
|
||||
spec:
|
||||
tls:
|
||||
- hosts: [ "bstein.dev" ]
|
||||
secretName: bstein-dev-home-tls
|
||||
rules:
|
||||
- host: bstein.dev
|
||||
http:
|
||||
paths:
|
||||
- path: /api
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: bstein-dev-home-backend
|
||||
port: { number: 80 }
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: bstein-dev-home-frontend
|
||||
port: { number: 80 }
|
||||
17
services/bstein-dev-home/kustomization.yaml
Normal file
17
services/bstein-dev-home/kustomization.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
# services/bstein-dev-home/kustomization.yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: bstein-dev-home
|
||||
resources:
|
||||
- namespace.yaml
|
||||
- image.yaml
|
||||
- frontend-deployment.yaml
|
||||
- frontend-service.yaml
|
||||
- backend-deployment.yaml
|
||||
- backend-service.yaml
|
||||
- ingress.yaml
|
||||
images:
|
||||
- name: registry.bstein.dev/bstein/bstein-dev-home-frontend
|
||||
newTag: latest # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-frontend"}
|
||||
- name: registry.bstein.dev/bstein/bstein-dev-home-backend
|
||||
newTag: latest # {"$imagepolicy": "bstein-dev-home:bstein-dev-home-backend"}
|
||||
4
services/bstein-dev-home/namespace.yaml
Normal file
4
services/bstein-dev-home/namespace.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: bstein-dev-home
|
||||
@ -287,6 +287,25 @@ spec:
|
||||
}
|
||||
}
|
||||
}
|
||||
pipelineJob('bstein-dev-home') {
|
||||
triggers {
|
||||
scm('H/2 * * * *')
|
||||
}
|
||||
definition {
|
||||
cpsScm {
|
||||
scm {
|
||||
git {
|
||||
remote {
|
||||
url('https://scm.bstein.dev/bstein/bstein-dev-home.git')
|
||||
credentials('gitea-pat')
|
||||
}
|
||||
branches('*/master')
|
||||
}
|
||||
}
|
||||
scriptPath('Jenkinsfile')
|
||||
}
|
||||
}
|
||||
}
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: astreae
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user