Hello, world!
app== getenv('APP_LABEL') ?> (= $_ENV["APP_LABEL"] ?>)
Using token " . $token . ".
Namespace variable not set (NAMESPACE).
\n"); $errors++; } if (!isset($_ENV["APP_LABEL"])) { print("App label variable not set (APP_LABEL).
\n"); $errors++; } if ($errors == 0) { $cs = curl_init("https://kubernetes.default/api/v1/namespaces/" . $_ENV["NAMESPACE"] . "/pods?labelSelector=app=" . $_ENV["APP_LABEL"]); curl_setopt($cs, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($cs, CURLOPT_RETURNTRANSFER, true); curl_setopt($cs, CURLOPT_HTTPHEADER, [ "Authorization: Bearer " . $token, "Accept: application/json" ]); $response = curl_exec($cs); print("Got pod list response:
\n");
?>
= $response ?>
Skipping pod list due to errors.
Namespace variable not set (NAMESPACE).
\n"); $errors++; } if (!isset($_ENV["SERVICE_NAME"])) { print("Service name variable not set (SERVICE_NAME).
\n"); $errors++; } if ($errors == 0) { $cs = curl_init("https://kubernetes.default/api/v1/namespaces/" . $_ENV["NAMESPACE"] . "/endpoints/" . $_ENV["SERVICE_NAME"]); curl_setopt($cs, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($cs, CURLOPT_RETURNTRANSFER, true); curl_setopt($cs, CURLOPT_HTTPHEADER, [ "Authorization: Bearer " . $token, "Accept: application/json" ]); $response = curl_exec($cs); print("Got endpoint list response:
\n");
?>
= $response ?>
Got dns query response:
\n\n");
var_dump($dnsrec);
print("\n\n");
} else {
print("
Could not look up DNS record for service.
\n"); } } else { print("Skipping service test due to errors.
\n"); } ?>