Merge branch 'refs/heads/main' into infra/postgresql

This commit is contained in:
2024-07-17 01:07:38 +10:00
31 changed files with 236 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
{
"appName": "homer",
"userGivenName": "homer",
"namespace": "homer",
"destNamespace": "homer",
"destServer": "https://kubernetes.default.svc",
"srcPath": "apps/homer/env/k3s-cluster",

View File

@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nexus
namespace: nexus
spec:
replicas: 1
selector:
matchLabels:
app: nexus
template:
metadata:
labels:
app: nexus
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: nexus
image: klo2k/nexus3:3.68.1-02
resources:
limits:
memory: "3Gi"
cpu: "1"
requests:
memory: "2Gi"
cpu: "500m"
ports:
- containerPort: 8081
volumeMounts:
- name: nexus-data
mountPath: /nexus-data
volumes:
- name: nexus-data
hostPath:
path: /mnt/nfs/AppData/nexus
type: Directory

View File

@@ -0,0 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./deployment.yaml
- ./service.yaml

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: nexus
namespace: nexus
annotations:
prometheus.io/scrape: 'true'
prometheus.io/path: /
prometheus.io/port: '8081'
spec:
selector:
app: nexus
type: NodePort
ports:
- port: 8081
targetPort: 8081
nodePort: 32000

View File

@@ -1,9 +1,9 @@
{
"appName": "sealed-secrets",
"userGivenName": "sealed-secrets",
"destNamespace": "argocd",
"appName": "nexus",
"userGivenName": "nexus",
"destNamespace": "nexus",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/sealed-secrets/env/k3s-cluster",
"srcPath": "apps/nexus/env/k3s-cluster",
"srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git",
"srcTargetRevision": "",
"labels": null,

View File

@@ -0,0 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: snippet-box
namespace: snippet-box
labels:
app.kubernetes.io/name: snippet-box
spec:
selector:
matchLabels:
app.kubernetes.io/name: snippet-box
template:
metadata:
labels:
app.kubernetes.io/name: snippet-box
spec:
containers:
- name: snippet-box
image: pawelmalak/snippet-box:arm
ports:
- protocol: TCP
containerPort: 5000
name: snippet-box
env:
- name: TZ
value: Australia/Sydney
volumeMounts:
- name: snippet-box-data
mountPath: /app/data
volumes:
- name: snippet-box-data
hostPath:
path: /mnt/nfs/AppData/snippet-box
type: Directory

View File

@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: snippet-box-ingress
namespace: snippet-box
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: "snippet-box.cluster.edward.sydney"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: snippet-box
port:
number: 5000

View File

@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./deployment.yaml
- ./service.yaml
- ./ingress.yaml

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: snippet-box
namespace: snippet-box
labels:
app.kubernetes.io/name: snippet-box
spec:
selector:
app.kubernetes.io/name: snippet-box
type: ClusterIP
internalTrafficPolicy: Cluster
ports:
- protocol: TCP
port: 5000
targetPort: 5000
name: snippet-box

View File

@@ -0,0 +1,11 @@
{
"appName": "snippet-box",
"userGivenName": "snippet-box",
"destNamespace": "snippet-box",
"destServer": "https://kubernetes.default.svc",
"srcPath": "apps/snippet-box/env/k3s-cluster",
"srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git",
"srcTargetRevision": "",
"labels": null,
"annotations": null
}

View File

@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

View File

@@ -1,6 +1,7 @@
{
"appName": "ingress-nginx",
"userGivenName": "ingress-nginx",
"namespace": "ingress-nginx",
"destNamespace": "ingress-nginx",
"destServer": "https://kubernetes.default.svc",
"srcPath": "infrastructures/ingress-nginx/env/k3s-cluster",

View File

@@ -46,7 +46,7 @@ spec:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/name: '{{ appName }}'
name: '{{ userGivenName }}'
namespace: argocd
namespace: '{{ namespace }}'
spec:
destination:
namespace: '{{ destNamespace }}'

View File

@@ -46,7 +46,7 @@ spec:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/name: '{{ appName }}'
name: '{{ userGivenName }}'
namespace: argocd
namespace: '{{ namespace }}'
spec:
destination:
namespace: '{{ destNamespace }}'

View File

@@ -46,7 +46,7 @@ spec:
app.kubernetes.io/managed-by: argocd
app.kubernetes.io/name: '{{ appName }}'
name: '{{ userGivenName }}'
namespace: argocd
namespace: '{{ namespace }}'
spec:
destination:
namespace: '{{ destNamespace }}'

View File

@@ -0,0 +1,9 @@
apiVersion: v2
version: "0.0.1"
appVersion: "0.0.1"
name: app-secrets
dependencies:
- name: nginx
version: 0.0.1
repository: "https://raw.githubusercontent.com/timtsoitt/argocd-base-charts/main/releases"

View File

@@ -0,0 +1,12 @@
{
"appName": "app-secrets",
"userGivenName": "app-secrets",
"namespace": "app-secrets",
"destNamespace": "app-secrets",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/app-secrets/env/k3s-cluster",
"srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git",
"srcTargetRevision": "",
"labels": null,
"annotations": null
}

View File

@@ -0,0 +1,26 @@
---
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
annotations:
sealedsecrets.bitnami.com/cluster-wide: "true"
creationTimestamp: null
name: postgresql-secrets
namespace: postgresql
spec:
encryptedData:
database: AgBJ/TwGeaHpcCg6oSUywLp1q84Gr3rm3w3J4v5A0NoRPucO029RVtYCr3Lz3VJ06c6qyWFAZCEo3jRvYer67vZenN9uSfZS+qtQafyeISogUejpmHzulOvgvQXTBU09X6lKzCC6l+HFKB1qJ0bMzabY127KHIvgv7Dq+v4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qm9mzxfDfNj6gCED8a2z75IHHpqj7BGNBqjKtmSb+0+gmwfZG0i5UOczSSxNBayXsCkUPZZNYb1lnPLNnxASBRAcFikqHHpp0gsb54DmgL/LzfZGEEbzco59/DA1F9O+Ypy11FlLJw89bM+4bHoLXnzqI48tlThslFT6pIYT7nizJR+zjn+3pC6bxX31MqQPVu6whfHIR6OBh94T1fyoISdc3SeODTlsNAd9/pPnS7v+LaPaQno=
template:
metadata:
annotations:
argocd.argoproj.io/sync-options: Prune=false
sealedsecrets.bitnami.com/cluster-wide: "true"
sealedsecrets.bitnami.com/managed: "true"
creationTimestamp: null
name: postgresql-secrets
namespace: postgresql
type: Opaque

View File

@@ -1,6 +1,7 @@
{
"appName": "ingress-nginx-configmap",
"userGivenName": "ingress-nginx-configmap",
"namespace": "ingress-nginx",
"destNamespace": "ingress-nginx",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/ingress-nginx-configmap/env/k3s-cluster",

View File

@@ -1,6 +1,7 @@
{
"appName": "local-path-provisioner",
"userGivenName": "local-path-provisioner",
"namespace": "local-path-provisioner",
"destNamespace": "local-path-provisioner",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/local-path-provisioner/env/k3s-cluster",

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations:
argocd.argoproj.io/sync-options: Prune=false
creationTimestamp: null
name: app-secrets
spec: {}
status: {}

View File

@@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./adguard-home.yaml
- ./app-secrets.yaml
- ./cert-manager.yaml
- ./code-server.yaml
- ./consul.yaml

View File

@@ -1,6 +1,7 @@
{
"appName": "namespaces",
"userGivenName": "namespaces",
"namespace": "argocd",
"destNamespace": "argocd",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/namespaces/env/k3s-cluster",

View File

@@ -1,8 +0,0 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: sealed-secrets
repo: https://bitnami-labs.github.io/sealed-secrets
version: 2.16.0
releaseName: sealed-secrets
valuesFile: values.yaml

View File

@@ -1,6 +1,7 @@
{
"appName": "sync-job",
"userGivenName": "sync-job",
"namespace": "argocd",
"destNamespace": "argocd",
"destServer": "https://kubernetes.default.svc",
"srcPath": "resources/sync-job/env/k3s-cluster",

View File

@@ -0,0 +1,6 @@
#!/bin/bash
set -e
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
helm repo update
helm install sealed-secrets -n kube-system --set-string fullnameOverride=sealed-secrets-controller sealed-secrets/sealed-secrets -f sealed-secrets-values.yaml

View File

@@ -0,0 +1,7 @@
#!/usr/bin/bash
set -e
secretName=$1
filePath=$2
cat $filePath | kubeseal --format yaml --scope cluster-wide | tee $filePath