Skip to content

Commit a44c224

Browse files
committed
website: verify deployment internally
This checks that the website service is running and accessible from within the cluster. It doesn't check that the website is externally accessible.
1 parent b62c3db commit a44c224

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

platform/spire/resources/prometheus.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,13 @@ scrape_configs:
135135
regex: (.+)
136136
target_label: __metrics_path__
137137
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
138+
139+
- job_name: 'website-internal'
140+
scheme: https
141+
tls_config:
142+
ca_file: /etc/homeworld/authorities/kubernetes.pem
143+
cert_file: /etc/homeworld/keys/kubernetes-supervisor.pem
144+
key_file: /etc/homeworld/keys/kubernetes-supervisor.key
145+
static_configs:
146+
- targets: ['{{APISERVER}}:443']
147+
metrics_path: '/api/v1/namespaces/homeworld-website/services/homeworld-website/proxy/metrics'

platform/spire/src/seq.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def sequence_cluster(ops: command.Operations) -> None:
126126
else:
127127
ops.add_operation("verify that user-grant is working properly", iterative_verifier(verify.check_user_grant, 120.0))
128128

129+
ops.add_command(iterative_verifier(verify.check_website, 120.0))
130+
129131

130132
main_command = command.SeqMux("commands about running large sequences of cluster bring-up automatically", {
131133
"keysystem": sequence_keysystem,

platform/spire/src/verify.py

+9
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,14 @@ def check_user_grant():
354354
print("autogenerated rolebinding for user", repr(authority.UPSTREAM_USER_NAME), "passed basic check!")
355355

356356

357+
358+
@command.wrap
359+
def check_website():
360+
"verify that the self-hosted website is running"
361+
expect_prometheus_query_exact('sum(up{job="website-internal"})', 1, "website is accessible from inside the cluster")
362+
print("self-hosted website is running")
363+
364+
357365
main_command = command.Mux("commands about verifying the state of a cluster", {
358366
"keystatics": check_keystatics,
359367
"keygateway": check_keygateway,
@@ -369,4 +377,5 @@ def check_user_grant():
369377
"flannel": check_flannel,
370378
"dns-addon": check_dns,
371379
"user-grant": check_user_grant,
380+
"website": check_website,
372381
})

0 commit comments

Comments
 (0)