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:
Dear XoR
2026-03-12 12:33:50 +03:00
committed by GitHub
parent 01623cb260
commit efb2427586
16 changed files with 782 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: onec-config
namespace: test-env
data:
# HASP license server configuration
# Points to external license server for 1C client mode
nethasp.ini: |
[NH_COMMON]
NH_TCPIP = Enabled
[NH_TCPIP]
NH_SERVER_ADDR = 89.110.88.209
NH_PORT_NUMBER = 475
# 1C server entrypoint: starts ragent, crserver, ras, sshd
# Based on docker-compose env service from tester.benadis.org
entrypoint.sh: |
#!/bin/bash
set -e
ONEC_BASE="/opt/1cv8/x86_64"
# Auto-detect 1C version directory
ONEC_VER=$(ls -1 "$ONEC_BASE" | sort -V | tail -1)
ONEC_BIN="$ONEC_BASE/$ONEC_VER"
echo "=== Starting 1C:Enterprise $ONEC_VER ==="
mkdir -p /data/srv1c /data/storage
# Start ragent (cluster manager) — port 1540
$ONEC_BIN/ragent -port 1540 -regport 1541 -range 1560:1591 -d /data/srv1c &
# Start crserver (configuration repository server) — port 1542
$ONEC_BIN/crserver -port 1542 -d /data/storage &
# Wait for ragent to start, then launch RAS
sleep 3
$ONEC_BIN/ras cluster --port 1545 &
# Start SSH daemon if available
if [ -x /usr/sbin/sshd ]; then
/usr/sbin/sshd 2>/dev/null || true
fi
echo "Test environment ready (ragent:1540, crserver:1542, ras:1545)"
exec tail -f /dev/null