From 63209d535224910f1b3ee2738d26c08223385e49 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Mon, 25 Mar 2024 09:09:51 +0100 Subject: [PATCH] Added kubernetes deployment --- .dockerignore | 2 ++ Dockerfile | 7 +++---- content/_index.md | 4 +++- kube/certs.yaml | 14 +++++++++++++ kube/deployment.yaml | 33 +++++++++++++++++++++++++++++ kube/ingress.yaml | 17 +++++++++++++++ kube/service.yaml | 14 +++++++++++++ nginx.conf | 49 -------------------------------------------- 8 files changed, 86 insertions(+), 54 deletions(-) create mode 100644 .dockerignore create mode 100644 kube/certs.yaml create mode 100644 kube/deployment.yaml create mode 100644 kube/ingress.yaml create mode 100644 kube/service.yaml delete mode 100644 nginx.conf diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..07d8bd1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +*lock +public/** \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a303f1b..f732565 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,8 @@ -FROM registry.odit.services/hub/betterweb/hugo:latest as build +FROM registry.odit.services/hub/hugomods/hugo:exts as build WORKDIR /app COPY . /app/ RUN hugo -FROM registry.odit.services/library/nginx-brotli:3.15 -COPY ./nginx.conf /etc/nginx/nginx.conf -COPY --from=build /app/public /usr/share/nginx/html \ No newline at end of file +FROM registry.odit.services/hub/hugomods/hugo:nginx +COPY --from=build /app/public /site \ No newline at end of file diff --git a/content/_index.md b/content/_index.md index 494f782..8c4e265 100644 --- a/content/_index.md +++ b/content/_index.md @@ -3,7 +3,9 @@ archetype: home title: Kubecon 2024 --- -All about the things I did and sessions I attended at Kubecon 2024. +All about the things I did and sessions I attended at KubeCon/CloudNativeCon 2024. + +This current version is probably full of typos - will fix later. ## Style Guide diff --git a/kube/certs.yaml b/kube/certs.yaml new file mode 100644 index 0000000..1582fd6 --- /dev/null +++ b/kube/certs.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: kubecon24.nicolai-ort.com-cert + namespace: nicolai-ort +spec: + commonName: kubecon24.nicolai-ort.com + secretName: kubecon24.nicolai-ort.com-cert + dnsNames: + - kubecon24.nicolai-ort.com + issuerRef: + name: letsencrypt-prod + kind: ClusterIssuer \ No newline at end of file diff --git a/kube/deployment.yaml b/kube/deployment.yaml new file mode 100644 index 0000000..af47745 --- /dev/null +++ b/kube/deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kubecon24 + namespace: nicolai-ort + labels: + app: kubecon24 +spec: + replicas: 1 + revisionHistoryLimit: 10 + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 0 + maxSurge: 1 + selector: + matchLabels: + app: kubecon24 + template: + metadata: + labels: + app: kubecon24 + spec: + containers: + - name: kubecon24 + image: registry.odit.services/niggl/kubecon24:latest + imagePullPolicy: Always + ports: + - containerPort: 80 + name: web + imagePullSecrets: + - name: registry-odit-services + restartPolicy: Always diff --git a/kube/ingress.yaml b/kube/ingress.yaml new file mode 100644 index 0000000..3dcfeb6 --- /dev/null +++ b/kube/ingress.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: kubecon24.nicolai-ort.com + namespace: nicolai-ort +spec: + entryPoints: + - websecure + routes: + - match: Host(`kubecon24.nicolai-ort.com`) + kind: Rule + services: + - name: kubecon24 + port: 80 + tls: + secretName: kubecon24.nicolai-ort.com-cert \ No newline at end of file diff --git a/kube/service.yaml b/kube/service.yaml new file mode 100644 index 0000000..b28136d --- /dev/null +++ b/kube/service.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: kubecon24 + namespace: nicolai-ort + labels: + app: kubecon24 +spec: + ports: + - port: 80 + selector: + app: kubecon24 + type: ClusterIP \ No newline at end of file diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index 6d5d885..0000000 --- a/nginx.conf +++ /dev/null @@ -1,49 +0,0 @@ -events { -} -http { - include mime.types; - sendfile on; - server { - error_page 404 /index.html; - root /usr/share/nginx/html; - location ~ /index\.html$ { - internal; - add_header Cache-Control 'no-store'; - } - location ~* \.(png|jpg|jpeg|webp|gif|ico|woff|otf|ttf|eot|svg|txt|pdf|docx?|xlsx?)$ { - access_log off; - expires 1y; - } - location / { - try_files $uri $uri/ /index.html; - } - # --- GZIP - gzip on; - gzip_disable "msie6"; - gzip_vary on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - gzip_http_version 1.1; - gzip_types application/javascript - application/rss+xml - application/vnd.ms-fontobject - application/x-font - application/x-font-opentype - application/x-font-otf - application/x-font-truetype - application/x-font-ttf - application/x-javascript - application/xhtml+xml - application/xml - font/opentype - font/otf - font/ttf - image/svg+xml - image/x-icon - text/css - text/javascript - text/plain - text/xml; - } -} \ No newline at end of file