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

feat: add support for serving static content #203

Merged
merged 1 commit into from
Jan 7, 2024
Merged

Conversation

martinohmann
Copy link
Owner

No description provided.

@github-actions github-actions bot added area/kubernetes Changes made in the kubernetes directory area/terraform Changes made in the terraform directory labels Jan 7, 2024
Copy link

github-actions bot commented 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
+

Copy link

github-actions bot commented Jan 7, 2024

--- 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 martinohmann merged commit 86b005b into main Jan 7, 2024
4 checks passed
@martinohmann martinohmann deleted the static-content branch January 7, 2024 19:11
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant