Compare commits

..

24 Commits

Author SHA1 Message Date
Márcio Fernandes
3ab4f3b8fa modified: deploy/app/helm-values.yaml
All checks were successful
/ continuous-deploy (push) Successful in 22s
2026-04-26 22:00:40 +00:00
Márcio Fernandes
d4f8664bc6 helm chart version version 12.5.3
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-04-25 21:51:02 +00:00
Márcio Fernandes
8730c3217b mf-ci-cd
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-04-18 23:14:14 +00:00
Márcio Fernandes
20360ff1dc network policy: remove 2222 from traefik public ingress
All checks were successful
/ continuous-deploy (push) Successful in 18s
2026-04-12 13:21:30 +00:00
Márcio Fernandes
0599b3d41a ingress revision
All checks were successful
/ continuous-deploy (push) Successful in 20s
2026-04-09 12:34:45 +00:00
Márcio Fernandes
d19eb21529 offsite backup fix packages wrong path, set max offsite size to 5Gb, reset borg repo
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-03-30 23:46:41 +00:00
Márcio Fernandes
87dc556748 modified: deploy/infra/network-policies.yaml
All checks were successful
/ continuous-deploy (push) Successful in 22s
2026-03-30 00:29:50 +00:00
Márcio Fernandes
4bcb91109c network policies simplification, fix certificate typo
All checks were successful
/ continuous-deploy (push) Successful in 22s
2026-03-29 21:37:33 +00:00
Márcio Fernandes
deb846ad19 modified: deploy/backups/.env.d/secrets.example
All checks were successful
/ continuous-deploy (push) Successful in 25s
2026-03-29 18:00:08 +00:00
Márcio Fernandes
4287af948b act runners add access to buildkit srv
All checks were successful
/ continuous-deploy (push) Successful in 23s
2026-03-28 10:48:24 +00:00
Márcio Fernandes
5861efb310 kb act runner add access to buildkit
All checks were successful
/ continuous-deploy (push) Successful in 20s
2026-03-28 10:39:01 +00:00
Márcio Fernandes
fb8a34ba7a fix: public ingress route
All checks were successful
/ continuous-deploy (push) Successful in 21s
2026-03-28 09:27:37 +00:00
Márcio Fernandes
b02303d51e added SSO, ingress to ingressRoute
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-03-28 00:44:00 +00:00
Márcio Fernandes
9b36b595b8 deploy: clean up network policies
All checks were successful
/ continuous-deploy (push) Successful in 20s
2026-03-22 13:07:25 +00:00
Márcio Fernandes
a0860185d6 modified: deploy/act-runners/mf/deploy/app/configmap.yaml
Some checks failed
/ continuous-deploy (push) Failing after 8s
2026-03-20 14:56:09 +00:00
Márcio Fernandes
fe74820aea act-runners: add mf act runner
All checks were successful
/ continuous-deploy (push) Successful in 18s
2026-03-20 14:17:06 +00:00
Márcio Fernandes
694756815f normalization of backups jobs names
All checks were successful
/ continuous-deploy (push) Successful in 18s
2026-03-20 09:47:44 +00:00
Márcio Fernandes
19fae24209 modified: deploy/app/helm-values.yaml
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-03-19 14:55:01 +00:00
Márcio Fernandes
9565bc64b0 modified: deploy/app/helm-values.yaml 2026-03-19 14:50:15 +00:00
Márcio Fernandes
9f4536e141 cd-service account role revision (removed access to networking.k8s.io and policy), helm values reviewed to run on cicd pipeline and ingress moved to infra 2026-03-19 10:31:29 +00:00
Márcio Fernandes
3c7adbc9e6 NetworkPolicy - ingress
All checks were successful
/ continuous-deploy (push) Successful in 27s
2026-03-18 13:44:50 +00:00
Márcio Fernandes
f1ad238669 added mylimbo act runner
All checks were successful
/ continuous-deploy (push) Successful in 19s
2026-03-16 10:10:08 +00:00
Márcio Fernandes
de4ea7d211 removed buildkit, security reasons. Moved to another project on an fedora-core os vm with buildkit, and delete old documentation about act runners
All checks were successful
/ continuous-deploy (push) Successful in 20s
2026-03-16 01:18:06 +00:00
Márcio Fernandes
c8f1a56255 fix cicd - runs-on
All checks were successful
/ continuous-deploy (push) Successful in 18s
2026-03-15 11:49:13 +00:00
39 changed files with 576 additions and 287 deletions

