Add CDN thingy

This commit is contained in:
Julius 2022-05-24 22:50:01 +02:00
parent 5f0c4e8a51
commit d34ec0ad1e
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2
6 changed files with 133 additions and 0 deletions

View file

@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: cdn-deployment
namespace: family
labels:
app: cdn-deployment
keel.sh/policy: force
keel.sh/match-tag: "true"
spec:
replicas: 1
selector:
matchLabels:
app: cdn-deployment
template:
metadata:
labels:
app: cdn-deployment
spec:
containers:
- name: cdn-deployment
imagePullPolicy: Always
image: registry.asraphiel.dev/library/cdn-control:main
ports:
- containerPort: 8080
env:
- name: CDN_ACCESS_KEY
valueFrom:
secretKeyRef:
name: cdn-secrets
key: access-key
- name: CDN_SECRET_KEY
valueFrom:
secretKeyRef:
name: cdn-secrets
key: secret-key
- name: CDN_ENDPOINT
valueFrom:
secretKeyRef:
name: cdn-secrets
key: endpoint
- name: CDN_BASE_PATH
valueFrom:
secretKeyRef:
name: cdn-secrets
key: base-path
- name: CDN_BUCKET
valueFrom:
secretKeyRef:
name: cdn-secrets
key: bucket
imagePullSecrets:
- name: registry-creds

View file

@ -0,0 +1,27 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cdn-deployment-ingress
namespace: misc
spec:
rules:
- host: "cdn.asraphiel.dev"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: cdn-deployment-service
port:
number: 80
- host: "cdn.voidcorp.nl"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: cdn-deployment-service
port:
number: 80

View file

@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- ingress.yaml
- service.yaml
- secret.yaml

View file

@ -0,0 +1,33 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: cdn-secrets
namespace: cdn
spec:
refreshInterval: "15s"
secretStoreRef:
name: vault
kind: ClusterSecretStore
target:
name: cdn-secrets
data:
- secretKey: access-key
remoteRef:
key: k8s/cdn
property: access-key
- secretKey: secret-key
remoteRef:
key: k8s/cdn
property: secret-key
- secretKey: endpoint
remoteRef:
key: k8s/cdn
property: endpoint
- secretKey: base-path
remoteRef:
key: k8s/cdn
property: base-path
- secretKey: bucket
remoteRef:
key: k8s/cdn
property: bucket

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: cdn-deployment-service
namespace: misc
spec:
selector:
app: cdn-deployment
ports:
- protocol: TCP
port: 80
targetPort: 8080

View file

@ -3,3 +3,4 @@ kind: Kustomization
resources:
- pinbot
- registry-creds.yaml
- cdn-control