feat(test-env): add 1C test environment (#11)
* feat(test-env): add 1C test environment manifests (#11) - PostgreSQL 18.x-2.1C StatefulSet with ru_RU.UTF-8 locale init - 1C server (ragent+crserver+ras) StatefulSet with stable hostname - Gitea runner Deployment with edt label for apk-ci-ng - NodePort services for external 1C access (31540-31545) - Deploy/verify script: dev/deploy-test-env.sh - config.yaml for ApplicationSet integration - test-env only in dev cluster (not in prod AppSet) * fix(test-env): use initContainer for PG data + remove custom entrypoint PVC mount on /var/lib/postgresql wipes the image's pre-built cluster. Solution: initContainer copies cluster data from image to PVC on first run. Removed custom pg-entrypoint.sh ConfigMap — image has its own. * feat(test-env): DinD sidecar for runner + auto-registration Job - Add Docker-in-Docker sidecar to gitea-runner Deployment - Add register-job.yaml: Job that obtains Gitea runner token via API, creates Secret, and scales runner to 1 - RBAC: ServiceAccount + Role/ClusterRole for cross-namespace secret access - Runner labels: edt (for apk-ci-ng), ubuntu-latest --------- Co-authored-by: XoR <xor@benadis.ru>
This commit is contained in:
98
test-env/gitea-runner/deployment.yaml
Normal file
98
test-env/gitea-runner/deployment.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: test-env-runner
|
||||
namespace: test-env
|
||||
labels:
|
||||
app: test-env-runner
|
||||
spec:
|
||||
replicas: 0 # Scaled by register-job after token is obtained.
|
||||
# NOTE: requires Docker-in-Docker (DinD) sidecar to run workflows.
|
||||
# See TODO below for DinD configuration.
|
||||
selector:
|
||||
matchLabels:
|
||||
app: test-env-runner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: test-env-runner
|
||||
spec:
|
||||
containers:
|
||||
# Docker-in-Docker sidecar (required for act_runner to execute workflows)
|
||||
- name: dind
|
||||
image: docker:27-dind
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: ""
|
||||
volumeMounts:
|
||||
- name: docker-socket
|
||||
mountPath: /var/run
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: 2Gi
|
||||
- name: runner
|
||||
image: gitea/act_runner:0.2.11
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: "unix:///var/run/docker.sock"
|
||||
- name: GITEA_INSTANCE_URL
|
||||
value: "http://gitea-http.gitea.svc.cluster.local:3000"
|
||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: test-env-runner-token
|
||||
key: token
|
||||
optional: true
|
||||
# 1C server connection variables (for workflows)
|
||||
- name: SRV1C_HOST
|
||||
value: "onec-server.test-env.svc.cluster.local"
|
||||
- name: SRV1C_PORT
|
||||
value: "1540"
|
||||
- name: RAC_HOST
|
||||
value: "onec-server.test-env.svc.cluster.local"
|
||||
- name: RAC_PORT
|
||||
value: "1545"
|
||||
- name: STORAGE_HOST
|
||||
value: "onec-server.test-env.svc.cluster.local"
|
||||
- name: STORAGE_PORT
|
||||
value: "1542"
|
||||
- name: PG_HOST
|
||||
value: "postgres.test-env.svc.cluster.local"
|
||||
- name: PG_PORT
|
||||
value: "5432"
|
||||
- name: PG_USER
|
||||
value: "usr1cv8"
|
||||
- name: PG_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: test-env-secrets
|
||||
key: pg-password
|
||||
volumeMounts:
|
||||
- name: docker-socket
|
||||
mountPath: /var/run
|
||||
- name: config
|
||||
mountPath: /config
|
||||
readOnly: true
|
||||
- name: data
|
||||
mountPath: /data
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: "2"
|
||||
memory: 2Gi
|
||||
volumes:
|
||||
- name: docker-socket
|
||||
emptyDir: {}
|
||||
- name: config
|
||||
configMap:
|
||||
name: test-env-runner-config
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
Reference in New Issue
Block a user