This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.2. Deploying a sample service
To test monitoring your own services, you can deploy a sample service.
Procedure
-
Create a YAML file for the service configuration. In this example, it is called
prometheus-example-app.yaml
. Fill the file with the configuration for deploying the service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This configuration deploys a service named
prometheus-example-app
in thens1
project. This service exposes the customversion
metric.Apply the configuration file to the cluster:
oc apply -f prometheus-example-app.yaml
$ oc apply -f prometheus-example-app.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow It will take some time to deploy the service.
You can check that the service is running:
oc -n ns1 get pod
$ oc -n ns1 get pod
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE prometheus-example-app-7857545cb7-sbgwq 1/1 Running 0 81m
NAME READY STATUS RESTARTS AGE prometheus-example-app-7857545cb7-sbgwq 1/1 Running 0 81m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow