generated from onedr0p/cluster-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: add support for serving static content #203
Merged
Merged
Conversation
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
github-actions
bot
added
area/kubernetes
Changes made in the kubernetes directory
area/terraform
Changes made in the terraform directory
labels
Jan 7, 2024
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/static-content-proxy
+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/static-content-proxy
@@ -0,0 +1,34 @@
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: cluster-apps
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: static-content-proxy
+ namespace: flux-system
+spec:
+ commonMetadata:
+ labels:
+ app.kubernetes.io/name: static-content-proxy
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ interval: 30m
+ path: ./kubernetes/apps/default/static-content-proxy/app
+ postBuild:
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-settings
+ - kind: Secret
+ name: cluster-secrets
+ prune: true
+ retryInterval: 1m
+ sourceRef:
+ kind: GitRepository
+ name: home-kubernetes
+ targetNamespace: default
+ timeout: 5m
+ wait: false
+
--- kubernetes/apps/default/static-content-proxy/app Kustomization: flux-system/static-content-proxy HelmRelease: default/static-content-proxy
+++ kubernetes/apps/default/static-content-proxy/app Kustomization: flux-system/static-content-proxy HelmRelease: default/static-content-proxy
@@ -0,0 +1,78 @@
+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta2
+kind: HelmRelease
+metadata:
+ labels:
+ app.kubernetes.io/name: static-content-proxy
+ kustomize.toolkit.fluxcd.io/name: static-content-proxy
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: static-content-proxy
+ namespace: default
+spec:
+ chart:
+ spec:
+ chart: app-template
+ sourceRef:
+ kind: HelmRepository
+ name: bjw-s
+ namespace: flux-system
+ version: 2.4.0
+ install:
+ remediation:
+ retries: 3
+ interval: 30m
+ maxHistory: 2
+ uninstall:
+ keepHistory: false
+ upgrade:
+ cleanupOnFail: true
+ remediation:
+ retries: 3
+ values:
+ controllers:
+ main:
+ annotations:
+ configmap.reloader.stakater.com/reload: static-content-proxy
+ containers:
+ main:
+ image:
+ repository: public.ecr.aws/nginx/nginx
+ tag: 1.25.3
+ resources:
+ limits:
+ memory: 64M
+ requests:
+ cpu: 5m
+ memory: 10M
+ strategy: RollingUpdate
+ ingress:
+ main:
+ annotations:
+ external-dns.alpha.kubernetes.io/target: external.18b.haus
+ hajimari.io/enable: 'false'
+ className: external
+ enabled: true
+ hosts:
+ - host: static.18b.haus
+ paths:
+ - path: /
+ service:
+ name: main
+ port: http
+ tls:
+ - hosts:
+ - static.18b.haus
+ persistence:
+ nginx-config:
+ globalMounts:
+ - path: /etc/nginx/nginx.conf
+ readOnly: true
+ subPath: nginx.conf
+ name: static-content-proxy
+ type: configMap
+ service:
+ main:
+ ports:
+ http:
+ port: 80
+
--- kubernetes/apps/default/static-content-proxy/app Kustomization: flux-system/static-content-proxy ConfigMap: default/static-content-proxy
+++ kubernetes/apps/default/static-content-proxy/app Kustomization: flux-system/static-content-proxy ConfigMap: default/static-content-proxy
@@ -0,0 +1,41 @@
+---
+apiVersion: v1
+data:
+ nginx.conf: |
+ user nginx;
+ worker_processes 1;
+
+ events {
+ worker_connections 1024;
+ }
+
+ http {
+ include /etc/nginx/mime.types;
+
+ default_type application/octet-stream;
+ sendfile on;
+ keepalive_timeout 65;
+
+ server {
+ listen 80;
+
+ client_max_body_size 128M;
+
+ location / {
+ proxy_hide_header "Set-Cookie";
+ proxy_intercept_errors on;
+ proxy_pass https://minio.default.svc.cluster.local:9000/static-content/;
+ }
+ }
+ }
+kind: ConfigMap
+metadata:
+ annotations:
+ kustomize.toolkit.fluxcd.io/substitute: disabled
+ labels:
+ app.kubernetes.io/name: static-content-proxy
+ kustomize.toolkit.fluxcd.io/name: static-content-proxy
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: static-content-proxy
+ namespace: default
+ |
--- HelmRelease: default/static-content-proxy Service: default/static-content-proxy
+++ HelmRelease: default/static-content-proxy Service: default/static-content-proxy
@@ -0,0 +1,22 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: static-content-proxy
+ labels:
+ app.kubernetes.io/instance: static-content-proxy
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: static-content-proxy
+ app.kubernetes.io/service: static-content-proxy
+spec:
+ type: ClusterIP
+ ports:
+ - port: 80
+ targetPort: 80
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: static-content-proxy
+ app.kubernetes.io/name: static-content-proxy
+
--- HelmRelease: default/static-content-proxy Deployment: default/static-content-proxy
+++ HelmRelease: default/static-content-proxy Deployment: default/static-content-proxy
@@ -0,0 +1,76 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: static-content-proxy
+ labels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: static-content-proxy
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: static-content-proxy
+ annotations:
+ configmap.reloader.stakater.com/reload: static-content-proxy
+spec:
+ revisionHistoryLimit: 3
+ replicas: 1
+ strategy:
+ type: RollingUpdate
+ selector:
+ matchLabels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/name: static-content-proxy
+ app.kubernetes.io/instance: static-content-proxy
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/component: main
+ app.kubernetes.io/instance: static-content-proxy
+ app.kubernetes.io/name: static-content-proxy
+ spec:
+ enableServiceLinks: true
+ serviceAccountName: default
+ automountServiceAccountToken: true
+ hostIPC: false
+ hostNetwork: false
+ hostPID: false
+ dnsPolicy: ClusterFirst
+ containers:
+ - image: public.ecr.aws/nginx/nginx:1.25.3
+ livenessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ tcpSocket:
+ port: 80
+ timeoutSeconds: 1
+ name: main
+ readinessProbe:
+ failureThreshold: 3
+ initialDelaySeconds: 0
+ periodSeconds: 10
+ tcpSocket:
+ port: 80
+ timeoutSeconds: 1
+ resources:
+ limits:
+ memory: 64M
+ requests:
+ cpu: 5m
+ memory: 10M
+ startupProbe:
+ failureThreshold: 30
+ initialDelaySeconds: 0
+ periodSeconds: 5
+ tcpSocket:
+ port: 80
+ timeoutSeconds: 1
+ volumeMounts:
+ - mountPath: /etc/nginx/nginx.conf
+ name: nginx-config
+ readOnly: true
+ subPath: nginx.conf
+ volumes:
+ - configMap:
+ name: static-content-proxy
+ name: nginx-config
+
--- HelmRelease: default/static-content-proxy Ingress: default/static-content-proxy
+++ HelmRelease: default/static-content-proxy Ingress: default/static-content-proxy
@@ -0,0 +1,29 @@
+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: static-content-proxy
+ labels:
+ app.kubernetes.io/instance: static-content-proxy
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: static-content-proxy
+ annotations:
+ external-dns.alpha.kubernetes.io/target: external.18b.haus
+ hajimari.io/enable: 'false'
+spec:
+ ingressClassName: external
+ tls:
+ - hosts:
+ - static.18b.haus
+ rules:
+ - host: static.18b.haus
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: static-content-proxy
+ port:
+ number: 80
+ |
martinohmann
force-pushed
the
static-content
branch
from
January 7, 2024 19:09
c23d482
to
55ab78e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/kubernetes
Changes made in the kubernetes directory
area/terraform
Changes made in the terraform directory
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.