1919 options :
2020 - preflight
2121 - deploy
22+ ru_test_host :
23+ description : " Temporary RU host for local testing without public DNS"
24+ required : true
25+ default : ru-test.werf.io
26+ type : string
2227
2328env :
2429 RUN_MODE : ${{ github.event_name == 'push' && 'deploy' || github.event_name == 'workflow_dispatch' && github.event.inputs.mode || 'preflight' }}
2732 WERF_STAGES_STORAGE : " ghcr.io/werf/werfio-guides-stages"
2833 WERF_SET_ACTIVE_RELEASE : " global.active_release=2"
2934 WERFIO_GITHUB_TOKEN : " ${{ secrets.API_TOKEN }}"
35+ RU_TEST_HOST : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ru_test_host || 'ru-test.werf.io' }}
3036
3137jobs :
3238 converge-ru :
@@ -90,71 +96,17 @@ jobs:
9096 echo "field=kube.config" >> "$GITHUB_OUTPUT"
9197 echo "kubeconfig_base64=$kubeconfig_base64" >> "$GITHUB_OUTPUT"
9298
93- - name : Check RU cluster access
94- env :
95- WERF_KUBE_CONFIG_BASE64 : ${{ steps.ru_kubeconfig.outputs.kubeconfig_base64 }}
96- run : |
97- set -euo pipefail
98- . $(werf ci-env github --as-file)
99-
100- can_create_namespaces=no
101-
102- echo "== cluster-info =="
103- werf kubectl cluster-info
104-
105- echo "== namespace =="
106- if werf kubectl get ns werfio-production >/dev/null 2>&1; then
107- echo "Namespace werfio-production exists"
108- else
109- echo "Namespace werfio-production is missing"
110- echo "Can create namespaces?"
111- can_create_namespaces="$(werf kubectl auth can-i create namespaces || true)"
112- echo "$can_create_namespaces"
113- if [[ "$can_create_namespaces" != "yes" ]]; then
114- echo "No permission to create namespaces, RU rollout would fail later" >&2
115- exit 1
116- fi
117- fi
118-
119- echo "== priorityclass =="
120- if werf kubectl get priorityclass production-medium >/dev/null 2>&1; then
121- echo "PriorityClass production-medium exists"
122- else
123- echo "PriorityClass production-medium is missing"
124- exit 1
125- fi
126-
127- echo "== can-i =="
128- werf kubectl auth can-i get pods -n werfio-production
129- werf kubectl auth can-i get ingress -n werfio-production
130- werf kubectl auth can-i create deployment.apps -n werfio-production
131-
132- echo "== image pull secret =="
133- if werf kubectl get ns werfio-production >/dev/null 2>&1; then
134- if werf kubectl -n werfio-production get secret github-werfio >/dev/null 2>&1; then
135- echo "Secret github-werfio exists in werfio-production"
136- else
137- echo "Secret github-werfio is missing in werfio-production"
138- if [[ "$RUN_MODE" == "deploy" ]]; then
139- echo "Deploy mode requires github-werfio to exist in werfio-production" >&2
140- exit 1
141- fi
142- echo "This is acceptable for preflight, but deploy will fail until the secret is created."
143- fi
144-
145- echo "== existing resources =="
146- werf kubectl -n werfio-production get deploy,svc,ingress,pdb || true
147- else
148- echo "Skipping namespace-scoped resource checks because namespace is missing"
149- fi
150-
15199 - name : Render RU manifests
152100 env :
153101 WERF_KUBE_CONFIG_BASE64 : ${{ steps.ru_kubeconfig.outputs.kubeconfig_base64 }}
154102 run : |
155103 set -euo pipefail
156104 . $(werf ci-env github --as-file)
157- werf render --dev --env production --without-images --stub-tags --ignore-secret-key --set global.targetCluster=ru >/tmp/werf-render-ru.yaml
105+ werf render --dev --env production --without-images --stub-tags --ignore-secret-key \
106+ --set global.targetCluster=ru \
107+ --set productionDeploy.ru.hostOverride="$RU_TEST_HOST" \
108+ --set productionDeploy.ru.tlsEnabled=false \
109+ --set productionDeploy.ru.certificateEnabled=false >/tmp/werf-render-ru.yaml
158110
159111 echo "Rendered RU objects summary:"
160112 grep '^kind:' /tmp/werf-render-ru.yaml | sort | uniq -c | cat
@@ -163,7 +115,11 @@ jobs:
163115 if : ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'deploy') }}
164116 run : |
165117 . $(werf ci-env github --as-file)
166- werf converge --set global.targetCluster=ru
118+ werf converge \
119+ --set global.targetCluster=ru \
120+ --set productionDeploy.ru.hostOverride="$RU_TEST_HOST" \
121+ --set productionDeploy.ru.tlsEnabled=false \
122+ --set productionDeploy.ru.certificateEnabled=false
167123 env :
168124 WERF_NAMESPACE : " werfio-production"
169125 WERF_RELEASE : " werfio-site-production"
@@ -184,10 +140,12 @@ jobs:
184140 - Secret path: projects/data/b454e6aa-39f0-45f4-aa7c-a9465ab154cb/KUBE_CONFIG_RU
185141 - Secret field used: ${{ steps.ru_kubeconfig.outputs.field }}
186142 - Helm switch: global.targetCluster=ru
143+ - Temporary RU host: $RU_TEST_HOST
144+ - TLS for RU test host: disabled
145+ - Certificate for RU test host: disabled
187146
188147 On push to branch `chore/prod-split-ru-eu`, this workflow performs a real RU deploy.
189- Missing namespace is allowed if the token can create namespaces.
190- Missing imagePullSecret is allowed only for preflight and blocks deploy.
148+ RU deploy uses a temporary host and does not request a public certificate until DNS cutover.
191149 Current old production cluster was not modified by this workflow.
192150 EOF
193151
@@ -199,4 +157,15 @@ jobs:
199157
200158
201159
160+
161+
162+
163+
164+
165+
166+
167+
168+
169+
170+
202171
0 commit comments