Skip to content

Commit fdca7a9

Browse files
janiszksurabhi91
authored andcommitted
ROX-28735: use service instead of pod (#16649)
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
1 parent ce1549c commit fdca7a9

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

scripts/ci/create-webhookserver.sh

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,16 @@ create_webhook_server_port_forward() {
3333
# Ensure webhookserver state is stable before continuing with port forward.
3434
kubectl rollout status deployment webhookserver --namespace stackrox --timeout=5m --watch=true
3535

36-
local pod
37-
pod="$(kubectl -n stackrox get pod -l app=webhookserver -o name)"
38-
echo "Got pod ${pod}"
39-
[[ -n "${pod}" ]]
40-
41-
kubectl -n stackrox wait --for=condition=ready "${pod}" --timeout=5m
4236
local log="${ARTIFACT_DIR:-/tmp}/webhook_server_port_forward.log"
4337
nohup "${BASH_SOURCE[0]}" restart_webhook_server_port_forward "${pod}" 0<&- &> "${log}" &
4438
sleep 1
4539
}
4640

4741
restart_webhook_server_port_forward() {
48-
local pod="$1"
49-
5042
while true
5143
do
52-
echo "INFO: $(date): Starting webhook server port-forward: ${pod} 8080"
53-
kubectl -n stackrox port-forward "${pod}" 8080:8080 || {
44+
echo "INFO: $(date): Starting webhook server port-forward: svc/webhookserver 8080"
45+
kubectl -n stackrox port-forward svc/webhookserver 8080:8080 -v=6 || {
5446
echo "WARNING: $(date): The webhook server port-forward exited with: $?"
5547
echo "Will restart in 5 seconds..."
5648
sleep 5

webhookserver/chart/templates/server.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ spec:
3939
capabilities:
4040
drop: ["NET_RAW"]
4141
readOnlyRootFilesystem: true
42+
livenessProbe:
43+
httpGet:
44+
path: /
45+
port: 8080
46+
initialDelaySeconds: 10
47+
periodSeconds: 30
48+
timeoutSeconds: 5
49+
failureThreshold: 3
50+
readinessProbe:
51+
httpGet:
52+
path: /
53+
port: 8080
54+
initialDelaySeconds: 5
55+
periodSeconds: 10
56+
timeoutSeconds: 5
57+
failureThreshold: 2
4258
volumes:
4359
- name: certs
4460
secret:

0 commit comments

Comments
 (0)