mirror of
https://github.com/morten-olsen/homelab-operator.git
synced 2026-02-08 01:36:28 +01:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfc7d13b99 | ||
|
|
fee900fa72 | ||
|
|
9928f908a0 | ||
|
|
d091f3030b | ||
|
|
44ead050c7 | ||
|
|
c5a15ed5d4 | ||
|
|
a27dd320e6 | ||
|
|
0c53bf72e4 | ||
|
|
b8c7930650 | ||
|
|
eae83bf0dd | ||
|
|
42cc50948d | ||
|
|
ff06613e99 | ||
|
|
9fe279b1b5 | ||
|
|
63e0ef0909 | ||
|
|
a44e3cb2be | ||
|
|
8f5e148bb2 | ||
|
|
21262705a7 |
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@@ -55,10 +55,12 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
working-directory: images/operator
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Run tests
|
||||
working-directory: images/operator
|
||||
run: pnpm test
|
||||
|
||||
update-release-draft:
|
||||
@@ -82,7 +84,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -90,4 +92,4 @@ jobs:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./operator.yaml
|
||||
asset_name: operator.yaml
|
||||
asset_content_type: application/yaml
|
||||
asset_content_type: application/yaml
|
||||
|
||||
65
.github/workflows/publish-backup-tag.yml
vendored
Normal file
65
.github/workflows/publish-backup-tag.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Publish tag
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
env:
|
||||
environment: test
|
||||
release_channel: latest
|
||||
DO_NOT_TRACK: "1"
|
||||
NODE_VERSION: "23.x"
|
||||
DOCKER_REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}-backup
|
||||
PNPM_VERSION: 10.6.0
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
|
||||
jobs:
|
||||
release:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
attestations: write
|
||||
id-token: write
|
||||
pages: write
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.DOCKER_REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: ./images/backup
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
- name: Generate artifact attestation
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-name: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME}}
|
||||
subject-digest: ${{ steps.push.outputs.digest }}
|
||||
push-to-registry: true
|
||||
6
.github/workflows/publish-tag.yml
vendored
6
.github/workflows/publish-tag.yml
vendored
@@ -3,7 +3,7 @@ name: Publish tag
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- "main"
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
id: push
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
context: ./images/operator
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -62,4 +62,4 @@ jobs:
|
||||
with:
|
||||
subject-name: ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME}}
|
||||
subject-digest: ${{ steps.push.outputs.digest }}
|
||||
push-to-registry: true
|
||||
push-to-registry: true
|
||||
|
||||
38
.gitignore
vendored
38
.gitignore
vendored
@@ -1,38 +1,2 @@
|
||||
# dependencies (bun install)
|
||||
node_modules
|
||||
|
||||
# output
|
||||
out
|
||||
dist
|
||||
*.tgz
|
||||
|
||||
# code coverage
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# logs
|
||||
logs
|
||||
_.log
|
||||
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# caches
|
||||
.eslintcache
|
||||
.cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# IntelliJ based IDEs
|
||||
.idea
|
||||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
/secret.*.yaml
|
||||
/data/
|
||||
|
||||
/cloudflare.yaml
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
3.13
|
||||
BIN
assets/2025-09-06-12-29-07.png
Normal file
BIN
assets/2025-09-06-12-29-07.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
BIN
assets/2025-09-06-12-29-15.png
Normal file
BIN
assets/2025-09-06-12-29-15.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
BIN
assets/2025-09-06-12-29-26.png
Normal file
BIN
assets/2025-09-06-12-29-26.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
136
charts/apps/AGENT.md
Normal file
136
charts/apps/AGENT.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# Agent Documentation
|
||||
|
||||
This document describes how to create a new application chart for the homelab operator.
|
||||
|
||||
## Chart Structure
|
||||
|
||||
Each application has its own chart located in a directory under `charts/apps`. The chart should contain the following files:
|
||||
|
||||
- `Chart.yaml`: The chart metadata.
|
||||
- `values.yaml`: The default values for the chart.
|
||||
- `templates/`: A directory containing the Kubernetes resource templates.
|
||||
|
||||
## Custom Resources
|
||||
|
||||
The homelab operator uses several custom resources to manage applications. These resources are defined in the `templates` directory of the chart.
|
||||
|
||||
### `PostgresDatabase`
|
||||
|
||||
If the application requires a PostgreSQL database, you can create a `PostgresDatabase` resource. The operator will automatically create a database and a secret containing the connection details. The secret will have the same name as the release with a `-pg-connection` postfix.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
# templates/database.yaml
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: PostgresDatabase
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
```
|
||||
|
||||
The secret has the following values:
|
||||
|
||||
- `database`: name of the created database
|
||||
- `host`: the hostname of the postgres server
|
||||
- `port`: the port of the postgres server
|
||||
- `url`: combined url in the format `postgresql://{user}:{password}@{host}:{port}/{database}`
|
||||
|
||||
### `OidcClient`
|
||||
|
||||
If the application requires OIDC authentication, you can create an `OidcClient` resource. The operator will automatically create an OIDC client and a secret containing the client ID and secret. The secret will have the same name as the release with a `-client` postfix.
|
||||
|
||||
You need to specify the redirect URIs for the OIDC client. The subdomain is taken from the `values.yaml` file.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
# templates/client.yaml
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
redirectUris:
|
||||
- path: /user/oauth2/Authentik/callback
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
matchingMode: strict
|
||||
```
|
||||
|
||||
The secret has the following value:
|
||||
|
||||
- `authorization`: Authorization endpoint
|
||||
- `clientId`
|
||||
- `clientSecret`
|
||||
- `configuration`: autodiscovery endpoint
|
||||
- `configurationIssuer`: issuer url
|
||||
- `endSession`: end session endpoint
|
||||
- `jwks`: jwks endpoint
|
||||
- `token`: token endpoint
|
||||
- `userinfo`: user info endpoint
|
||||
|
||||
### `HttpService` and `ExternalHttpService`
|
||||
|
||||
To expose the application, you can use either an `HttpService` or an `ExternalHttpService` resource.
|
||||
|
||||
- `HttpService`: This will expose the application through the Istio gateway. This is for internal access only.
|
||||
- `ExternalHttpService`: This will expose the application through a CloudFlare tunnel. This is for external access.
|
||||
|
||||
Both resources take a `subdomain` and a `destination` as parameters. The `destination` is the Kubernetes service to route traffic to.
|
||||
|
||||
Example of `HttpService`:
|
||||
|
||||
```yaml
|
||||
# templates/http-service.yaml
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
```
|
||||
|
||||
Example of `ExternalHttpService`:
|
||||
|
||||
```yaml
|
||||
# templates/external-http-service.yaml
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
```
|
||||
|
||||
## `values.yaml`
|
||||
|
||||
The `values.yaml` file should contain the following values:
|
||||
|
||||
- `globals.environment`: The environment the application is running in (e.g., `prod`, `dev`).
|
||||
- `image.repository`: The Docker image repository.
|
||||
- `image.tag`: The Docker image tag.
|
||||
- `subdomain`: The subdomain for the application.
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
# values.yaml
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: docker.gitea.com/gitea
|
||||
tag: latest
|
||||
subdomain: gitea
|
||||
```
|
||||
@@ -6,5 +6,5 @@ spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
redirectUris:
|
||||
- path: /api/auth/oidc/callback
|
||||
subdomain: bytestash
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
matchingMode: strict
|
||||
|
||||
3
charts/apps/coder/Chart.yaml
Normal file
3
charts/apps/coder/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: openwebui
|
||||
10
charts/apps/coder/templates/client.yaml
Normal file
10
charts/apps/coder/templates/client.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
redirectUris:
|
||||
- path: /api/v2/users/oidc/callback
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
matchingMode: strict
|
||||
73
charts/apps/coder/templates/deployment.yaml
Normal file
73
charts/apps/coder/templates/deployment.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: '{{ .Release.Name }}'
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
serviceAccountName: '{{ .Release.Name }}-serviceaccount'
|
||||
containers:
|
||||
- name: '{{ .Release.Name }}'
|
||||
image: '{{ .Values.image.repository }}:{{ .Values.image.tag }}'
|
||||
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 7080
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /home/coder/.config
|
||||
name: data
|
||||
env:
|
||||
- name: CODER_HTTP_ADDRESS
|
||||
value: '0.0.0.0:7080'
|
||||
- name: CODER_OIDC_ALLOWED_GROUPS
|
||||
value: admin
|
||||
- name: CODER_OIDC_GROUP_FIELD
|
||||
value: groups
|
||||
- name: CODER_ACCESS_URL
|
||||
value: https://coder.olsen.cloud
|
||||
- name: CODER_OIDC_ICON_URL
|
||||
value: https://authentik.olsen.cloud/static/dist/assets/icons/icon.png
|
||||
- name: CODER_DISABLE_PASSWORD_AUTH
|
||||
value: 'true'
|
||||
- name: CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS
|
||||
value: 'false'
|
||||
- name: CODER_OIDC_SIGN_IN_TEXT
|
||||
value: 'Sign in with OIDC'
|
||||
- name: CODER_OIDC_SCOPES
|
||||
value: openid,profile,email,offline_access
|
||||
- name: CODER_OIDC_ISSUER_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: configurationIssuer
|
||||
- name: CODER_OIDC_CLIENT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: clientId
|
||||
- name: CODER_OIDC_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: clientSecret
|
||||
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: '{{ .Release.Name }}-data'
|
||||
11
charts/apps/coder/templates/http-service.yaml
Normal file
11
charts/apps/coder/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/coder/templates/pvc.yaml
Normal file
11
charts/apps/coder/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-data'
|
||||
spec:
|
||||
accessModes:
|
||||
- 'ReadWriteOnce'
|
||||
resources:
|
||||
requests:
|
||||
storage: '1Gi'
|
||||
storageClassName: '{{ .Values.globals.environment }}'
|
||||
21
charts/apps/coder/templates/role.yaml
Normal file
21
charts/apps/coder/templates/role.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-workspace-creator'
|
||||
rules:
|
||||
- apiGroups: [''] # "" indicates the core API group (for Pods, PVCs, Services)
|
||||
resources: ['pods', 'pods/exec', 'pods/log', 'persistentvolumeclaims', 'services']
|
||||
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
|
||||
- apiGroups: ['apps'] # For Deployments, StatefulSets
|
||||
resources: ['deployments', 'statefulsets']
|
||||
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
|
||||
- apiGroups: ['networking.k8s.io'] # For Ingresses
|
||||
resources: ['ingresses']
|
||||
verbs: ['get', 'list', 'watch', 'create', 'update', 'patch', 'delete']
|
||||
- apiGroups: ['events.k8s.io'] # For events related to workspace activity
|
||||
resources: ['events']
|
||||
verbs: ['create', 'patch', 'update'] # Coder might create events for workspace lifecycle
|
||||
# Add any other resources that Coder workspace templates might create (e.g., secrets, configmaps)
|
||||
# - apiGroups: [""]
|
||||
# resources: ["secrets", "configmaps"]
|
||||
# verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
||||
13
charts/apps/coder/templates/rolebinding.yaml
Normal file
13
charts/apps/coder/templates/rolebinding.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-workspace-creator-binding'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: '{{ .Release.Name }}-serviceaccount'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
roleRef:
|
||||
kind: ClusterRole
|
||||
name: '{{ .Release.Name }}-workspace-creator'
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
15
charts/apps/coder/templates/service.yaml
Normal file
15
charts/apps/coder/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 7080
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
5
charts/apps/coder/templates/serviceaccount.yaml
Normal file
5
charts/apps/coder/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-serviceaccount'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
7
charts/apps/coder/values.yaml
Normal file
7
charts/apps/coder/values.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: ghcr.io/coder/coder
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: coder
|
||||
@@ -1,3 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: root
|
||||
name: gitea
|
||||
36
charts/apps/gitea/templates/_runner-deployment.yaml
Normal file
36
charts/apps/gitea/templates/_runner-deployment.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-runner'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}-runner'
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: '{{ .Release.Name }}-runner'
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: '{{ .Release.Name }}-runner'
|
||||
spec:
|
||||
containers:
|
||||
- name: '{{ .Release.Name }}-runner'
|
||||
image: docker.io/gitea/act_runner:latest-dind-rootless
|
||||
env:
|
||||
- name: GITEA_INSTANCE_URL
|
||||
value: '{{ .Release.Name }}'
|
||||
- name: GITEA_RUNNER_NAME
|
||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-runner'
|
||||
key: registration_token
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://localhost:2376
|
||||
- name: DOCKER_CERT_PATH
|
||||
value: /certs/client
|
||||
- name: DOCKER_TLS_VERIFY
|
||||
value: '1'
|
||||
securityContext:
|
||||
privileged: true
|
||||
10
charts/apps/gitea/templates/client.yaml
Normal file
10
charts/apps/gitea/templates/client.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
redirectUris:
|
||||
- path: /user/oauth2/Authentik/callback
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
matchingMode: strict
|
||||
6
charts/apps/gitea/templates/database.yaml
Normal file
6
charts/apps/gitea/templates/database.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: PostgresDatabase
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
101
charts/apps/gitea/templates/deployment.yaml
Normal file
101
charts/apps/gitea/templates/deployment.yaml
Normal file
@@ -0,0 +1,101 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
containers:
|
||||
- name: "{{ .Release.Name }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 3000
|
||||
protocol: TCP
|
||||
- name: ssh
|
||||
containerPort: 22
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: data
|
||||
env:
|
||||
- name: TZ
|
||||
value: "{{ .Values.globals.timezone }}"
|
||||
- name: USER_UID
|
||||
value: "1000"
|
||||
- name: USER_GID
|
||||
value: "1000"
|
||||
- name: GITEA__server__SSH_DOMAIN
|
||||
value: gitea-ssh.olsen.cloud
|
||||
- name: GITEA__service__REQUIRE_EXTERNAL_REGISTRATION_PASSWORD
|
||||
value: "true"
|
||||
#- name: GITEA__service__ENABLE_BASIC_AUTHENTICATION
|
||||
# value: 'true'
|
||||
- name: GITEA__service__ENABLE_PASSWORD_SIGNIN_FORM
|
||||
value: "false"
|
||||
- name: GITEA__service__DEFAULT_KEEP_EMAIL_PRIVATE
|
||||
value: "true"
|
||||
- name: GITEA__service__DEFAULT_USER_IS_RESTRICTED
|
||||
value: "true"
|
||||
- name: GITEA__service__DEFAULT_USER_VISIBILITY
|
||||
value: "private"
|
||||
- name: GITEA__service__DEFAULT_ORG_VISIBILITY
|
||||
value: "private"
|
||||
- name: GITEA__service__ALLOW_ONLY_EXTERNAL_REGISTRATION
|
||||
value: "true"
|
||||
- name: GITEA__other__SHOW_FOOTER_POWERED_BY
|
||||
value: "false"
|
||||
- name: GITEA__other__SHOW_FOOTER_TEMPLATE_LOAD_TIME
|
||||
value: "false"
|
||||
- name: GITEA__other__SHOW_FOOTER_VERSION
|
||||
value: "false"
|
||||
- name: GITEA__repository__ENABLE_PUSH_CREATE_USER
|
||||
value: "true"
|
||||
- name: GITEA__repository__ENABLE_PUSH_CREATE_ORG
|
||||
value: "true"
|
||||
- name: GITEA__openid__ENABLE_OPENID_SIGNIN
|
||||
value: "false"
|
||||
- name: GITEA__openid__ENABLE_OPENID_SIGNUP
|
||||
value: "false"
|
||||
- name: GITEA__database__DB_TYPE
|
||||
value: postgres
|
||||
- name: GITEA__database__NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-pg-connection"
|
||||
key: database
|
||||
- name: GITEA__database__HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-pg-connection"
|
||||
key: host
|
||||
- name: GITEA__database__USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-pg-connection"
|
||||
key: user
|
||||
- name: GITEA__database__PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-pg-connection"
|
||||
key: password
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-data"
|
||||
11
charts/apps/gitea/templates/external-http-service.yaml
Normal file
11
charts/apps/gitea/templates/external-http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/gitea/templates/pvc.yaml
Normal file
11
charts/apps/gitea/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-data'
|
||||
spec:
|
||||
accessModes:
|
||||
- 'ReadWriteOnce'
|
||||
resources:
|
||||
requests:
|
||||
storage: '1Gi'
|
||||
storageClassName: '{{ .Values.globals.environment }}'
|
||||
32
charts/apps/gitea/templates/service.yaml
Normal file
32
charts/apps/gitea/templates/service.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 3000
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-ssh'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 2202
|
||||
targetPort: 22
|
||||
protocol: TCP
|
||||
name: ssh
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
8
charts/apps/gitea/values.yaml
Normal file
8
charts/apps/gitea/values.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
globals:
|
||||
environment: prod
|
||||
timezone: Europe/Amsterdam
|
||||
image:
|
||||
repository: docker.gitea.com/gitea
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: gitea
|
||||
3
charts/apps/harbor/Chart.yaml
Normal file
3
charts/apps/harbor/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: monitoring
|
||||
38
charts/apps/harbor/templates/helm.yaml
Normal file
38
charts/apps/harbor/templates/helm.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://helm.goharbor.io
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: harbor
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: '{{ .Release.Name }}'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
interval: 1h
|
||||
values:
|
||||
persistence:
|
||||
persistentVolumeClaim:
|
||||
registry:
|
||||
storageClass: '{{ .Values.globals.environment }}'
|
||||
jobservice:
|
||||
jobLog:
|
||||
storageClass: '{{ .Values.globals.environment }}'
|
||||
database:
|
||||
storageClass: '{{ .Values.globals.environment }}'
|
||||
redis:
|
||||
storageClass: '{{ .Values.globals.environment }}'
|
||||
trivy:
|
||||
storageClass: '{{ .Values.globals.environment }}'
|
||||
11
charts/apps/harbor/templates/http-service.yaml
Normal file
11
charts/apps/harbor/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
3
charts/apps/harbor/values.yaml
Normal file
3
charts/apps/harbor/values.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
globals:
|
||||
environment: prod
|
||||
subdomain: harbor
|
||||
3
charts/apps/headscale/Chart.yaml
Normal file
3
charts/apps/headscale/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: headscale
|
||||
10
charts/apps/headscale/templates/client.yaml
Normal file
10
charts/apps/headscale/templates/client.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
redirectUris:
|
||||
- path: /oidc/callback
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
matchingMode: strict
|
||||
70
charts/apps/headscale/templates/config-map.yaml
Normal file
70
charts/apps/headscale/templates/config-map.yaml
Normal file
@@ -0,0 +1,70 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-config-template'
|
||||
data:
|
||||
config.yaml.template: |
|
||||
server_url: ${PUBLIC_URL}
|
||||
listen_addr: 0.0.0.0:8080
|
||||
metrics_listen_addr: 0.0.0.0:9090
|
||||
grpc_listen_addr: 0.0.0.0:50443
|
||||
|
||||
private_key_path: /var/lib/headscale/private_key # Path inside the container
|
||||
|
||||
noise:
|
||||
private_key_path: /var/lib/headscale/noise_private_key # Path inside the container
|
||||
|
||||
listen_routes: false
|
||||
base_domain: "${PUBLIC_URL}" # For client routes and DNS push.
|
||||
|
||||
derp:
|
||||
server:
|
||||
enabled: false
|
||||
region_id: 999
|
||||
region_code: "headscale"
|
||||
region_name: "Headscale Embedded DERP"
|
||||
stun_listen_addr: "0.0.0.0:3478"
|
||||
automatically_add_embedded_derp_region: true
|
||||
urls:
|
||||
- https://controlplane.tailscale.com/derpmap/default
|
||||
auto_update_enabled: true
|
||||
update_frequency: 24h
|
||||
|
||||
oidc:
|
||||
enabled: true
|
||||
only_start_if_oidc_is_available: true
|
||||
issuer: "${OIDC_ISSUER_URL}"
|
||||
client_id: "${OIDC_CLIENT_ID}"
|
||||
client_secret: "${OIDC_CLIENT_SECRET}"
|
||||
scopes: ["openid", "profile", "email"]
|
||||
redirect_url: "${PUBLIC_URL}/oidc/callback"
|
||||
pkce:
|
||||
enabled: true
|
||||
method: S256
|
||||
|
||||
|
||||
# DNS configuration
|
||||
dns:
|
||||
magic_dns: false
|
||||
override_local_dns: true # Push Headscale's DNS settings to clients
|
||||
ttl: 60
|
||||
nameservers:
|
||||
global:
|
||||
- 1.1.1.1 # Cloudflare DNS
|
||||
#- 10.43.0.10 # Replace with your ClusterIP for kube-dns/CoreDNS
|
||||
# Domains to search for (e.g., for Kubernetes services)
|
||||
search_domains:
|
||||
- svc.cluster.local
|
||||
- cluster.local
|
||||
|
||||
auto_create_users: true
|
||||
|
||||
oidc_user_property: preferred_username # Or 'email' or 'sub'
|
||||
|
||||
prefixes:
|
||||
v4: 10.20.20.0/24 # Example: A /24 subnet for your VPN clients
|
||||
|
||||
database:
|
||||
type: sqlite
|
||||
sqlite:
|
||||
path: /var/lib/headscale/db.sqlite
|
||||
97
charts/apps/headscale/templates/deployment.yaml
Normal file
97
charts/apps/headscale/templates/deployment.yaml
Normal file
@@ -0,0 +1,97 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: '{{ .Release.Name }}'
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
# To expose WireGuard UDP directly, we need a NodePort service.
|
||||
# The Pod needs to be aware of the external port it's being exposed on.
|
||||
# The easiest way to get WireGuard to listen on the correct port and make it
|
||||
# externally accessible is to use `hostNetwork: true` for the UDP component,
|
||||
# or by directly specifying the listen port in Headscale config if the NodePort is stable.
|
||||
|
||||
# OPTION 1: Best for simple homelab on bare metal where host network traffic isn't an issue
|
||||
# hostNetwork: true # This makes the pod listen directly on the node's IPs
|
||||
# dnsPolicy: ClusterFirstWithHostNet # Required if using hostNetwork
|
||||
|
||||
initContainers:
|
||||
- name: generate-config
|
||||
image: alpine/git # A small image with 'envsubst' available or easily installable
|
||||
imagePullPolicy: IfNotPresent
|
||||
command: ['sh', '-c']
|
||||
args:
|
||||
- |
|
||||
# Install envsubst if it's not present (alpine/git may not have it by default)
|
||||
apk update && apk add bash gettext
|
||||
|
||||
# Substitute environment variables into the template
|
||||
# The vars are passed via `env` section below
|
||||
envsubst < /config-template/config.yaml.template > /etc/headscale/config.yaml
|
||||
|
||||
mkdir -p /etc/headscale
|
||||
# Optional: Verify the generated config
|
||||
echo "--- Generated Headscale Configuration ---"
|
||||
cat /etc/headscale/config.yaml
|
||||
echo "---------------------------------------"
|
||||
env:
|
||||
# These are the variables that `envsubst` will look for and replace
|
||||
- name: PUBLIC_URL
|
||||
value: 'https://{{ .Values.subdomain }}.olsen.cloud'
|
||||
- name: OIDC_ISSUER_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: configurationIssuer
|
||||
- name: OIDC_CLIENT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: clientId
|
||||
- name: OIDC_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-client'
|
||||
key: clientSecret
|
||||
# Add any other variables used in config.yaml.template here
|
||||
volumeMounts:
|
||||
- name: config-template
|
||||
mountPath: /config-template # Mount the ConfigMap as a volume
|
||||
readOnly: true
|
||||
- name: headscale-config
|
||||
mountPath: /etc/headscale # Destination for the generated config
|
||||
|
||||
containers:
|
||||
- name: '{{ .Release.Name }}'
|
||||
image: headscale/headscale:latest # Use the official image
|
||||
command: ['headscale', 'serve']
|
||||
ports:
|
||||
- name: http-api
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
- name: wireguard-udp
|
||||
containerPort: 41641
|
||||
protocol: UDP
|
||||
volumeMounts:
|
||||
- name: headscale-data
|
||||
mountPath: /var/lib/headscale
|
||||
- name: headscale-config
|
||||
mountPath: /etc/headscale
|
||||
volumes:
|
||||
- name: config-template
|
||||
configMap:
|
||||
name: '{{ .Release.Name }}-config-template'
|
||||
- name: headscale-config
|
||||
emptyDir: {}
|
||||
- name: headscale-data
|
||||
persistentVolumeClaim:
|
||||
claimName: '{{ .Release.Name }}-data'
|
||||
11
charts/apps/headscale/templates/external-http-service.yaml
Normal file
11
charts/apps/headscale/templates/external-http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/headscale/templates/pvc.yaml
Normal file
11
charts/apps/headscale/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-data'
|
||||
spec:
|
||||
accessModes:
|
||||
- 'ReadWriteOnce'
|
||||
resources:
|
||||
requests:
|
||||
storage: '1Gi'
|
||||
storageClassName: '{{ .Values.globals.environment }}'
|
||||
32
charts/apps/headscale/templates/service.yaml
Normal file
32
charts/apps/headscale/templates/service.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8080
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-headscale'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- port: 41641
|
||||
targetPort: 41641
|
||||
protocol: UDP
|
||||
name: wireguard-udp
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
7
charts/apps/headscale/values.yaml
Normal file
7
charts/apps/headscale/values.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: headscale/headscale
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: headscale
|
||||
3
charts/apps/homarr/Chart.yaml
Normal file
3
charts/apps/homarr/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: openwebui
|
||||
10
charts/apps/homarr/templates/client.yaml
Normal file
10
charts/apps/homarr/templates/client.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
redirectUris:
|
||||
- path: /api/auth/callback/oidc
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
matchingMode: strict
|
||||
83
charts/apps/homarr/templates/deployment.yaml
Normal file
83
charts/apps/homarr/templates/deployment.yaml
Normal file
@@ -0,0 +1,83 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
containers:
|
||||
- name: "{{ .Release.Name }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 7575
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /appdata
|
||||
name: data
|
||||
env:
|
||||
- name: BASE_URL
|
||||
value: https://homarr.olsen.cloud # TODO
|
||||
|
||||
- name: NEXTAUTH_URL
|
||||
value: https://homarr.olsen.cloud
|
||||
|
||||
- name: AUTH_PROVIDERS
|
||||
value: oidc
|
||||
|
||||
- name: AUTH_OIDC_CLIENT_NAME
|
||||
value: Authentik
|
||||
|
||||
- name: AUTH_OIDC_SCOPE_OVERWRITE
|
||||
value: openid email profile
|
||||
|
||||
- name: AUTH_OIDC_GROUPS_ATTRIBUTE
|
||||
value: groups
|
||||
|
||||
- name: AUTH_OIDC_AUTO_LOGIN
|
||||
value: "true"
|
||||
|
||||
- name: SECRET_ENCRYPTION_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-secrets"
|
||||
key: encryptionkey
|
||||
|
||||
- name: AUTH_OIDC_ISSUER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: configurationIssuer
|
||||
|
||||
- name: AUTH_OIDC_CLIENT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: clientId
|
||||
|
||||
- name: AUTH_OIDC_CLIENT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: clientSecret
|
||||
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-data"
|
||||
11
charts/apps/homarr/templates/external-http-service.yaml
Normal file
11
charts/apps/homarr/templates/external-http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/homarr/templates/http-service.yaml
Normal file
11
charts/apps/homarr/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/homarr/templates/pvc.yaml
Normal file
11
charts/apps/homarr/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-data'
|
||||
spec:
|
||||
accessModes:
|
||||
- 'ReadWriteOnce'
|
||||
resources:
|
||||
requests:
|
||||
storage: '1Gi'
|
||||
storageClassName: '{{ .Values.globals.environment }}'
|
||||
9
charts/apps/homarr/templates/secret.yaml
Normal file
9
charts/apps/homarr/templates/secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: GenerateSecret
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-secrets"
|
||||
spec:
|
||||
fields:
|
||||
- name: encryptionkey
|
||||
encoding: hex
|
||||
length: 64
|
||||
15
charts/apps/homarr/templates/service.yaml
Normal file
15
charts/apps/homarr/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 7575
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: "{{ .Release.Name }}"
|
||||
7
charts/apps/homarr/values.yaml
Normal file
7
charts/apps/homarr/values.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: ghcr.io/homarr-labs/homarr
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: homarr
|
||||
3
charts/apps/home-assistant/Chart.yaml
Normal file
3
charts/apps/home-assistant/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: home-assistant
|
||||
44
charts/apps/home-assistant/templates/deployment.yaml
Normal file
44
charts/apps/home-assistant/templates/deployment.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
hostNetwork: true
|
||||
|
||||
containers:
|
||||
- name: "{{ .Release.Name }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
env:
|
||||
- name: TZ
|
||||
value: "{{ .Values.globals.timezone }}"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8123
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /config
|
||||
name: config
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-config"
|
||||
11
charts/apps/home-assistant/templates/http-service.yaml
Normal file
11
charts/apps/home-assistant/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/home-assistant/templates/pvc.yaml
Normal file
11
charts/apps/home-assistant/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-config"
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "1Gi"
|
||||
storageClassName: "{{ .Values.globals.environment }}"
|
||||
15
charts/apps/home-assistant/templates/service.yaml
Normal file
15
charts/apps/home-assistant/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8123
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: "{{ .Release.Name }}"
|
||||
8
charts/apps/home-assistant/values.yaml
Normal file
8
charts/apps/home-assistant/values.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
globals:
|
||||
environment: prod
|
||||
timezone: Europe/Amsterdam
|
||||
image:
|
||||
repository: ghcr.io/home-assistant/home-assistant
|
||||
tag: stable
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: home-assistant
|
||||
3
charts/apps/metamcp/Chart.yaml
Normal file
3
charts/apps/metamcp/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: metamcp
|
||||
6
charts/apps/metamcp/templates/database.yaml
Normal file
6
charts/apps/metamcp/templates/database.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: PostgresDatabase
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
79
charts/apps/metamcp/templates/deployment.yaml
Normal file
79
charts/apps/metamcp/templates/deployment.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: '{{ .Release.Name }}'
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
containers:
|
||||
- name: '{{ .Release.Name }}'
|
||||
image: '{{ .Values.image.repository }}:{{ .Values.image.tag }}'
|
||||
imagePullPolicy: '{{ .Values.image.pullPolicy }}'
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 12008
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: data
|
||||
env:
|
||||
- name: TZ
|
||||
value: '{{ .Values.globals.timezone }}'
|
||||
- name: APP_URL
|
||||
value: https://metamcp.olsen.cloud # TODO: Change
|
||||
- name: NEXT_PUBLIC_APP_URL
|
||||
value: https://metamcp.olsen.cloud # TODO: Change
|
||||
- name: BETTER_AUTH_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-secrets'
|
||||
key: betterauth
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: url
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: database
|
||||
- name: POSTGRES_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: host
|
||||
- name: POSTGRES_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: port
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: user
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: '{{ .Release.Name }}-pg-connection'
|
||||
key: password
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: '{{ .Release.Name }}-data'
|
||||
11
charts/apps/metamcp/templates/external-http-service.yaml
Normal file
11
charts/apps/metamcp/templates/external-http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/metamcp/templates/pvc.yaml
Normal file
11
charts/apps/metamcp/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-data'
|
||||
spec:
|
||||
accessModes:
|
||||
- 'ReadWriteOnce'
|
||||
resources:
|
||||
requests:
|
||||
storage: '1Gi'
|
||||
storageClassName: '{{ .Values.globals.environment }}'
|
||||
9
charts/apps/metamcp/templates/secret.yaml
Normal file
9
charts/apps/metamcp/templates/secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: GenerateSecret
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-secrets'
|
||||
spec:
|
||||
fields:
|
||||
- name: betterauth
|
||||
encoding: base64
|
||||
length: 64
|
||||
15
charts/apps/metamcp/templates/service.yaml
Normal file
15
charts/apps/metamcp/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
labels:
|
||||
app: '{{ .Release.Name }}'
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 12008
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: '{{ .Release.Name }}'
|
||||
8
charts/apps/metamcp/values.yaml
Normal file
8
charts/apps/metamcp/values.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
globals:
|
||||
environment: prod
|
||||
timezone: Europe/Amsterdam
|
||||
image:
|
||||
repository: ghcr.io/metatool-ai/metamcp
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: metamcp
|
||||
3
charts/apps/music-assistant/Chart.yaml
Normal file
3
charts/apps/music-assistant/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: music-assistant
|
||||
44
charts/apps/music-assistant/templates/deployment.yaml
Normal file
44
charts/apps/music-assistant/templates/deployment.yaml
Normal file
@@ -0,0 +1,44 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
hostNetwork: true
|
||||
|
||||
containers:
|
||||
- name: "{{ .Release.Name }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8095
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: data
|
||||
securityContext:
|
||||
capabilities:
|
||||
add:
|
||||
- SYS_ADMIN
|
||||
- DAC_READ_SEARCH
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-data"
|
||||
11
charts/apps/music-assistant/templates/http-service.yaml
Normal file
11
charts/apps/music-assistant/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/music-assistant/templates/pvc.yaml
Normal file
11
charts/apps/music-assistant/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-data"
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "1Gi"
|
||||
storageClassName: "{{ .Values.globals.environment }}"
|
||||
15
charts/apps/music-assistant/templates/service.yaml
Normal file
15
charts/apps/music-assistant/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8095
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: "{{ .Release.Name }}"
|
||||
7
charts/apps/music-assistant/values.yaml
Normal file
7
charts/apps/music-assistant/values.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: ghcr.io/music-assistant/server
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: music-assistant
|
||||
3
charts/apps/photoprism/Chart.yaml
Normal file
3
charts/apps/photoprism/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: photoprism
|
||||
10
charts/apps/photoprism/templates/client.yaml
Normal file
10
charts/apps/photoprism/templates/client.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
redirectUris:
|
||||
- path: /api/v1/oidc/redirect
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
matchingMode: strict
|
||||
92
charts/apps/photoprism/templates/deployment.yaml
Normal file
92
charts/apps/photoprism/templates/deployment.yaml
Normal file
@@ -0,0 +1,92 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: "{{ .Release.Name }}"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
containers:
|
||||
- name: "{{ .Release.Name }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
|
||||
env:
|
||||
- name: PHOTOPRISM_UPLOAD_NSFW
|
||||
value: "true"
|
||||
- name: PHOTOPRISM_SITE_URL
|
||||
value: "https://{{ .Values.subdomain }}.olsen.cloud" #TODO
|
||||
# - name: PHOTOPRISM_UID
|
||||
# value: "1000"
|
||||
# - name: PHOTOPRISM_GID
|
||||
# value: "1000"
|
||||
# - name: PHOTOPRISM_DISABLE_CHOWN
|
||||
# value: "true"
|
||||
- name: PHOTOPRISM_AUTH_MODE
|
||||
value: password
|
||||
- name: PHOTOPRISM_DISABLE_TLS
|
||||
value: "false"
|
||||
- name: PHOTOPRISM_READONLY
|
||||
value: "false"
|
||||
- name: PHOTOPRISM_HTTP_COMPRESSION
|
||||
value: "gzip"
|
||||
|
||||
- name: PHOTOPRISM_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-secrets"
|
||||
key: password
|
||||
- name: PHOTOPRISM_OIDC_SCOPES
|
||||
value: "openid email profile offline_access"
|
||||
- name: PHOTOPRISM_OIDC_PROVIDER
|
||||
value: Authentik
|
||||
- name: PHOTOPRISM_OIDC_ICON
|
||||
value: https://cdn.jsdelivr.net/gh/selfhst/icons/png/authentik.png
|
||||
- name: PHOTOPRISM_OIDC_REGISTER
|
||||
value: "true"
|
||||
- name: PHOTOPRISM_OIDC_REDIRECT
|
||||
value: "false"
|
||||
- name: PHOTOPRISM_OIDC_CLIENT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: clientId
|
||||
- name: PHOTOPRISM_OIDC_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: clientSecret
|
||||
- name: PHOTOPRISM_OIDC_URI
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-client"
|
||||
key: configurationIssuer
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 2342
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: http
|
||||
volumeMounts:
|
||||
- mountPath: /photoprism/storage
|
||||
name: data
|
||||
- mountPath: /photoprism/originals
|
||||
name: originals
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ .Release.Name }}-data"
|
||||
- name: originals
|
||||
persistentVolumeClaim:
|
||||
claimName: pictures
|
||||
11
charts/apps/photoprism/templates/external-http-service.yaml
Normal file
11
charts/apps/photoprism/templates/external-http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: ExternalHttpService
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}'
|
||||
spec:
|
||||
environment: '{{ .Values.globals.environment }}'
|
||||
subdomain: '{{ .Values.subdomain }}'
|
||||
destination:
|
||||
host: '{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local'
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/photoprism/templates/http-service.yaml
Normal file
11
charts/apps/photoprism/templates/http-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
11
charts/apps/photoprism/templates/pvc.yaml
Normal file
11
charts/apps/photoprism/templates/pvc.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-data"
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "1Gi"
|
||||
storageClassName: "{{ .Values.globals.environment }}"
|
||||
9
charts/apps/photoprism/templates/secret.yaml
Normal file
9
charts/apps/photoprism/templates/secret.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: GenerateSecret
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-secrets"
|
||||
spec:
|
||||
fields:
|
||||
- name: password
|
||||
encoding: base64
|
||||
length: 64
|
||||
15
charts/apps/photoprism/templates/service.yaml
Normal file
15
charts/apps/photoprism/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}"
|
||||
labels:
|
||||
app: "{{ .Release.Name }}"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 2342
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: "{{ .Release.Name }}"
|
||||
7
charts/apps/photoprism/values.yaml
Normal file
7
charts/apps/photoprism/values.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
globals:
|
||||
environment: prod
|
||||
image:
|
||||
repository: photoprism/photoprism
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
subdomain: photoprism
|
||||
@@ -1,7 +1,12 @@
|
||||
{{- $values := .Values -}}
|
||||
{{- $release := .Release -}}
|
||||
|
||||
---
|
||||
{{- range $key, $value := $values.shares }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: books
|
||||
name: "{{$key}}"
|
||||
labels:
|
||||
type: nfs
|
||||
spec:
|
||||
@@ -10,19 +15,22 @@ spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: manual-books
|
||||
storageClassName: "manual-{{$key}}"
|
||||
nfs:
|
||||
path: '{{ .Values.books.path }}'
|
||||
server: '{{ .Values.host }}'
|
||||
path: "{{ $value.path }}"
|
||||
server: "{{ $values.host }}"
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: books
|
||||
name: "{{ $key }}"
|
||||
spec:
|
||||
storageClassName: manual-books
|
||||
storageClassName: "manual-{{ $key }}"
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
{{- end }}
|
||||
|
||||
16
charts/apps/volumes/values.yaml
Normal file
16
charts/apps/volumes/values.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
host: 192.168.20.106
|
||||
shares:
|
||||
movies:
|
||||
path: /mnt/HDD/Movies
|
||||
tvshows:
|
||||
path: /mnt/HDD/TV-Shows
|
||||
music:
|
||||
path: /mnt/HDD/Music2
|
||||
books:
|
||||
path: /mnt/HDD/Books
|
||||
podcasts:
|
||||
path: /mnt/HDD/Podcasts
|
||||
pictures:
|
||||
path: /mnt/HDD/Pictures
|
||||
backups:
|
||||
path: /mnt/HDD/Backups
|
||||
3
charts/backup/Chart.yaml
Normal file
3
charts/backup/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: backup
|
||||
48
charts/backup/templates/cron-job-backup.yaml
Normal file
48
charts/backup/templates/cron-job-backup.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
{{- $values := .Values -}}
|
||||
{{- $release := .Release -}}
|
||||
|
||||
---
|
||||
{{- range $key, $value := $values.jobs}}
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: "{{ $release.Name }}-{{ $key }}-backup"
|
||||
spec:
|
||||
schedule: "{{ $value.cron.backup }}"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
sidecar.istio.io/inject: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: "{{ $release.Name }}-{{ $key }}-backup"
|
||||
image: ghcr.io/morten-olsen/homelab-operator-backup:main
|
||||
imagePullPolicy: Always
|
||||
command: ["/app/backup.sh"]
|
||||
env:
|
||||
- name: RESTIC_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ $values.password.name }}"
|
||||
key: "{{ $values.password.key }}"
|
||||
volumeMounts:
|
||||
- name: source
|
||||
mountPath: "/mnt/source"
|
||||
- name: target
|
||||
mountPath: "/mnt/backup"
|
||||
subPath: "{{ $release.Name }}-{{ $key }}"
|
||||
volumes:
|
||||
- name: source
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ $value.source }}"
|
||||
- name: target
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ $values.target }}"
|
||||
restartPolicy: OnFailure
|
||||
---
|
||||
{{- end }}
|
||||
43
charts/backup/templates/cron-job-cleanup.yaml
Normal file
43
charts/backup/templates/cron-job-cleanup.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
{{- $values := .Values -}}
|
||||
{{- $release := .Release -}}
|
||||
|
||||
---
|
||||
{{- range $key, $value := $values.jobs}}
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: "{{ $release.Name }}-{{ $key }}-cleanup"
|
||||
spec:
|
||||
schedule: "{{ $value.cron.cleanup }}"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 3
|
||||
failedJobsHistoryLimit: 1
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
sidecar.istio.io/inject: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: "{{ $release.Name }}-{{ $key }}-cleanup"
|
||||
image: ghcr.io/morten-olsen/homelab-operator-backup:main
|
||||
imagePullPolicy: Always
|
||||
command: ["/app/cleanup.sh"]
|
||||
env:
|
||||
- name: RESTIC_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ $values.password.name }}"
|
||||
key: "{{ $values.password.key }}"
|
||||
volumeMounts:
|
||||
- name: target
|
||||
mountPath: "/mnt/backup"
|
||||
subPath: "{{ $release.Name }}-{{ $key }}"
|
||||
volumes:
|
||||
- name: target
|
||||
persistentVolumeClaim:
|
||||
claimName: "{{ $values.target }}"
|
||||
restartPolicy: OnFailure
|
||||
---
|
||||
{{- end }}
|
||||
10
charts/backup/values.yaml
Normal file
10
charts/backup/values.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
password:
|
||||
name: backup
|
||||
key: password
|
||||
jobs:
|
||||
pictures:
|
||||
cron:
|
||||
backup: "0 2 * * *"
|
||||
cleanup: "0 4 * * SUN"
|
||||
source: pictures
|
||||
target: backups
|
||||
3
charts/monitoring/Chart.yaml
Normal file
3
charts/monitoring/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: 1.0.0
|
||||
name: monitoring
|
||||
25
charts/monitoring/templates/falco.yaml
Normal file
25
charts/monitoring/templates/falco.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-falco'
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://falcosecurity.github.io/charts
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-falco'
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: falco
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: '{{ .Release.Name }}-falco'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
interval: 1h
|
||||
values: {}
|
||||
53
charts/monitoring/templates/kube-prometheus-stack.yaml
Normal file
53
charts/monitoring/templates/kube-prometheus-stack.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-prometheus-community"
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://prometheus-community.github.io/helm-charts/
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-prometheus-community"
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: kube-prometheus-stack
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: "{{ .Release.Name }}-prometheus-community"
|
||||
namespace: "{{ .Release.Namespace }}"
|
||||
interval: 1h
|
||||
values:
|
||||
grafana:
|
||||
env:
|
||||
GF_SERVER_ROOT_URL: https://grafana.olsen.cloud # TODO
|
||||
|
||||
---
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: HttpService
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-prometheus-community"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
subdomain: "{{ .Values.grafana.subdomain }}"
|
||||
destination:
|
||||
host: "{{ .Release.Name }}-prometheus-community-grafana.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
port:
|
||||
number: 80
|
||||
|
||||
---
|
||||
apiVersion: homelab.mortenolsen.pro/v1
|
||||
kind: OidcClient
|
||||
metadata:
|
||||
name: "{{ .Release.Name }}-grafana"
|
||||
spec:
|
||||
environment: "{{ .Values.globals.environment }}"
|
||||
redirectUris:
|
||||
- path: /login/generic_oauth
|
||||
subdomain: "{{ .Values.grafana.subdomain }}"
|
||||
matchingMode: strict
|
||||
25
charts/monitoring/templates/kyverno.yaml
Normal file
25
charts/monitoring/templates/kyverno.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-kyverno'
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://kyverno.github.io/kyverno/
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-kyverno'
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: kyverno
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: '{{ .Release.Name }}-kyverno'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
interval: 1h
|
||||
values: {}
|
||||
121
charts/monitoring/templates/loki.yaml
Normal file
121
charts/monitoring/templates/loki.yaml
Normal file
@@ -0,0 +1,121 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-loki'
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://grafana.github.io/helm-charts
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-loki'
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: loki
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: '{{ .Release.Name }}-loki'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
interval: 1h
|
||||
values:
|
||||
deploymentMode: SingleBinary
|
||||
loki:
|
||||
auth_enabled: false
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
|
||||
# memberlist:
|
||||
# join_members:
|
||||
# - loki-memberlist
|
||||
|
||||
schemaConfig:
|
||||
configs:
|
||||
- from: 2020-05-15
|
||||
store: tsdb
|
||||
object_store: filesystem
|
||||
schema: v13
|
||||
index:
|
||||
prefix: index_
|
||||
period: 24h
|
||||
|
||||
storage:
|
||||
type: filesystem
|
||||
|
||||
storage_config:
|
||||
filesystem:
|
||||
directory: /loki/chunks
|
||||
|
||||
limits_config:
|
||||
reject_old_samples: true
|
||||
reject_old_samples_max_age: 168h
|
||||
max_cache_freshness_per_query: 10m
|
||||
split_queries_by_interval: 15m
|
||||
volume_enabled: true
|
||||
|
||||
common:
|
||||
path_prefix: /loki
|
||||
storage:
|
||||
filesystem:
|
||||
chunks_directory: /loki/chunks
|
||||
rules_directory: /loki/rules
|
||||
replication_factor: 1
|
||||
ring:
|
||||
instance_addr: 127.0.0.1
|
||||
kvstore:
|
||||
store: inmemory
|
||||
|
||||
# Enable persistent storage
|
||||
singleBinary:
|
||||
persistence:
|
||||
enabled: true
|
||||
size: 10Gi
|
||||
storageClass: '{{ .Values.globals.environment }}' # Uses default storage class
|
||||
extraVolumeMounts:
|
||||
- name: storage
|
||||
mountPath: /loki
|
||||
|
||||
backend:
|
||||
replicas: 0
|
||||
read:
|
||||
replicas: 0
|
||||
write:
|
||||
replicas: 0
|
||||
|
||||
ingester:
|
||||
replicas: 0
|
||||
querier:
|
||||
replicas: 0
|
||||
queryFrontend:
|
||||
replicas: 0
|
||||
queryScheduler:
|
||||
replicas: 0
|
||||
distributor:
|
||||
replicas: 0
|
||||
compactor:
|
||||
replicas: 0
|
||||
indexGateway:
|
||||
replicas: 0
|
||||
bloomCompactor:
|
||||
replicas: 0
|
||||
bloomGateway:
|
||||
replicas: 0
|
||||
promtail:
|
||||
enabled: true
|
||||
config:
|
||||
snippets:
|
||||
extraScrapeConfigs: |
|
||||
- job_name: kubernetes-pods
|
||||
kubernetes_sd_configs:
|
||||
- role: pod
|
||||
relabel_configs:
|
||||
- source_labels: ["__meta_kubernetes_pod_container_name"]
|
||||
target_label: "container"
|
||||
- source_labels: ["__meta_kubernetes_pod_name"]
|
||||
target_label: "pod"
|
||||
- source_labels: ["__meta_kubernetes_pod_namespace"]
|
||||
target_label: "namespace"
|
||||
25
charts/monitoring/templates/trivy.yaml
Normal file
25
charts/monitoring/templates/trivy.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-aqua'
|
||||
spec:
|
||||
interval: 1h
|
||||
url: https://aquasecurity.github.io/helm-charts/
|
||||
|
||||
---
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: '{{ .Release.Name }}-aqua'
|
||||
spec:
|
||||
chart:
|
||||
spec:
|
||||
chart: trivy-operator
|
||||
reconcileStrategy: ChartVersion
|
||||
sourceRef:
|
||||
apiVersion: source.toolkit.fluxcd.io/v1
|
||||
kind: HelmRepository
|
||||
name: '{{ .Release.Name }}-aqua'
|
||||
namespace: '{{ .Release.Namespace }}'
|
||||
interval: 1h
|
||||
values: {}
|
||||
4
charts/monitoring/values.yaml
Normal file
4
charts/monitoring/values.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
globals:
|
||||
environment: prod
|
||||
grafana:
|
||||
subdomain: grafana
|
||||
@@ -1,33 +0,0 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: ApplicationSet
|
||||
metadata:
|
||||
name: homelab-apps
|
||||
namespace: '{{ .Values.env }}-argo'
|
||||
spec:
|
||||
generators:
|
||||
- git:
|
||||
repoURL: '{{ .Values.repo }}'
|
||||
revision: '{{ .Values.ref }}'
|
||||
directories:
|
||||
- path: charts/apps/*
|
||||
include: '.*'
|
||||
exclude: '.*.disabled'
|
||||
template:
|
||||
metadata:
|
||||
name: '{{`{{path.basename}}`}}'
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: '{{ .Values.repo }}'
|
||||
targetRevision: '{{ .Values.ref }}'
|
||||
path: charts/apps/{{`{{path.basename}}`}}
|
||||
helm:
|
||||
values: |
|
||||
globals: {{ .Values.globals | toYaml | nindent 14 }}
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: '{{ .Values.globals.env }}'
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
@@ -1,21 +0,0 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: homelab-root
|
||||
namespace: '{{ .Values.globals.env }}-argo'
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: '{{ .Values.repo }}'
|
||||
targetRevision: '{{ .Values.ref }}'
|
||||
path: charts/root
|
||||
helm:
|
||||
valueFiles:
|
||||
- values.yaml
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: '{{ .Values.globals.env }}-argo'
|
||||
syncPolicy:
|
||||
automated:
|
||||
prune: true
|
||||
selfHeal: true
|
||||
@@ -1,4 +0,0 @@
|
||||
globals:
|
||||
env: prod
|
||||
repo: https://github.com/morten-olsen/homelab-operator.git
|
||||
ref: HEAD
|
||||
3
charts/rules/Chart.yaml
Normal file
3
charts/rules/Chart.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
apiVersion: v2
|
||||
version: '1.0.0'
|
||||
name: rules
|
||||
@@ -0,0 +1,32 @@
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: Policy
|
||||
metadata:
|
||||
name: enforce-immutable-filesystem
|
||||
annotations:
|
||||
policies.kyverno.io/category: Security
|
||||
policies.kyverno.io/severity: medium
|
||||
policies.kyverno.io/description: |
|
||||
This policy automatically sets 'readOnlyRootFilesystem: true' for all containers
|
||||
within new Pods, enforcing an immutable root filesystem. This enhances security
|
||||
by preventing applications from writing to their root filesystem at runtime,
|
||||
making it harder for attackers to persist changes or introduce malware.
|
||||
spec:
|
||||
validationFailureAction: Audit
|
||||
rules:
|
||||
- name: enforce-read-only-root-filesystem
|
||||
match:
|
||||
any:
|
||||
- resources:
|
||||
kinds:
|
||||
- Pod
|
||||
mutate:
|
||||
patchStrategicMerge:
|
||||
spec:
|
||||
containers:
|
||||
- (name): '*' # Apply to all containers
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
initContainers:
|
||||
- (name): '*' # Apply to all init containers
|
||||
securityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
@@ -1,28 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: movies
|
||||
labels:
|
||||
type: nfs
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: manual-movies
|
||||
nfs:
|
||||
path: '{{ .Values.movies.path }}'
|
||||
server: '{{ .Values.host }}'
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: movies
|
||||
spec:
|
||||
storageClassName: manual-movies
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
@@ -1,28 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: music
|
||||
labels:
|
||||
type: nfs
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: manual-music
|
||||
nfs:
|
||||
path: '{{ .Values.music.path }}'
|
||||
server: '{{ .Values.host }}'
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: music
|
||||
spec:
|
||||
storageClassName: manual-music
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user