Compare commits

..

1 Commits

Author SHA1 Message Date
unkin-agent 461e3c6530 Add public main.unkin.net and edge.unkin.net zones to bind-external
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful
2026-10-19 22:08:48 +11:00
79 changed files with 312 additions and 1029 deletions
-6
View File
@@ -42,9 +42,3 @@ repos:
entry: ci/validate-no-secrets.sh
language: system
pass_filenames: false
- id: runner_hooks
name: test arc runner job-started hook
entry: ci/test-runner-hooks.sh
language: system
pass_filenames: false
files: ^(apps/base/iuclabs-runners/job-started\.sh|ci/test-runner-hooks\.sh|ci/fixtures/runner-hooks/)
-5
View File
@@ -1,5 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: arc-system
-12
View File
@@ -1,12 +0,0 @@
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: arc-controller
namespace: arc-system
spec:
minAvailable: 1
selector:
matchLabels:
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/instance: arc
-40
View File
@@ -1,40 +0,0 @@
---
# Controller metrics. gha_controller_*_ephemeral_runners carry the runner
# namespace, which the dashboard filters on, so restore it over the target's.
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMPodScrape
metadata:
name: arc-controller
namespace: arc-system
spec:
selector:
matchLabels:
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/instance: arc
podMetricsEndpoints:
- port: metrics
path: /metrics
metricRelabelConfigs:
- sourceLabels: [__name__, exported_namespace]
regex: gha_controller_.+_ephemeral_runners;(.+)
targetLabel: namespace
---
# Listener metrics carry their own name/namespace (the runner scale set), and
# the dashboard also expects the scale-set pod labels.
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMPodScrape
metadata:
name: arc-listener
namespace: arc-system
spec:
selector:
matchLabels:
app.kubernetes.io/component: runner-scale-set-listener
app.kubernetes.io/part-of: gha-runner-scale-set
podMetricsEndpoints:
- port: metrics
path: /metrics
honorLabels: true
relabelConfigs:
- action: labelmap
regex: __meta_kubernetes_pod_label_(actions_github_com_scale_set_.+)
+1 -1
View File
@@ -36,7 +36,7 @@ spec:
mountPath: /combined-certs
containers:
- name: api
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi:v3.25.2
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi:v3.19.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
+1 -2
View File
@@ -5,7 +5,6 @@ metadata:
name: api-env
namespace: artifactapi
data:
ARTIFACTAPI_AUTH_UPLOADS: "true"
ARTIFACTAPI_OIDC_AUDIENCE: artifactapi
ARTIFACTAPI_OIDC_ISSUER: https://vault.service.consul:8200/v1/identity/oidc
DBHOST: postgres-pooler
@@ -13,7 +12,7 @@ data:
DBPORT: "5432"
DBUSER: artifacts
MINIO_BUCKET: artifactapi-prod-k8s-syd1-au
MINIO_ENDPOINT: s3.ceph.unkin.net
MINIO_ENDPOINT: radosgw.service.consul
MINIO_SECURE: "true"
REDIS_URL: redis://redis:6379
SSL_CERT_FILE: /etc/ssl/combined/ca-certificates.crt
+2 -2
View File
@@ -49,7 +49,7 @@ spec:
capabilities:
drop: ["ALL"]
- name: api
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi:v3.25.2
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi:v3.19.0
imagePullPolicy: IfNotPresent
command: ["/keeper/true"]
volumeMounts:
@@ -69,7 +69,7 @@ spec:
capabilities:
drop: ["ALL"]
- name: ui
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi-ui:v3.25.2
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi-ui:v3.19.0
imagePullPolicy: IfNotPresent
command: ["true"]
resources:
+1 -1
View File
@@ -22,7 +22,7 @@ spec:
automountServiceAccountToken: true
containers:
- name: ui
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi-ui:v3.25.2
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/artifactapi-ui:v3.19.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
@@ -3,4 +3,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base/ceph-system
- mta1.yaml
- mta2.yaml
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: edge-mta1-a
namespace: bind-external
spec:
zoneRef: edge-unkin-net
name: "mta1"
type: A
ttl: 3600
values:
- 66.226.148.207
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: edge-mta2-a
namespace: bind-external
spec:
zoneRef: edge-unkin-net
name: "mta2"
type: A
ttl: 3600
values:
- 66.226.149.50
@@ -3,4 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base/iuclabs-runners
- a
@@ -8,4 +8,6 @@ resources:
- tsigkey.yaml
- zones.yaml
- acme-unkin-net
- main-unkin-net
- edge-unkin-net
- agent-dns-rolebinding.yaml
@@ -3,6 +3,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- pdb.yaml
- vmpodscrape.yaml
- mail-in.yaml
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-mail-in-a
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "mail-in"
type: A
ttl: 3600
values:
- 103.216.191.185
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-acme-challenge-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "_acme-challenge"
type: CNAME
ttl: 3600
values:
- _acme-challenge.main.acme.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-au-syd1-pve-api-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "au-syd1-pve-api"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-au-syd1-pve-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "au-syd1-pve"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-grafana-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "grafana"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,15 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- acme-challenge.yaml
- au-syd1-pve.yaml
- au-syd1-pve-api.yaml
- grafana.yaml
- lidarr.yaml
- nzbget.yaml
- prowlarr.yaml
- radarr.yaml
- readarr.yaml
- sonarr.yaml
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-lidarr-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "lidarr"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-nzbget-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "nzbget"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-prowlarr-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "prowlarr"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-radarr-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "radarr"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-readarr-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "readarr"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-sonarr-cname
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "sonarr"
type: CNAME
ttl: 3600
values:
- lb1.unkin.net.
@@ -0,0 +1,9 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- a
- mx
- txt
- cname
@@ -0,0 +1,14 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-apex-mx
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "@"
type: MX
ttl: 3600
values:
- "10 mta1.edge.unkin.net."
- "20 mta2.edge.unkin.net."
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- apex.yaml
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-apex-txt
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "@"
type: TXT
ttl: 3600
values:
- '"v=spf1 ip4:66.226.148.207 ip4:66.226.149.50 -all"'
@@ -0,0 +1,13 @@
---
apiVersion: bind.unkin.net/v1alpha1
kind: DNSRecord
metadata:
name: main-dmarc-txt
namespace: bind-external
spec:
zoneRef: main-unkin-net
name: "_dmarc"
type: TXT
ttl: 3600
values:
- '"v=DMARC1; p=none; rua=mailto:dmarc@unkin.net; adkim=r; aspf=r"'
@@ -0,0 +1,7 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- apex.yaml
- dmarc.yaml
+36
View File
@@ -28,3 +28,39 @@ spec:
type: A
ttl: 3600
values: ["103.216.191.185"]
---
# Public mail zones, delegated from Google Cloud DNS to acme-ns1.unkin.net like
# acme.unkin.net. DNSRecords are applied with the zone's update key.
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: main-unkin-net
namespace: bind-external
spec:
clusterRef: bind-external
zoneName: main.unkin.net
type: primary
defaultTTL: 3600
dynamicUpdate: true
updateKeyRef: certmanager
allowTransfer:
- key certmanager
nameservers:
- acme-ns1.unkin.net.
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: edge-unkin-net
namespace: bind-external
spec:
clusterRef: bind-external
zoneName: edge.unkin.net
type: primary
defaultTTL: 3600
dynamicUpdate: true
updateKeyRef: certmanager
allowTransfer:
- key certmanager
nameservers:
- acme-ns1.unkin.net.
@@ -7,4 +7,3 @@ resources:
- acls.yaml
- view.yaml
- forward-zones.yaml
- rbl-zones.yaml
@@ -1,121 +0,0 @@
# DNSBLs refuse queries relayed via public resolvers, so these zones resolve directly.
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-spamhaus-org
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: spamhaus.org
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-mailspike-net
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: mailspike.net
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-spameatingmonkey-net
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: spameatingmonkey.net
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-dnswl-org
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: dnswl.org
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-virusfree-cz
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: virusfree.cz
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-blocklist-de
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: blocklist.de
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-msbl-org
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: msbl.org
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-surbl-org
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: surbl.org
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-uribl-com
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: uribl.com
type: forward
catalog: false
---
apiVersion: bind.unkin.net/v1alpha1
kind: BindZone
metadata:
name: rbl-rspamd-com
namespace: bind-internal
spec:
clusterRef: bind-resolvers
viewRef: openforwarder
zoneName: rspamd.com
type: forward
catalog: false
@@ -23,3 +23,14 @@ spec:
- "allow-query-cache { any; }"
# pods have no IPv6 route; v6 NS attempts burn the recursion-query budget
- "server ::/0 { bogus yes; }"
# RBL zones resolve directly: DNSBLs refuse queries relayed via public resolvers.
- 'zone "spamhaus.org" { type forward; forwarders { }; }'
- 'zone "mailspike.net" { type forward; forwarders { }; }'
- 'zone "spameatingmonkey.net" { type forward; forwarders { }; }'
- 'zone "dnswl.org" { type forward; forwarders { }; }'
- 'zone "virusfree.cz" { type forward; forwarders { }; }'
- 'zone "blocklist.de" { type forward; forwarders { }; }'
- 'zone "msbl.org" { type forward; forwarders { }; }'
- 'zone "surbl.org" { type forward; forwarders { }; }'
- 'zone "uribl.com" { type forward; forwarders { }; }'
- 'zone "rspamd.com" { type forward; forwarders { }; }'
-26
View File
@@ -1,26 +0,0 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: rgw-tls
namespace: ceph-system
labels:
app.kubernetes.io/name: rgw
spec:
secretName: rgw-tls
issuerRef:
kind: ClusterIssuer
name: vault-issuer
commonName: s3.ceph.unkin.net
dnsNames:
- s3.ceph.unkin.net
- rgw.k8s.syd1.au.unkin.net
- radosgw.service.consul
- radosgw.query.consul
- radosgw.service.au-syd1.consul
- radosgw.main.unkin.net
ipAddresses:
- 198.18.200.11
privateKey:
algorithm: RSA
size: 4096
-26
View File
@@ -1,26 +0,0 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ceph-conf
namespace: ceph-system
data:
ceph.conf: |
[global]
fsid = de96a98f-3d23-465a-a899-86d3d67edab8
mon_host = 198.18.23.9,198.18.23.10,198.18.23.11,198.18.23.12,198.18.23.13
auth_client_required = cephx
auth_cluster_required = cephx
auth_service_required = cephx
ms_bind_ipv4 = true
ms_bind_ipv6 = false
[client.rgw.syd1]
rgw_realm = unkin
rgw_zonegroup = au
rgw_zone = syd1
rgw_frontends = beast port=7480 ssl_port=7443 ssl_certificate=/etc/rgw/tls/tls.crt ssl_private_key=/etc/rgw/tls/tls.key
keyring = /var/lib/ceph/radosgw/ceph-rgw.syd1/keyring
log_to_file = false
log_to_stderr = true
err_to_stderr = true
-133
View File
@@ -1,133 +0,0 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: rgw
namespace: ceph-system
labels:
app.kubernetes.io/name: rgw
app.kubernetes.io/component: rgw
app.kubernetes.io/version: v18.2.8
annotations:
reloader.stakater.com/auto: "true"
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 0
selector:
matchLabels:
app.kubernetes.io/name: rgw
template:
metadata:
labels:
app.kubernetes.io/name: rgw
app.kubernetes.io/component: rgw
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
runAsUser: 167
runAsGroup: 167
fsGroup: 167
seccompProfile:
type: RuntimeDefault
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app.kubernetes.io/name: rgw
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: rgw
containers:
- name: rgw
image: quay.io/ceph/ceph:v18.2.8
imagePullPolicy: IfNotPresent
command:
- radosgw
- -f
- --cluster
- ceph
- --name
- client.rgw.syd1
ports:
- name: http
containerPort: 7480
- name: https
containerPort: 7443
startupProbe:
httpGet:
path: /
port: http
periodSeconds: 5
failureThreshold: 30
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
periodSeconds: 20
failureThreshold: 6
resources:
requests:
cpu: "1"
memory: 2Gi
limits:
cpu: "2"
memory: 4Gi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
volumeMounts:
- name: ceph-conf
mountPath: /etc/ceph
readOnly: true
- name: tls
mountPath: /etc/rgw/tls
readOnly: true
- name: keyring
mountPath: /var/lib/ceph/radosgw/ceph-rgw.syd1
readOnly: true
- name: run
mountPath: /var/run/ceph
- name: log
mountPath: /var/log/ceph
- name: tmp
mountPath: /tmp
volumes:
- name: ceph-conf
configMap:
name: ceph-conf
- name: tls
secret:
secretName: rgw-tls
- name: keyring
secret:
secretName: rgw-keyring
items:
- key: keyring
path: keyring
- name: run
emptyDir: {}
- name: log
emptyDir: {}
- name: tmp
emptyDir: {}
-15
View File
@@ -1,15 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- configmap.yaml
- vaultauth.yaml
- vaultstaticsecret.yaml
- deployment.yaml
- service.yaml
- service-external.yaml
- certificate.yaml
- pdb.yaml
- vpa.yaml
-5
View File
@@ -1,5 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: ceph-system
-11
View File
@@ -1,11 +0,0 @@
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: rgw
namespace: ceph-system
spec:
maxUnavailable: 1
selector:
matchLabels:
app.kubernetes.io/name: rgw
@@ -1,21 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: rgw-external
namespace: ceph-system
labels:
app.kubernetes.io/name: rgw
annotations:
purelb.io/service-group: common
purelb.io/addresses: 198.18.200.11
external-dns.alpha.kubernetes.io/hostname: rgw.k8s.syd1.au.unkin.net
spec:
type: LoadBalancer
externalTrafficPolicy: Local
selector:
app.kubernetes.io/name: rgw
ports:
- name: https
port: 443
targetPort: https
-16
View File
@@ -1,16 +0,0 @@
---
apiVersion: v1
kind: Service
metadata:
name: rgw
namespace: ceph-system
labels:
app.kubernetes.io/name: rgw
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: rgw
ports:
- name: http
port: 7480
targetPort: http
-18
View File
@@ -1,18 +0,0 @@
---
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultAuth
metadata:
name: default
namespace: ceph-system
spec:
method: kubernetes
mount: k8s/au/syd1
vaultConnectionRef: vso-system/default
allowedNamespaces:
- ceph-system
kubernetes:
role: default
serviceAccount: default
audiences:
- vault
tokenExpirationSeconds: 600
@@ -1,18 +0,0 @@
---
# Seed kv/kubernetes/namespace/ceph-system/default/rgw-keyring field `keyring` with the client.rgw.syd1 keyring.
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
name: rgw-keyring
namespace: ceph-system
spec:
vaultAuthRef: default
mount: kv
type: kv-v2
path: kubernetes/namespace/ceph-system/default/rgw-keyring
refreshAfter: 5m
hmacSecretData: true
destination:
name: rgw-keyring
create: true
overwrite: true
-13
View File
@@ -1,13 +0,0 @@
---
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: rgw-vpa
namespace: ceph-system
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: rgw
updatePolicy:
updateMode: "Off"
-2
View File
@@ -11,5 +11,3 @@ data:
DBPORT: "5432"
DBUSER: encapi
DBSSL: require
ENCAPI_OIDC_ISSUER: https://vault.service.consul:8200/v1/identity/oidc
SSL_CERT_FILE: /etc/ssl/combined/ca-certificates.crt
+1 -28
View File
@@ -6,7 +6,6 @@ metadata:
namespace: encapi
annotations:
configmap.reloader.stakater.com/auto: "true"
secret.reloader.stakater.com/reload: "vault-ca-cert"
spec:
replicas: 2
selector:
@@ -22,22 +21,9 @@ spec:
app: encapi
spec:
automountServiceAccountToken: true
initContainers:
- name: combine-certs
image: alpine:3
command:
- sh
- -c
- cat /etc/ssl/certs/ca-certificates.crt /custom-ca/ca.crt > /combined-certs/ca-certificates.crt
volumeMounts:
- name: vault-ca-cert
mountPath: /custom-ca
readOnly: true
- name: combined-certs
mountPath: /combined-certs
containers:
- name: encapi
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/encapi:v0.3.0
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/encapi:v0.1.2
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
@@ -52,10 +38,6 @@ spec:
- secretRef:
name: environment
optional: false
volumeMounts:
- name: combined-certs
mountPath: /etc/ssl/combined
readOnly: true
livenessProbe:
httpGet:
path: /healthz
@@ -79,13 +61,4 @@ spec:
limits:
cpu: 500m
memory: 256Mi
volumes:
- name: vault-ca-cert
secret:
secretName: vault-ca-cert
items:
- key: ca.crt
path: ca.crt
- name: combined-certs
emptyDir: {}
restartPolicy: Always
File diff suppressed because one or more lines are too long
-1
View File
@@ -30,4 +30,3 @@ resources:
- dashboards/victoriametrics-cluster.yaml
- dashboards/victoriametrics-vmagent.yaml
- dashboards/cloudnativepg.yaml
- dashboards/arc-runner-scale-set.yaml
@@ -1,7 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
- scaleset.yaml
- networkpolicy.yaml
@@ -1,45 +0,0 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: egress-iuclabs-k8s
namespace: iuclabs-runners
spec:
podSelector:
matchLabels:
runners.unkin.net/scale-set: iuclabs-k8s
policyTypes:
- Egress
egress:
- to:
- ipBlock:
cidr: 0.0.0.0/0
except:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
- 198.18.0.0/15
- 0.0.0.0/8
- 100.64.0.0/10
- 127.0.0.0/8
- 169.254.0.0/16
- 224.0.0.0/4
- 240.0.0.0/4
ports:
- protocol: TCP
port: 443
# vault.service.consul servers, from `dig vault.service.consul`
- to:
- ipBlock:
cidr: 198.18.25.78/32
- ipBlock:
cidr: 198.18.26.197/32
- ipBlock:
cidr: 198.18.27.116/32
- ipBlock:
cidr: 198.18.28.248/32
- ipBlock:
cidr: 198.18.29.92/32
ports:
- protocol: TCP
port: 8200
@@ -1,74 +0,0 @@
---
apiVersion: actions.github.com/v1alpha1
kind: AutoscalingRunnerSet
metadata:
name: iuclabs-k8s
namespace: iuclabs-runners
labels:
app.kubernetes.io/version: "0.15.1"
annotations:
actions.github.com/cleanup-manager-role-name: arc-manager
actions.github.com/cleanup-manager-role-binding: arc-manager
spec:
githubConfigUrl: https://github.com/IUCLabs
githubConfigSecret: github-app
runnerScaleSetName: iuclabs-k8s
minRunners: 0
maxRunners: 4
template:
metadata:
labels:
runners.unkin.net/scale-set: iuclabs-k8s
spec:
serviceAccountName: runner
automountServiceAccountToken: false
restartPolicy: Never
securityContext:
runAsNonRoot: true
runAsUser: 1001
runAsGroup: 1001
seccompProfile:
type: RuntimeDefault
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
runners.unkin.net/scale-set: iuclabs-k8s
containers:
- name: runner
image: ghcr.io/actions/actions-runner:2.338.2
command: ["/home/runner/run.sh"]
env:
- name: ACTIONS_RUNNER_HOOK_JOB_STARTED
value: /hooks/job-started.sh
- name: NODE_EXTRA_CA_CERTS
value: /etc/vault-ca/ca.crt
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
resources:
requests:
cpu: 1
memory: 512Mi
limits:
cpu: 2
memory: 2Gi
volumeMounts:
- name: hooks
mountPath: /hooks
readOnly: true
- name: vault-ca-cert
mountPath: /etc/vault-ca
readOnly: true
volumes:
- name: hooks
configMap:
name: runner-hooks
defaultMode: 0555
- name: vault-ca-cert
secret:
secretName: vault-ca-cert
-26
View File
@@ -1,26 +0,0 @@
#!/bin/sh
set -eu
event="${GITHUB_EVENT_NAME:-}"
refuse() {
echo "job-started hook: refusing '${event}' job: $1" >&2
exit 1
}
[ -r "${GITHUB_EVENT_PATH:-}" ] || refuse "event payload missing"
jq -e 'type == "object"' "${GITHUB_EVENT_PATH}" >/dev/null 2>&1 || refuse "event payload unparseable"
case "${event}" in
push | workflow_dispatch | schedule | merge_group | release) ;;
pull_request)
trusted=$(jq -r '
.pull_request.head.repo.full_name as $head
| if $head == null then false
elif $head == .repository.full_name then true
else (.pull_request.author_association | IN("OWNER", "MEMBER", "COLLABORATOR"))
end' "${GITHUB_EVENT_PATH}") || refuse "event payload unreadable"
[ "${trusted}" = true ] || refuse "pull request from untrusted fork"
;;
*) refuse "event not allowed on self-hosted runners" ;;
esac
@@ -1,22 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- vaultauth.yaml
- vaultstaticsecret.yaml
- networkpolicy.yaml
- rbac.yaml
components:
- components/iuclabs-k8s
generatorOptions:
disableNameSuffixHash: true
configMapGenerator:
- name: runner-hooks
namespace: iuclabs-runners
files:
- job-started.sh
-5
View File
@@ -1,5 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: iuclabs-runners
@@ -1,34 +0,0 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny
namespace: iuclabs-runners
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-dns
namespace: iuclabs-runners
spec:
podSelector: {}
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
-44
View File
@@ -1,44 +0,0 @@
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: runner
namespace: iuclabs-runners
automountServiceAccountToken: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: arc-manager
namespace: iuclabs-runners
finalizers:
- actions.github.com/cleanup-protection
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["create", "delete", "get"]
- apiGroups: [""]
resources: ["pods/status"]
verbs: ["get"]
- apiGroups: [""]
resources: ["secrets", "serviceaccounts"]
verbs: ["create", "delete", "get", "list", "patch", "update"]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: ["roles", "rolebindings"]
verbs: ["create", "delete", "get", "patch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: arc-manager
namespace: iuclabs-runners
finalizers:
- actions.github.com/cleanup-protection
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: arc-manager
subjects:
- kind: ServiceAccount
name: arc-gha-rs-controller
namespace: arc-system
-18
View File
@@ -1,18 +0,0 @@
---
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultAuth
metadata:
name: default
namespace: iuclabs-runners
spec:
allowedNamespaces:
- iuclabs-runners
kubernetes:
audiences:
- vault
role: default
serviceAccount: default
tokenExpirationSeconds: 600
method: kubernetes
mount: k8s/au/syd1
vaultConnectionRef: vso-system/default
@@ -1,17 +0,0 @@
---
apiVersion: secrets.hashicorp.com/v1beta1
kind: VaultStaticSecret
metadata:
name: github-app
namespace: iuclabs-runners
spec:
destination:
create: true
name: github-app
overwrite: true
hmacSecretData: true
mount: kv
path: kubernetes/namespace/iuclabs-runners/default/github-app
refreshAfter: 5m
type: kv-v2
vaultAuthRef: default
+1 -1
View File
@@ -55,7 +55,7 @@ spec:
- name: PAPERCLIP_STORAGE_S3_REGION
value: us-east-1
- name: PAPERCLIP_STORAGE_S3_ENDPOINT
value: https://s3.ceph.unkin.net
value: https://radosgw.service.consul
- name: PAPERCLIP_STORAGE_S3_FORCE_PATH_STYLE
value: "true"
- name: NODE_EXTRA_CA_CERTS
+4 -4
View File
@@ -85,7 +85,7 @@ spec:
archive_mode: "on"
archive_timeout: 5min
dynamic_shared_memory_type: posix
effective_cache_size: 1GB
effective_cache_size: 256MB
full_page_writes: "on"
log_destination: csvlog
log_directory: /controller/log
@@ -98,7 +98,7 @@ spec:
max_parallel_workers: "16"
max_replication_slots: "16"
max_worker_processes: "16"
shared_buffers: 256MB
shared_buffers: 128MB
shared_memory_type: mmap
ssl_max_protocol_version: TLSv1.3
ssl_min_protocol_version: TLSv1.3
@@ -127,10 +127,10 @@ spec:
resources:
limits:
cpu: 500m
memory: 2Gi
memory: 512Mi
requests:
cpu: 50m
memory: 1Gi
memory: 256Mi
smartShutdownTimeout: 180
startDelay: 3600
stopDelay: 1800
@@ -93,8 +93,6 @@ spec:
- mountPath: /opt/puppetlabs/server/data/puppetdb/stockpile
name: puppetdb-storage
subPathExpr: stockpile/$(POD_NAME)
- mountPath: /opt/puppetlabs/server/data/puppetdb/logs
name: puppetdb-logs
- mountPath: /etc/puppetlabs/puppetdb/conf.d/read-database.conf
name: puppetdb-read-database-conf
subPath: read-database.conf
@@ -193,9 +191,6 @@ spec:
- name: puppetdb-storage
persistentVolumeClaim:
claimName: puppetserver-puppetdb-claim
- name: puppetdb-logs
emptyDir:
sizeLimit: 512Mi
- name: puppetdb-read-database-conf
configMap:
name: puppetdb-read-database-conf
@@ -202,7 +202,7 @@ spec:
# Install the encapic ENC client (stdlib-only Go binary) to the shared
# bin volume. It replaces the uv/python ENC script, whose
# first-invocation dependency resolution failed on fresh compiler pods.
ENCAPIC_VERSION=v0.4.0
ENCAPIC_VERSION=v0.1.0
BASE=https://git.unkin.net/unkin/encapic/releases/download/$ENCAPIC_VERSION
cd /tmp
curl -fsSL -o encapic "$BASE/encapic_linux_amd64"
@@ -1,15 +0,0 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../../base/arc-system
helmCharts:
- name: gha-runner-scale-set-controller
repo: oci://artifactapi.k8s.syd1.au.unkin.net/ghcr/actions/actions-runner-controller-charts
version: "0.15.1"
releaseName: arc
namespace: arc-system
valuesFile: values.yaml
includeCRDs: true
@@ -1,39 +0,0 @@
---
replicaCount: 2
podSecurityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: gha-rs-controller
app.kubernetes.io/instance: arc
flags:
logLevel: info
logFormat: json
metrics:
controllerManagerAddr: ":8080"
listenerAddr: ":8080"
listenerEndpoint: "/metrics"
+1 -1
View File
@@ -50,7 +50,7 @@ global:
- name: AUTHENTIK_STORAGE__BACKEND
value: s3
- name: AUTHENTIK_STORAGE__S3__ENDPOINT
value: https://s3.ceph.unkin.net/
value: https://radosgw.service.consul/
- name: AUTHENTIK_STORAGE__S3__BUCKET_NAME
value: authentik
- name: AUTHENTIK_STORAGE__S3__ADDRESSING_STYLE
-3
View File
@@ -16,11 +16,9 @@ spec:
- path: apps/overlays/*/bind-internal
- path: apps/overlays/*/bind-external
- path: apps/overlays/*/age-api
- path: apps/overlays/*/arc-system
- path: apps/overlays/*/cattle-system
- path: apps/overlays/*/cert-manager
- path: apps/overlays/*/certificates
- path: apps/overlays/*/ceph-system
- path: apps/overlays/*/cephrgw-system
- path: apps/overlays/*/cnpg-system
- path: apps/overlays/*/consul
@@ -33,7 +31,6 @@ spec:
- path: apps/overlays/*/grafana-system
- path: apps/overlays/*/haproxy
- path: apps/overlays/*/inteldeviceplugins-system
- path: apps/overlays/*/iuclabs-runners
- path: apps/overlays/*/jfrog
- path: apps/overlays/*/k8up-system
- path: apps/overlays/*/kanidm
-3
View File
@@ -14,7 +14,6 @@ spec:
- oci://ghcr.io/woodpecker-ci/helm/woodpecker
- oci://ghcr.io/netbox-community/netbox-chart/netbox
- oci://docker.gitea.com/charts
- oci://artifactapi.k8s.syd1.au.unkin.net/ghcr/actions/actions-runner-controller-charts/gha-runner-scale-set-controller
destinations:
- namespace: '*-system'
server: https://kubernetes.default.svc
@@ -46,8 +45,6 @@ spec:
server: https://kubernetes.default.svc
- namespace: 'haproxy'
server: https://kubernetes.default.svc
- namespace: 'iuclabs-runners'
server: https://kubernetes.default.svc
- namespace: 'jfrog'
server: https://kubernetes.default.svc
- namespace: 'kanidm'
-1
View File
@@ -1 +0,0 @@
not json {
@@ -1,11 +0,0 @@
{
"comment": {
"author_association": "NONE"
},
"issue": {
"number": 1
},
"repository": {
"full_name": "IUCLabs/app"
}
}
@@ -1,11 +0,0 @@
{
"pull_request": {
"author_association": "MEMBER",
"head": {
"repo": null
}
},
"repository": {
"full_name": "IUCLabs/app"
}
}
@@ -1,14 +0,0 @@
{
"pull_request": {
"author_association": "NONE",
"head": {
"repo": {
"fork": true,
"full_name": "evil/app"
}
}
},
"repository": {
"full_name": "IUCLabs/app"
}
}
@@ -1,14 +0,0 @@
{
"pull_request": {
"author_association": "NONE",
"head": {
"repo": {
"fork": false,
"full_name": "evil/app"
}
}
},
"repository": {
"full_name": "IUCLabs/app"
}
}
-14
View File
@@ -1,14 +0,0 @@
{
"pull_request": {
"author_association": "MEMBER",
"head": {
"repo": {
"fork": true,
"full_name": "someone/app"
}
}
},
"repository": {
"full_name": "IUCLabs/app"
}
}
@@ -1,14 +0,0 @@
{
"pull_request": {
"author_association": "CONTRIBUTOR",
"head": {
"repo": {
"fork": false,
"full_name": "IUCLabs/app"
}
}
},
"repository": {
"full_name": "IUCLabs/app"
}
}
-3
View File
@@ -1,3 +0,0 @@
{
"ref": "refs/heads/main"
}
-39
View File
@@ -1,39 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
hook=apps/base/iuclabs-runners/job-started.sh
fixtures=ci/fixtures/runner-hooks
fail=0
check() {
local want=$1 event=$2 fixture=$3 got=0
local -a env=(-u GITHUB_EVENT_NAME -u GITHUB_EVENT_PATH)
[ "$event" = - ] || env+=("GITHUB_EVENT_NAME=$event")
[ "$fixture" = - ] || env+=("GITHUB_EVENT_PATH=$fixtures/$fixture")
env "${env[@]}" "$hook" >/dev/null 2>&1 || got=1
if [ "$got" -ne "$want" ]; then
echo "FAIL: $event $fixture exit=$got want=$want" >&2
fail=1
fi
}
for e in push workflow_dispatch schedule merge_group release; do
check 0 "$e" push.json
done
check 0 pull_request pr-member.json
check 0 pull_request pr-same-repo.json
check 1 pull_request pr-fork-none.json
check 1 pull_request pr-fork-spoofed.json
check 1 pull_request pr-deleted-fork.json
check 1 pull_request push.json
for e in pull_request_target workflow_run pull_request_review pull_request_review_comment issue_comment issues discussion discussion_comment create delete unknown_event; do
check 1 "$e" pr-member.json
done
check 1 pull_request_review pr-fork-none.json
check 1 issue_comment issue-comment.json
check 1 push -
check 1 push missing.json
check 1 push invalid.txt
check 1 - push.json
exit "$fail"