Skip to content

Commit 5432a09

Browse files
authored
feat(kubernetes): install github-mirror (#945)
This will replace `github-to-gitea-mirror`. Running in dry-run mode for now.
1 parent 35c0683 commit 5432a09

File tree

5 files changed

+121
-0
lines changed

5 files changed

+121
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
3+
apiVersion: helm.toolkit.fluxcd.io/v2
4+
kind: HelmRelease
5+
metadata:
6+
name: &app github-mirror
7+
spec:
8+
interval: 2h
9+
chart:
10+
spec:
11+
chart: app-template
12+
version: 3.2.1
13+
sourceRef:
14+
kind: HelmRepository
15+
name: bjw-s
16+
namespace: flux-system
17+
maxHistory: 2
18+
dependsOn:
19+
- name: gitea
20+
install:
21+
remediation:
22+
retries: 3
23+
upgrade:
24+
cleanupOnFail: true
25+
remediation:
26+
retries: 3
27+
strategy: uninstall
28+
uninstall:
29+
keepHistory: false
30+
values:
31+
controllers:
32+
github-mirror:
33+
type: cronjob
34+
cronjob:
35+
backoffLimit: 6
36+
concurrencyPolicy: Forbid
37+
failedJobsHistory: 1
38+
schedule: '01 23 * * 4'
39+
successfulJobsHistory: 0
40+
suspend: false
41+
containers:
42+
app:
43+
envFrom:
44+
- secretRef:
45+
name: github-mirror
46+
image:
47+
repository: ghcr.io/martinohmann/scm-migrator
48+
tag: latest@sha256:920ba60346b860aace1a57a9c28f92ecc18f89c8e9fa491a46083520ee781363
49+
args:
50+
- migrate
51+
- github-to-gitea
52+
- --gitea-url=https://git.18b.haus
53+
- --exclude-forks
54+
- --include='martinohmann/.*'
55+
- --mirror-interval=12h
56+
- --repo-owner=martinohmann-github-mirror
57+
defaultPodOptions:
58+
securityContext:
59+
runAsNonRoot: true
60+
runAsUser: 568
61+
runAsGroup: 568
62+
fsGroup: 568
63+
fsGroupChangePolicy: OnRootMismatch
64+
seccompProfile:
65+
type: RuntimeDefault
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
5+
resources:
6+
- ./secret.sops.yaml
7+
- ./helmrelease.yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: github-mirror
5+
stringData:
6+
GITEA_TOKEN: ENC[AES256_GCM,data:wK5DiezSYhokpXju21D66NsOrh4dqWBSWsiUwoXxH3v1pYL2FR9Rvg==,iv:si5xTnBeoSm2TjuuLLTHOAkAYBntbqPn8GmLCxiRgQA=,tag:4aa+IM4nGBPqJwQbbLxEHQ==,type:str]
7+
GITHUB_TOKEN: ENC[AES256_GCM,data:tsT00n1Fug4VPAlARfnkhnbkid/iTqXTWjqq1/ySd9fnCzxRpLM3ig==,iv:bZsqCzsa68l9xk7aDK+faC3Uk+FVr83sP9WMWvPa50s=,tag:wFxLt1gJslC07lebSBHGYQ==,type:str]
8+
sops:
9+
kms: []
10+
gcp_kms: []
11+
azure_kv: []
12+
hc_vault: []
13+
age:
14+
- recipient: age1u79ltfzz5k79ddwgv59r76p2532xnaehzz7vggttctudr6gdkvhq33edn6
15+
enc: |
16+
-----BEGIN AGE ENCRYPTED FILE-----
17+
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6SHhyQ3c0dGlEelVhdEJh
18+
ZUlOVkpvdGQwWmJhdVJhZTRuNEN2QzN3Rm5ZCm83aFBCRjBrZlNZdW54TTgrcTFk
19+
Q0U1aWhtUERRcVNqUjBMNHd5UW4waDgKLS0tIGpFK0JuMWp2VEJFeVV3VUVtSnhp
20+
RkhYalRqWC8weVJsTTFnb0FjaFJjajAKIGyngQRAzE5NendeTjuhov4NREGTJHow
21+
n3mqTpNLEDX/yX8L88hUrNLAPeyjXHs/Nu54pxbragT/5BS/jvhPBw==
22+
-----END AGE ENCRYPTED FILE-----
23+
lastmodified: "2024-06-07T19:35:22Z"
24+
mac: ENC[AES256_GCM,data:Q67M04PvUDvLoJrlpvkei3Y7ZJmgcGcIdz/11+j2U4F/romJHr3BuulBc/d6HMjU24dcC/SxkgKgeMjjwpkHA5eJqo6I8z8VNljw4TPcGTf8Aph5aO8CbBrHGsUorbhYbQ/eEOT5fuJ1U7OnWlw4AGjOzMJjw+z+3kTZSJkmn64=,iv:aGAAmS+MkDgrL/8XJB7QRkmpfpk9h+vRq/I8tgjf7+M=,tag:0mcpvE+wbl6Aa8fkJqjD2Q==,type:str]
25+
pgp: []
26+
encrypted_regex: ^(data|stringData)$
27+
version: 3.8.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# yaml-language-server: $schema=https://kubernetes-schemas.18b.haus/kustomize.toolkit.fluxcd.io/kustomization_v1.json
3+
apiVersion: kustomize.toolkit.fluxcd.io/v1
4+
kind: Kustomization
5+
metadata:
6+
name: &app github-mirror
7+
namespace: flux-system
8+
spec:
9+
targetNamespace: default
10+
commonMetadata:
11+
labels:
12+
app.kubernetes.io/name: *app
13+
path: ./kubernetes/main/apps/default/github-mirror/app
14+
prune: true
15+
sourceRef:
16+
kind: GitRepository
17+
name: home-kubernetes
18+
wait: false
19+
interval: 2h
20+
retryInterval: 1m
21+
timeout: 5m

kubernetes/main/apps/default/kustomization.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ./namespace.yaml
77
- ./external-apps/ks.yaml
88
- ./gitea/ks.yaml
9+
- ./github-mirror/ks.yaml
910
- ./github-to-gitea-mirror/ks.yaml
1011
- ./go2rtc/ks.yaml
1112
- ./home-assistant/ks.yaml

0 commit comments

Comments
 (0)