diff --git a/apps/kustomization.yaml b/apps/kustomization.yaml new file mode 100644 index 0000000..7f01f40 --- /dev/null +++ b/apps/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- whoami \ No newline at end of file diff --git a/apps/whoami/deployment.yaml b/apps/whoami/deployment.yaml new file mode 100644 index 0000000..cdb857a --- /dev/null +++ b/apps/whoami/deployment.yaml @@ -0,0 +1,80 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: podinfo +spec: + minReadySeconds: 3 + revisionHistoryLimit: 5 + progressDeadlineSeconds: 60 + strategy: + rollingUpdate: + maxUnavailable: 0 + type: RollingUpdate + selector: + matchLabels: + app: podinfo + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9797" + labels: + app: podinfo + spec: + containers: + - name: podinfod + image: ghcr.io/stefanprodan/podinfo:6.7.0 + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 9898 + protocol: TCP + - name: http-metrics + containerPort: 9797 + protocol: TCP + - name: grpc + containerPort: 9999 + protocol: TCP + command: + - ./podinfo + - --port=9898 + - --port-metrics=9797 + - --grpc-port=9999 + - --grpc-service-name=podinfo + - --level=info + - --random-delay=false + - --random-error=false + env: + - name: PODINFO_UI_COLOR + value: "#34577c" + livenessProbe: + exec: + command: + - podcli + - check + - http + - localhost:9898/healthz + initialDelaySeconds: 5 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - podcli + - check + - http + - localhost:9898/readyz + initialDelaySeconds: 5 + timeoutSeconds: 5 + resources: + limits: + cpu: 2000m + memory: 512Mi + requests: + cpu: 100m + memory: 64Mi + volumeMounts: + - name: data + mountPath: /data + volumes: + - name: data + emptyDir: {} \ No newline at end of file diff --git a/apps/whoami/ingress.yaml b/apps/whoami/ingress.yaml new file mode 100644 index 0000000..497e4ea --- /dev/null +++ b/apps/whoami/ingress.yaml @@ -0,0 +1,13 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: podinfo +spec: + entryPoints: + - web + routes: + - match: Host(`podinfo.k3s`) + kind: Rule + services: + - name: podinfo + namespace: default \ No newline at end of file diff --git a/apps/whoami/kustomization.yaml b/apps/whoami/kustomization.yaml new file mode 100644 index 0000000..6421176 --- /dev/null +++ b/apps/whoami/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- deployment.yaml +- service.yaml +- ingress.yaml diff --git a/apps/whoami/service.yaml b/apps/whoami/service.yaml new file mode 100644 index 0000000..0d26eca --- /dev/null +++ b/apps/whoami/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: podinfo +spec: + type: ClusterIP + selector: + app: podinfo + ports: + - name: http + port: 9898 + protocol: TCP + targetPort: http + - port: 9999 + targetPort: grpc + protocol: TCP + name: grpc \ No newline at end of file diff --git a/clusters/kairos/apps-kustomization.yaml b/clusters/kairos/apps-kustomization.yaml new file mode 100644 index 0000000..af0683a --- /dev/null +++ b/clusters/kairos/apps-kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: flux-system + namespace: flux-system +spec: + interval: 10m0s + path: ./apps + prune: true + sourceRef: + kind: GitRepository + name: flux-system diff --git a/readme.md b/readme.md index 2f10a35..38648cf 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,8 @@ # Kairos +Kairos automatically includes Traefik + - Grab the latest image from https://github.com/kairos-io/kairos/releases, the image should have the format `kairos-debian-bookworm-standard-amd64-generic-v3.1.1-k3sv1.30.2+k3s1`. The main things we're looking for are the latest debian, standard, amd64, then the versions of kairos (v3.1.1) and k3s (1.30.2). - Burn to usb @@ -25,4 +27,4 @@ Host 192.168.1.101 ## Flux CD -- `flux bootstrap git --private-key-file=/config/.ssh/kairos --url ssh://git@gitea.home.joemonk.co.uk:2222/joe/gitops.git --branch main --path=clusters/kairos` +- `flux bootstrap git --private-key-file=/config/.ssh/gitea --url ssh://git@gitea.home.joemonk.co.uk:2222/joe/gitops.git --branch main --path=clusters/kairos`