View File

@@ -9,9 +9,7 @@ on:
- main
jobs:
continuous-deploy:
runs-on: ubuntu-latest
container:
image: git.limbosolutions.com/kb/gitea/act:latest-network-stack
runs-on: ["deploy", "kubectl"]
env:
GITHUB_TEMP: ${{ runner.temp }} # fix missing GITHUB_TEMP on gitea
steps:

View File

@@ -4,14 +4,24 @@ Welcome to public repository of my [Git Server](https://git.limbosolutions.com)
Using [gitea](https://git.limbosolutions.com/kb/gitea) as git server.
- [SSO](#sso)
- [Deploy](#deploy)
- [Continuous Deploy](#continuous-deploy)
- [App](#app)
- [Infra](#infra)
- [Backups](#backups)
## SSO
<https://integrations.goauthentik.io/development/gitea/>
## Deploy
References:
- <https://gitea.com/gitea/helm-gitea>
- <https://dl.gitea.com/charts/>
### Continuous Deploy
Executes [App Deploy](#app) using [Gitea workflow](./.gitea/workflows/app-continous-deploy.yaml).
@@ -32,7 +42,6 @@ Deploy App
```
- [backups-kustomization](/deploy/app/kustomization.yaml)
- <https://dl.gitea.com/charts/>
### Infra

View File

@@ -13,6 +13,7 @@ spec:
metadata:
labels:
app: act-runner
buildkit.infra.limbosolutions.com/allow-build: "true"
spec:
containers:
- name: act-runner

View File

@@ -13,6 +13,7 @@ spec:
metadata:
labels:
app: act-runner
buildkit.infra.limbosolutions.com/allow-build: "true"
spec:
containers:
- name: act-runner

View File

@@ -0,0 +1,13 @@
# mylimbo - act-runner
**Deploy app:**
```bash
./deploy/ops-scripts/apply-app.sh
```
**Deploy Infra:**
```bash
./deploy/ops-scripts/apply-infra.sh
```

View File

@@ -1,3 +1,2 @@
**
!.gitignore
!*.example

View File

@@ -0,0 +1,26 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: act-runner
data:
config.yaml: |
log:
level: info
runner:
capacity: 1
labels:
- oci-image-builder
- kubectl
- helm
- ansible
- ubuntu
- network-utils
- deploy
- amd64
- limbosolutions-com
cache:
enabled: false
host:
workdir: "/data/runner"

View File

@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: act-runner
labels:
app: act-runner
spec:
replicas: 1
selector:
matchLabels:
app: act-runner
template:
metadata:
labels:
app: act-runner
buildkit.infra.limbosolutions.com/allow-build: "true"
spec:
containers:
- name: act-runner
image: git.limbosolutions.com/kb/gitea/act_runner:0.3-fatboy
imagePullPolicy: Always
env:
- name: LOG_LEVEL
value: "trace"
- name: CONFIG_FILE
value: /etc/act_runner/config.yaml
- name: GITEA_INSTANCE_URL
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_INSTANCE_URL
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_RUNNER_REGISTRATION_TOKEN
- name: GITEA_RUNNER_NAME
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_RUNNER_NAME
- name: GITEA_RUNNER_EPHEMERAL
value: "0"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "1000m"
volumeMounts:
- name: config-map
mountPath: /etc/act_runner/config.yaml
subPath: config.yaml
- name: runner-data
mountPath: /data/runner
volumes:
- name: config-map
configMap:
name: act-runner
- name: runner-data
emptyDir: {} # or PVC if you want persistence across pod restarts

View File

@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- configmap.yaml
- deployment.yaml
generatorOptions:
disableNameSuffixHash: true
secretGenerator:
- name: act-runner
envs:
- .env.d/.env

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
NAMESPACE=mf-cicd
kubectl kustomize deploy/app | kubectl --namespace ${NAMESPACE} apply -f -

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
NAMESPACE=mf-cicd
kubectl create namespace ${NAMESPACE} || true

View File

@@ -0,0 +1,13 @@
# mylimbo - act-runner
**Deploy app:**
```bash
./deploy/ops-scripts/apply-app.sh
```
**Deploy Infra:**
```bash
./deploy/ops-scripts/apply-infra.sh
```

View File

@@ -0,0 +1,2 @@
**
!.gitignore

View File

@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: act-runner
data:
config.yaml: |
log:
level: info
runner:
capacity: 4
labels:
- oci-image-builder
- kubectl
- helm
- ansible
- ubuntu
- network-utils
- deploy
- amd64
cache:
enabled: false
host:
workdir: "/data/runner"

View File

@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: act-runner
labels:
app: act-runner
spec:
replicas: 1
selector:
matchLabels:
app: act-runner
template:
metadata:
labels:
app: act-runner
buildkit.infra.limbosolutions.com/allow-build: "true"
spec:
containers:
- name: act-runner
image: git.limbosolutions.com/kb/gitea/act_runner:0.3-fatboy
imagePullPolicy: Always
env:
- name: LOG_LEVEL
value: "trace"
- name: CONFIG_FILE
value: /etc/act_runner/config.yaml
- name: GITEA_INSTANCE_URL
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_INSTANCE_URL
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_RUNNER_REGISTRATION_TOKEN
- name: GITEA_RUNNER_NAME
valueFrom:
secretKeyRef:
name: act-runner
key: GITEA_RUNNER_NAME
- name: GITEA_RUNNER_EPHEMERAL
value: "0"
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "400m"
volumeMounts:
- name: config-map
mountPath: /etc/act_runner/config.yaml
subPath: config.yaml
- name: runner-data
mountPath: /data/runner
volumes:
- name: config-map
configMap:
name: act-runner
- name: runner-data
emptyDir: {} # or PVC if you want persistence across pod restarts

View File

@@ -0,0 +1,14 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- configmap.yaml
- deployment.yaml
generatorOptions:
disableNameSuffixHash: true
secretGenerator:
- name: act-runner
envs:
- .env.d/.env

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
NAMESPACE=mylimbo-com-cicd
kubectl kustomize deploy/app | kubectl --namespace ${NAMESPACE} apply -f -

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -e
NAMESPACE=mylimbo-com-cicd
kubectl create namespace ${NAMESPACE} || true

View File

@@ -1,34 +1,100 @@
global:
# forcing docker.io to use cache from harbor
imageRegistry: "docker.io"
image:
registry: ""
# IMPORTANT:
# The default image used by the Gitea Helm chart is the *rootless* variant.
# Rootless Gitea does NOT include an SSH server, so enabling SSH in the chart
# will NOT work unless you explicitly switch to the rootful image.
#
# Default chart image (rootless, SSH disabled):
# registry: "docker.gitea.com"
# repository: gitea
#
# Correct rootful image (SSH enabled):
# repository: gitea/gitea
#
# This ensures the container includes OpenSSH and can expose the SSH port.
repository: gitea/gitea
pullPolicy: Always
tag: "1"
cache:
enabled: false
valkey-cluster:
enabled: false
# dependency:
# https://github.com/bitnami/charts/blob/main/bitnami/valkey/Chart.yaml
valkey:
enabled: true
architecture: standalone
global:
valkey:
password: "???"
master:
count: 1
service:
ports:
valkey: 6379
# Disable NetworkPolicy creation in the Bitnami valkey subchart.
# This deployment runs inside a controlled namespace where network
# boundaries are enforced by the platform (Infra team), not by Helm.
#
# CI/CD pipelines use a restricted ServiceAccount that is intentionally
# NOT allowed to create or modify NetworkPolicies. Leaving this enabled
# would cause Helm upgrades to fail with RBAC errors.
#
# Infra-owned NetworkPolicies are applied separately and independently
# of application charts to maintain a clean separation of responsibilities.
networkPolicy:
enabled: false
serviceAccount:
# serviceAccount resources are owned and managed by the Infrastructure layer.
# The CI/CD ServiceAccount used for application deployments does not have
# permissions to create or modify serviceAccounts, by design.
#
# In this setup Valkey does not require its own ServiceAccount, so enabling
# this would provide no benefit and would cause Helm upgrades to fail due
# to RBAC restrictions.
create: false
name: "default"
primary:
pdb:
# Disable the PodDisruptionBudget for PostgreSQL.
#
# This deployment uses a singleinstance (nonHA) valkey, so a PDB
# provides no real benefit — Kubernetes cannot evict the only pod anyway.
#
# More importantly, PodDisruptionBudgets are considered an Infraowned
# resource in this cluster. The CI/CD ServiceAccount intentionally lacks
# permissions to create or modify PDBs, and enabling this would cause
# Helm upgrades to fail with RBAC errors.
#
# The platform team applies disruption policies separately at the
# infrastructure layer, keeping a clean separation of responsibilities.
create: false
serviceAccount:
# serviceAccount resources are owned and managed by the Infrastructure layer.
# The CI/CD ServiceAccount used for application deployments does not have
# permissions to create or modify serviceAccounts, by design.
#
# In this setup Valkey does not require its own ServiceAccount, so enabling
# this would provide no benefit and would cause Helm upgrades to fail due
# to RBAC restrictions.
create: false
name: "default"
# dependency:
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml
postgresql-ha:
enabled: false
# dependency:
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql
postgresql:
enabled: true
image:
registry: ""
repository: bitnami/postgresql
repository: bitnamilegacy/postgresql
tag: 16
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
global:
postgresql:
auth:
@@ -36,29 +102,59 @@ postgresql:
password: "???"
database: "???"
username: "???"
service:
ports:
postgresql: 5432
serviceAccount:
# serviceAccount resources are owned and managed by the Infrastructure layer.
# The CI/CD ServiceAccount used for application deployments does not have
# permissions to create or modify serviceAccounts, by design.
# In this setup postgresql does not require its own ServiceAccount, so enabling
# this would provide no benefit and would cause Helm upgrades to fail due
# to RBAC restrictions.
create: false
primary:
networkPolicy:
# Disable NetworkPolicy creation in the Bitnami PostgreSQL subchart.
# This deployment runs inside a controlled namespace where network
# boundaries are enforced by the platform (Infra team), not by Helm.
#
# CI/CD pipelines use a restricted ServiceAccount that is intentionally
# NOT allowed to create or modify NetworkPolicies. Leaving this enabled
# would cause Helm upgrades to fail with RBAC errors.
#
# Infra-owned NetworkPolicies are applied separately and independently
# of application charts to maintain a clean separation of responsibilities.
enabled: false
pdb:
# Disable the PodDisruptionBudget for PostgreSQL.
#
# This deployment uses a singleinstance (nonHA) PostgreSQL, so a PDB
# provides no real benefit — Kubernetes cannot evict the only pod anyway.
#
# More importantly, PodDisruptionBudgets are considered an Infraowned
# resource in this cluster. The CI/CD ServiceAccount intentionally lacks
# permissions to create or modify PDBs, and enabling this would cause
# Helm upgrades to fail with RBAC errors.
#
# The platform team applies disruption policies separately at the
# infrastructure layer, keeping a clean separation of responsibilities.
create: false
persistence:
size: 10Gi
metrics:
enabled: true
collectors:
wal: false
postgresql-ha:
enabled: false
enabled: false
persistence:
enabled: true
service:
ssh:
type: LoadBalancer
enabled: true
port: 2222
loadBalancerIP: "" # optional
externalTrafficPolicy: Local
clusterIP: "" # empty string → Kubernetes assigns a routable ClusterIP
type: ClusterIP
port: 2222
http:
clusterIP: "" # empty string → Kubernetes assigns a routable ClusterIP
type: ClusterIP
@@ -129,22 +225,12 @@ gitea:
INTERNAL_TOKEN: "???"
PASSWORD_HASH_ALGO: "???"
# Ingress resources are owned and managed by the Infrastructure layer.
# The CI/CD ServiceAccount used for application deployments does not have
# permissions to create or modify Ingress objects, by design.
# for ingress setup check infra folder
ingress:
enabled: true
className: traefik
annotations:
kubernetes.io/ingress.class: traefik
cert-manager.io/cluster-issuer: "letsencrypt-prod"
traefik.ingress.kubernetes.io/router.entrypoints: websecure, public-https
hosts:
- host: git.limbosolutions.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: limbosolutions-com-tls
hosts:
- "git.limbosolutions.com"
enabled: false

View File

@@ -1,6 +1,6 @@
PBS_REPOSITORY="pbs repository"
PBS_PASSWORD="pbs access password"
PBS_FINGERPRINT="00:00:00:00:00" # the pbs finger print
PBS_REPOSITORY=xxx@pbs@server_address:collection
PBS_PASSWORD=pbs access password
PBS_FINGERPRINT=00:00:00:00:00 # pbs server fingerprint
BORG_REPO="ssh://user@server/path" # required by offsite backup
BORG_PASSPHRASE="borg passphrase" # required by offsite backup
OFFSITE_TARGET_FOLDER="test:target_path" # follow rclone naming convention

View File

@@ -12,11 +12,12 @@ spec:
template:
metadata:
labels:
app: offsite-backup
dbAccess: "true"
backups.infra.limbosolutions.com/ssh: "true"
spec:
restartPolicy: Never
initContainers:
- name: postgres-export
- name: postgres
resources:
limits:
memory: "512Mi"
@@ -46,7 +47,7 @@ spec:
containers:
- name: borg-client
- name: borg-backup
image: git.limbosolutions.com/kb/borg-backup:latest
imagePullPolicy: Always
resources:
@@ -81,7 +82,7 @@ spec:
value: ssh -p 2222 -o StrictHostKeyChecking=no -o LogLevel=ERROR
- name: REPO_SYNC_MAX_SIZE
value: "21474836480" # 20GB
value: "5368709120" # 5GB
- name: MODE
value: SHELL
@@ -98,7 +99,7 @@ spec:
# done
borg create ${BORG_REPO}::postgresql-export-$(date +%Y%m%d%H%M%S) /data/postgresql-export
borg create ${BORG_REPO}::gitea-data-$(date +%Y%m%d%H%M%S) /data/gitea-data --exclude /data/packages --exclude /data/tmp
borg create ${BORG_REPO}::gitea-data-$(date +%Y%m%d%H%M%S) /data/gitea-data --exclude /data/gitea-data/packages --exclude /data/gitea-data/tmp
#cleanup
borg prune -v --list --keep-daily=10 --keep-weekly=7 --keep-monthly=-1 ${BORG_REPO} --glob-archives='gitea-data*'

View File

@@ -11,11 +11,13 @@ spec:
template:
metadata:
labels:
app: pbs-backup
dbAccess: "true"
app: backup-pbs
backups.infra.limbosolutions.com/pbs: "true"
spec:
restartPolicy: Never
initContainers:
- name: postgres-export
- name: postgres
image: postgres:latest
resources:
limits:
@@ -49,8 +51,8 @@ spec:
readOnly: true
containers:
- name: gitea-pbs-client
image: git.limbosolutions.com/kb/pbsclient
- name: pbs-client
image: git.limbosolutions.com/kb/pbs-client
imagePullPolicy: Always
resources:
limits:

View File

@@ -1,8 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- cronjobs/borg-offsite-cronjob.yaml
- cronjobs/pbs-cronjob.yaml
- cronjobs/backup-borg-offsite.yaml
- cronjobs/backup-pbs.yaml
secretGenerator:
- name: gitea-backup

View File

@@ -1,61 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: buildkit-cache
namespace: buildkit
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: buildkitd
namespace: buildkit
spec:
replicas: 1
selector:
matchLabels:
app: buildkitd
template:
metadata:
labels:
app: buildkitd
spec:
containers:
- name: buildkitd
image: moby/buildkit:v0.12.5
args:
- "--addr"
- "tcp://0.0.0.0:1234"
- "--root"
- "/var/lib/buildkit"
ports:
- containerPort: 1234
securityContext:
privileged: true
volumeMounts:
- name: buildkit-cache
mountPath: /var/lib/buildkit
volumes:
- name: buildkit-cache
persistentVolumeClaim:
claimName: buildkit-cache
---
apiVersion: v1
kind: Service
metadata:
name: buildkitd
namespace: buildkit
spec:
selector:
app: buildkitd
ports:
- name: buildkit
port: 1234
targetPort: 1234

View File

@@ -1 +0,0 @@
EGRESS_BACKUPSRV_CIDR="BACKUPSRV-IP-ADDRESS/32"

View File

@@ -24,7 +24,7 @@ metadata:
name: continuous-deploy
rules:
- apiGroups: [""]
resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims", "endpoints", "serviceaccounts"]
resources: ["pods", "services", "secrets", "configmaps", "persistentvolumeclaims"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]
- apiGroups: ["apps"]
@@ -35,15 +35,6 @@ rules:
resources: ["cronjobs", "jobs"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies", "ingresses"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["get", "list", "watch", "update", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1

View File

@@ -0,0 +1,11 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: limbosolutions-com-tls
spec:
secretName: limbosolutions-com-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- git.limbosolutions.com

View File

@@ -0,0 +1,14 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: ssh-public
annotations:
kubernetes.io/ingress.class: traefik-public
spec:
entryPoints:
- tcp2222
routes:
- match: HostSNI(`*`)
services:
- name: gitea-ssh
port: 2222

View File

@@ -0,0 +1,14 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: ssh
annotations:
kubernetes.io/ingress.class: traefik
spec:
entryPoints:
- tcp2222
routes:
- match: HostSNI(`*`)
services:
- name: gitea-ssh
port: 2222

View File

@@ -0,0 +1,17 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: web-public
annotations:
kubernetes.io/ingress.class: traefik-public
spec:
entryPoints:
- websecure
routes:
- match: Host(`git.limbosolutions.com`) && !PathPrefix(`/-/admin`)
kind: Rule
services:
- name: gitea-http
port: 3000
tls:
secretName: limbosolutions-com-tls

View File

@@ -0,0 +1,17 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: web
annotations:
kubernetes.io/ingress.class: traefik
spec:
entryPoints:
- websecure
routes:
- match: Host(`git.limbosolutions.com`)
kind: Rule
services:
- name: gitea-http
port: 3000
tls:
secretName: limbosolutions-com-tls

View File

@@ -2,26 +2,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- continuous-deploy-account.yaml
- network-policies/egress.yaml
- network-policies/egress-local-services.yaml
- cd-serviceaccount.yaml
- network-policies.yaml
- certificate.yaml
- ingress-web.yaml
- ingress-web-public.yaml
- ingress-ssh.yaml
- ingress-ssh-public.yaml
generatorOptions:
disableNameSuffixHash: true
configMapGenerator:
- name: infra-setup-vars
namespace: git-limbosolutions-com
envs:
- ./.env.d/.env
replacements:
- source:
kind: ConfigMap
name: infra-setup-vars
fieldPath: data.EGRESS_BACKUPSRV_CIDR
targets:
- select:
kind: NetworkPolicy
name: git-limbosolutions-com-egress-local
fieldPaths:
- spec.egress.0.to.0.ipBlock.cidr

View File

@@ -0,0 +1,60 @@
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-same-namespace-ingress
spec:
endpointSelector: {} # All pods in this namespace
ingress:
- fromEndpoints:
- matchExpressions:
- key: k8s:io.kubernetes.pod.namespace
operator: In
values:
- git-limbosolutions-com
---
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: allow-traefik-ingress
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: gitea
ingress:
# -------------------------------------------------------------
# Allow Traefik (internal and public) to reach Gitea on port 3000 (web)
# -------------------------------------------------------------
- fromEndpoints:
- matchLabels:
app.kubernetes.io/name: traefik
matchExpressions:
- key: k8s:io.kubernetes.pod.namespace
operator: In
values:
- traefik
- traefik-public
toPorts:
- ports:
- port: "3000"
protocol: TCP
# -------------------------------------------------------------
# Allow Traefik (internal) to reach Gitea on port 3000 (ssh)
# -------------------------------------------------------------
- fromEndpoints:
- matchLabels:
app.kubernetes.io/name: traefik
matchExpressions:
- key: k8s:io.kubernetes.pod.namespace
operator: In
values:
- traefik
toPorts:
- ports:
- port: "2222"
protocol: TCP

View File

@@ -1,21 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: git-limbosolutions-com-egress-local
namespace: git-limbosolutions-com
spec:
podSelector: {} # apply to all pods in the namespace
policyTypes:
- Egress
egress:
# allow backup server
- to:
- ipBlock:
cidr: ${BACKUPSRV_CIDR}

View File

@@ -1,38 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: git-limbosolutions-com-egress
namespace: git-limbosolutions-com
spec:
podSelector: {} # apply to all pods in the namespace
policyTypes:
- Egress
egress:
# Allow DNS to kube-system
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
ports:
- protocol: UDP
port: 53
# allow namespace communication
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: git-limbosolutions-com
podSelector: {}
# Allow all egress EXCEPT private networks
- to:
- ipBlock:
cidr: 0.0.0.0/0 # first allow everything
except: # remove local network (so it means blocking, cidr is allowing everything )
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- 169.254.0.0/16
- 127.0.0.0/8
- 224.0.0.0/4
- 240.0.0.0/4

View File

@@ -5,6 +5,8 @@ metadata:
namespace: git-limbosolutions-com
labels:
app: borg-backup-sidekick
dbAccess: "true"
backups.infra.limbosolutions.com/ssh: "true"
spec:
containers:
- name: borg-backup-sidekick
@@ -21,14 +23,14 @@ spec:
- name: BORG_REPO
valueFrom:
secretKeyRef:
name: gitea-backup-secret
key: borg_repo
name: gitea-backup
key: BORG_REPO
- name: BORG_PASSPHRASE
valueFrom:
secretKeyRef:
name: gitea-backup-secret
key: borg_passphrase
name: gitea-backup
key: BORG_PASSPHRASE
- name: BORG_RSH
value: ssh -p 2222 -o StrictHostKeyChecking=no -o LogLevel=ERROR
@@ -47,12 +49,12 @@ spec:
- name: gitea-backup-secrets
mountPath: /root/.ssh/id_rsa
subPath: ssh_id_rsa
subPath: SSH_ID_RSA
readOnly: true
- name: gitea-backup-secrets
mountPath: /app/borg/key
subPath: borg_key
subPath: BORG_KEY
volumes:
- name: gitea-backup-secrets
secret:

View File

@@ -1,63 +0,0 @@
# Git Action
## runners
## lxc container - proxmox
Template : debian-12-turnkey-core_18.1-1_amd64.tar.gz
- Unprivileged contrainer - Yes
- Nesting -Yes
```bash
# setup new lxc container with docker
apt update -y
apt upgrade -y
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
```
### act runner
```bash
nano setup-act-runners.sh
```
```bash
#/bin/bash
setup(){
CONTAINER_NAME=${OWNER}_act_runner
docker container stop $CONTAINER_NAME
docker container rm $CONTAINER_NAME
docker run \
--restart=unless-stopped \
-v ${CONTAINER_NAME}_data:/data \
-v /var/run/docker.sock:/var/run/docker.sock \
-e GITEA_INSTANCE_URL=${INSTANCE_URL} \
-e GITEA_RUNNER_REGISTRATION_TOKEN=${REGISTRATION_TOKEN} \
-e GITEA_RUNNER_NAME=${OWNER}_ubuntu_default \
--name ${CONTAINER_NAME} \
-d gitea/act_runner
}
INSTANCE_URL=https://git.limbosolutions.com
OWNER=kb
REGISTRATION_TOKEN=???
setup
OWNER=????
REGISTRATION_TOKEN=???
setup
```
```bash
chmod +x setup-act-runners.sh
./setup-act-runners.sh
```

View File

@@ -1,5 +1,6 @@
#/bin/bash
kubectl kustomize deploy/backups | kubectl apply -f -
# load environment variables from file
if [ -f "deploy/app/.env.d/.env" ]; then
# Export all variables from the file
@@ -10,11 +11,12 @@ if [ -f "deploy/app/.env.d/.env" ]; then
fi
if [ -n "${APP_HELM_VALUE_GITEA_ADMIN_USERNAME:-}" ]; then
echo "Executing helm deploy."
helm repo add gitea-charts https://dl.gitea.com/charts/
helm repo update
helm upgrade --install gitea gitea-charts/gitea --version 12.5.0 \
echo "Executing helm deploy."
helm repo add gitea-charts https://dl.gitea.com/charts/ --force-update
helm upgrade --install gitea gitea-charts/gitea --version 12.5.3 \
--values deploy/app/helm-values.yaml \
--set valkey.global.valkey.password=${APP_HELM_VALUE_VALKEY_GLOBAL_PASSWORD} \
--set postgresql.global.postgresql.auth.postgresPassword=${APP_HELM_VALUE_POSTGRESQL_AUTH_POSTGRESPASSWORD} \
@@ -32,4 +34,7 @@ if [ -n "${APP_HELM_VALUE_GITEA_ADMIN_USERNAME:-}" ]; then
--set gitea.config.security.PASSWORD_HASH_ALGO=${APP_HELM_VALUE_GITEA_CONFIG_SECURITY_PASSWORD_HASH_ALGO} \
--set gitea.config.service.oauth2.JWT_SECRET=${APP_HELM_VALUE_GITEA_CONFIG_SERVICE_OAUTH2_JWT_SECRET} \
--namespace=git-limbosolutions-com
echo "executing deploy of backups jobs."
kubectl kustomize deploy/backups | kubectl -n git-limbosolutions-com apply -f -
fi

View File

@@ -2,6 +2,6 @@
set -e
echo "Executing infra deploy."
kubectl kustomize deploy/infra | kubectl apply -f -
kubectl kustomize deploy/infra | kubectl -n git-limbosolutions-com apply -f -