Skip to content

Commit 517824a

Browse files
author
OpenShift Bot
authored
Merge pull request #13139 from stevekuznetsov/skuznets/quieter-logging
Merged by openshift-bot
2 parents f45c2bd + 24d674c commit 517824a

File tree

1 file changed

+34
-45
lines changed

1 file changed

+34
-45
lines changed

hack/lib/start.sh

+34-45
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function os::start::internal::create_master_certs() {
6565
local openshift_executable
6666
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
6767

68-
os::log::info "Creating certificates for the OpenShift server"
69-
${openshift_executable} admin create-master-certs \
68+
os::log::debug "Creating certificates for the OpenShift server"
69+
${openshift_executable} admin ca create-master-certs \
7070
--overwrite=false \
7171
--master="${MASTER_ADDR}" \
7272
--cert-dir="${MASTER_CONFIG_DIR}" \
@@ -93,7 +93,7 @@ function os::start::internal::configure_node() {
9393
local openshift_executable
9494
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
9595

96-
os::log::info "Creating node configuration for the OpenShift server"
96+
os::log::debug "Creating node configuration for the OpenShift server"
9797
${openshift_executable} admin create-node-config \
9898
--node-dir="${NODE_CONFIG_DIR}" \
9999
--node="${KUBELET_HOST}" \
@@ -120,7 +120,7 @@ function os::start::internal::create_bootstrap_policy() {
120120
local openshift_executable
121121
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
122122

123-
os::log::info "Creating boostrap policy files for the OpenShift server"
123+
os::log::debug "Creating boostrap policy files for the OpenShift server"
124124
${openshift_executable} admin create-bootstrap-policy-file --filename="${MASTER_CONFIG_DIR}/policy.json"
125125
}
126126
readonly -f os::start::internal::create_bootstrap_policy
@@ -149,7 +149,7 @@ function os::start::internal::configure_master() {
149149
local openshift_executable
150150
openshift_executable="$(os::start::internal::openshift_executable "${version}")"
151151

152-
os::log::info "Creating master configuration for the OpenShift server"
152+
os::log::debug "Creating master configuration for the OpenShift server"
153153
${openshift_executable} start \
154154
--create-certs=false \
155155
--images="${USE_IMAGES}" \
@@ -192,7 +192,7 @@ function os::start::internal::patch_master_config() {
192192
export ADMIN_KUBECONFIG="${MASTER_CONFIG_DIR}/admin.kubeconfig"
193193
CLUSTER_ADMIN_CONTEXT=$(oc config view --config="${ADMIN_KUBECONFIG}" --flatten -o template --template='{{index . "current-context"}}'); export CLUSTER_ADMIN_CONTEXT
194194
${sudo} chmod -R a+rwX "${ADMIN_KUBECONFIG}"
195-
os::log::info "To debug: export KUBECONFIG=$ADMIN_KUBECONFIG"
195+
os::log::debug "To debug: export KUBECONFIG=$ADMIN_KUBECONFIG"
196196
}
197197
readonly -f os::start::internal::patch_master_config
198198

@@ -230,8 +230,8 @@ function os::start::server() {
230230
local controllers_version="${2:-}"
231231
local skip_node="${3:-}"
232232

233-
os::log::info "Scan of OpenShift related processes already up via ps -ef | grep openshift : "
234-
ps -ef | grep openshift
233+
os::log::debug "Scan of OpenShift related processes already up via ps -ef | grep openshift : "
234+
os::log::debug "$( ps -ef | grep openshift )"
235235

236236
mkdir -p "${LOG_DIR}"
237237

@@ -278,28 +278,26 @@ function os::start::master() {
278278

279279
mkdir -p "${LOG_DIR}"
280280

281-
os::log::info "Scan of OpenShift related processes already up via ps -ef | grep openshift : "
282-
ps -ef | grep openshift
281+
os::log::debug "Scan of OpenShift related processes already up via ps -ef | grep openshift : "
282+
os::log::debug "$( ps -ef | grep openshift )"
283283

284-
os::log::info "Starting OpenShift server"
284+
os::log::debug "Starting OpenShift server"
285285
local openshift_env=( "OPENSHIFT_PROFILE=web" "OPENSHIFT_ON_PANIC=crash" )
286286
$(os::start::internal::openshift_executable) start master \
287287
--config="${MASTER_CONFIG_DIR}/master-config.yaml" \
288288
--loglevel=4 --logspec='*importer=5' \
289289
&>"${LOG_DIR}/openshift.log" &
290290
export OS_PID=$!
291291

292-
os::log::info "OpenShift server start at: "
293-
date
292+
os::log::debug "OpenShift server start at: $( date )"
294293

295294
os::test::junit::declare_suite_start "setup/start-master"
296295
os::cmd::try_until_text "oc get --raw /healthz --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 160 * second )) 0.25
297296
os::cmd::try_until_text "oc get --raw /healthz/ready --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 160 * second )) 0.25
298297
os::cmd::try_until_success "oc get service kubernetes --namespace default --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" $(( 160 * second )) 0.25
299298
os::test::junit::declare_suite_end
300299

301-
os::log::info "OpenShift server health checks done at: "
302-
date
300+
os::log::debug "OpenShift server health checks done at: $( date )"
303301
}
304302
readonly -f os::start::master
305303

@@ -332,7 +330,7 @@ function os::start::all_in_one() {
332330
use_latest_images="false"
333331
fi
334332

335-
os::log::info "Starting OpenShift server"
333+
os::log::debug "Starting OpenShift server"
336334
local openshift_env=( "OPENSHIFT_PROFILE=web" "OPENSHIFT_ON_PANIC=crash" )
337335
local openshift_executable
338336
openshift_executable="$(os::start::internal::openshift_executable)"
@@ -345,8 +343,7 @@ function os::start::all_in_one() {
345343
&>"${LOG_DIR}/openshift.log" &
346344
export OS_PID=$!
347345

348-
os::log::info "OpenShift server start at: "
349-
date
346+
os::log::debug "OpenShift server start at: $( date )"
350347

351348
os::test::junit::declare_suite_start "setup/start-all_in_one"
352349
os::cmd::try_until_text "oc get --raw /healthz --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 80 * second )) 0.25
@@ -356,8 +353,7 @@ function os::start::all_in_one() {
356353
os::cmd::try_until_success "oc get --raw /api/v1/nodes/${KUBELET_HOST} --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" $(( 80 * second )) 0.25
357354
os::test::junit::declare_suite_end
358355

359-
os::log::info "OpenShift server health checks done at: "
360-
date
356+
os::log::debug "OpenShift server health checks done at: $( date )"
361357
}
362358
readonly -f os::start::all_in_one
363359

@@ -374,23 +370,21 @@ readonly -f os::start::all_in_one
374370
# Returns:
375371
# - export ETCD_PID
376372
function os::start::etcd() {
377-
os::log::info "Starting etcd"
373+
os::log::debug "Starting etcd"
378374
local openshift_env=( "OPENSHIFT_ON_PANIC=crash" )
379375
local openshift_executable
380376
openshift_executable="$(os::start::internal::openshift_executable)"
381377
${openshift_executable} start etcd \
382378
--config="${MASTER_CONFIG_DIR}/master-config.yaml" &>"${LOG_DIR}/etcd.log" &
383379
export ETCD_PID=$!
384380

385-
os::log::info "etcd server start at: "
386-
date
381+
os::log::debug "etcd server start at: $( date )"
387382

388383
os::test::junit::declare_suite_start "setup/start-etcd"
389384
os::cmd::try_until_success "os::util::curl_etcd '/version'" $(( 10 * second ))
390385
os::test::junit::declare_suite_end
391386

392-
os::log::info "etcd server health checks done at: "
393-
date
387+
os::log::debug "etcd server health checks done at: $( date )"
394388
}
395389
readonly -f os::start::etcd
396390

@@ -423,16 +417,14 @@ function os::start::api_server() {
423417

424418
export API_SERVER_PID=$!
425419

426-
os::log::info "OpenShift API server start at: "
427-
date
420+
os::log::debug "OpenShift API server start at: $( date )"
428421

429422
os::test::junit::declare_suite_start "setup/start-api_server"
430423
os::cmd::try_until_text "oc get --raw /healthz --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 80 * second )) 0.25
431424
os::cmd::try_until_text "oc get --raw /healthz/ready --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 160 * second )) 0.25
432425
os::test::junit::declare_suite_end
433426

434-
os::log::info "OpenShift API server health checks done at: "
435-
date
427+
os::log::debug "OpenShift API server health checks done at: $( date )"
436428
}
437429
readonly -f os::start::api_server
438430

@@ -458,8 +450,7 @@ function os::start::controllers() {
458450

459451
export CONTROLLERS_PID=$!
460452

461-
os::log::info "OpenShift controllers start at: "
462-
date
453+
os::log::debug "OpenShift controllers start at: $( date )"
463454
}
464455
readonly -f os::start::controllers
465456

@@ -487,7 +478,7 @@ function os::start::internal::start_node() {
487478

488479
mkdir -p "${LOG_DIR}"
489480

490-
os::log::info "Starting OpenShift node"
481+
os::log::debug "Starting OpenShift node"
491482
local openshift_env=( "OPENSHIFT_ON_PANIC=crash" )
492483
$(os::start::internal::openshift_executable) openshift start node \
493484
--config="${NODE_CONFIG_DIR}/node-config.yaml" \
@@ -496,15 +487,13 @@ function os::start::internal::start_node() {
496487
&>"${LOG_DIR}/node.log" &
497488
export NODE_PID=$!
498489

499-
os::log::info "OpenShift node start at: "
500-
date
490+
os::log::debug "OpenShift node start at: $( date )"
501491

502492
os::test::junit::declare_suite_start "setup/start-node"
503493
os::cmd::try_until_text "oc get --raw ${KUBELET_SCHEME}://${KUBELET_HOST}:${KUBELET_PORT}/healthz --config='${MASTER_CONFIG_DIR}/admin.kubeconfig'" 'ok' $(( 80 * second )) 0.25
504494
os::test::junit::declare_suite_end
505495

506-
os::log::info "OpenShift node health checks done at: "
507-
date
496+
os::log::debug "OpenShift node health checks done at: $( date )"
508497
}
509498
readonly -f os::start::internal::start_node
510499

@@ -591,11 +580,11 @@ readonly -f os::start::internal::determine_hostnames
591580
function os::start::internal::print_server_info() {
592581
local openshift_executable
593582
openshift_executable="$(os::start::internal::openshift_executable)"
594-
os::log::info "$(${openshift_executable} version)"
595-
os::log::info "Server logs will be at: ${LOG_DIR}"
596-
os::log::info "Config dir is: ${SERVER_CONFIG_DIR}"
597-
os::log::info "Using images: ${USE_IMAGES}"
598-
os::log::info "MasterIP is: ${MASTER_ADDR}"
583+
os::log::debug "$(${openshift_executable} version)"
584+
os::log::debug "Server logs will be at: ${LOG_DIR}"
585+
os::log::debug "Config dir is: ${SERVER_CONFIG_DIR}"
586+
os::log::debug "Using images: ${USE_IMAGES}"
587+
os::log::debug "MasterIP is: ${MASTER_ADDR}"
599588
}
600589

601590
# os::start::router installs the OpenShift router and optionally creates
@@ -613,11 +602,11 @@ function os::start::internal::print_server_info() {
613602
# Returns:
614603
# None
615604
function os::start::router() {
616-
os::log::info "Installing the router"
605+
os::log::debug "Installing the router"
617606
oadm policy add-scc-to-user privileged --serviceaccount='router' --config="${ADMIN_KUBECONFIG}"
618607
# Create a TLS certificate for the router
619608
if [[ -n "${CREATE_ROUTER_CERT:-}" ]]; then
620-
os::log::info "Generating router TLS certificate"
609+
os::log::debug "Generating router TLS certificate"
621610
oadm ca create-server-cert --hostnames="*.${API_HOST}.xip.io" \
622611
--key="${MASTER_CONFIG_DIR}/router.key" \
623612
--cert="${MASTER_CONFIG_DIR}/router.crt" \
@@ -635,7 +624,7 @@ function os::start::router() {
635624
# Set the SYN eater to make router reloads more robust
636625
if [[ -n "${DROP_SYN_DURING_RESTART:-}" ]]; then
637626
# Rewrite the DC for the router to add the environment variable into the pod definition
638-
os::log::info "Changing the router DC to drop SYN packets during a reload"
627+
os::log::debug "Changing the router DC to drop SYN packets during a reload"
639628
oc patch dc router -p '{"spec":{"template":{"spec":{"containers":[{"name":"router","securityContext":{"privileged":true}}],"securityContext":{"runAsUser": 0}}}}}'
640629
oc set env dc/router -c router DROP_SYN_DURING_RESTART=true
641630
fi
@@ -653,7 +642,7 @@ readonly -f os::start::router
653642
# None
654643
function os::start::registry() {
655644
# The --mount-host option is provided to reuse local storage.
656-
os::log::info "Installing the registry"
645+
os::log::debug "Installing the registry"
657646
# For testing purposes, ensure the quota objects are always up to date in the registry by
658647
# disabling project cache.
659648
openshift admin registry --config="${ADMIN_KUBECONFIG}" --images="${USE_IMAGES}" --enforce-quota -o json | \

0 commit comments

Comments
 (0)