Jafner.net/homelab/silver-hand/jafner-dev/jafner-dev.yml
Joey Hafner 4a6f6c3d79
Init k3s cluster with Terraform-provisioned AWS S3 bucket for Jafner.dev
- Add Terraform statefiles to gitignore
    - Add *.secret.yml to gitignore for k8s secrets manifests
- Init the "sellswords" directory for Terraform code interacting with public cloud providers.
    - Provision S3 bucket "Jafner-dev" to store static site files.
    - Describe CORS and access policies to apply to the bucket.
    - Throw in a budget to prevent nasty surprises.
- Init "silver-hand" directory for Kubernetes manifests to be used with the local K3s cluster.
    - Datashim manifest to facilitate abstracted interaction with S3 bucket.
    - Kubernetes-dashboard to visualize cluster state.
    - Jafner-dev to serve contents of S3 bucket.
2024-08-07 16:23:20 -07:00

62 lines
1.0 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: jafner-dev
---
apiVersion: datashim.io/v1alpha1
kind: Dataset
metadata:
namespace: jafner-dev
name: jafner-dev
spec:
local:
type: "COS"
secret-name: jafner-dev-aws-credentials
endpoint: "https://s3.us-west-2.amazonaws.com"
bucket: "jafner-dev"
region: "us-west-2"
---
apiVersion: v1
kind: Pod
metadata:
namespace: jafner-dev
name: nginx
labels:
app: jafner-dev
dataset.0.id: "jafner-dev"
dataset.0.useas: "mount"
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: "jafner-dev"
volumes:
- name: "jafner-dev"
persistentVolumeClaim:
claimName: "jafner-dev"
---
apiVersion: v1
kind: Service
metadata:
namespace: jafner-dev
name: nginx-service
spec:
type: LoadBalancer
selector:
app: jafner-dev
ports:
- port: 8080
targetPort: 80
# Access at:
# - http://192.168.1.31:8080
# - http://192.168.1.32:8080
# - http://192.168.1.33:8080