From 9d5c9b53dc6c1a7ab2f77ad2412d5ca2e4499203 Mon Sep 17 00:00:00 2001 From: Jack Jackson Date: Wed, 26 Feb 2025 19:20:01 -0800 Subject: [PATCH] First contentful commit --- README.md | 3 +++ deployment.yaml | 36 ++++++++++++++++++++++++++++++++++++ kustomization.yaml | 11 +++++++++++ service.yaml | 14 ++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 README.md create mode 100644 deployment.yaml create mode 100644 kustomization.yaml create mode 100644 service.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..77be44e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Architecture for [this site](https://blog.scubbo.org/), image built from [here](https://gitea.scubbo.org/scubbo/blogcontent). + +Created on 2025-02-26, migrating from a [now deprecated repo](https://gitea.scubbo.org/scubbo/blog-infrastructure) that I created long ago, when I knew much less about k8s setup than I do now. In particular - I didn't know that `kustomize` existed, and so had hacked-together my own implementation of the image-update functionality. Proud of myself for figuring out how to do so - but let's use the established tool now I know that it exists! diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..2f62fb4 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: blog-deployment + labels: + role: app + namespace: blog +spec: + replicas: 2 + selector: + matchLabels: + role: app + template: + metadata: + labels: + role: app + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/arch + operator: In + values: + - arm64 + containers: + # Guidance on how to set up interaction with secure registry: + # https://github.com/k3s-io/k3s/issues/1148#issuecomment-641687668 + # (Unique to rancher/k3s. On traditional k8s installs, I suspect https://github.com/kubernetes/kubernetes/issues/43924 + # is the way) + - name: app + image: image_name + resources: + requests: + cpu: 10m diff --git a/kustomization.yaml b/kustomization.yaml new file mode 100644 index 0000000..52f3adf --- /dev/null +++ b/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - deployment.yaml + - service.yaml + +images: + - name: image_name + newName: gitea.scubbo.org/scubbo/blogcontent + newTag: 589aa1e202eec23c3dc2cceebd827385423a5d2d diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..0e3cb98 --- /dev/null +++ b/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: blog-svc-cip + namespace: blog +spec: + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 + selector: + role: app + sessionAffinity: None + type: ClusterIP \ No newline at end of file