The following API definitions are part of the OCM Agent Operator, using the API group/version ocmagent.managed.openshift.io/v1alpha1.
The OcmAgent Custom Resource Definition defines the deployment of the OCM Agent on a cluster.
Usage on-cluster:
$ oc get ocmagent -n openshift-ocm-agent-operatorThe ManagedNotification Custom Resource Definition defines the notification templates that are used by the OCM Agent for sending Service Log notifications.
Usage on-cluster:
$ oc get managednotification -n openshift-ocm-agent-operatorThe OCMAgent Controller is responsible for ensuring the deployment or removal of an OCM Agent based upon the presence of an OCMAgent Custom Resource.
An OcmAgent deployment consists of:
- A
ServiceAccount(namedocm-agent) - A
RoleandRoleBinding(both namedocm-agent) that defines the OCM Agent's API permissions. - A
Deployment(namedocm-agent) which runs the ocm-agent - A
ConfigMap(name defined in theOcmAgentCR) which contains the agent's configuration. - A
Secret(name defined in theOcmAgentCR) which contains the agent's OCM access token. - A
Service(namedocm-agent) which serves the OCM Agent API - A
NetworkPolicyto only grant ingress from specific cluster clients. - A
ServiceMonitor(namedocm-agent-metrics) which makes sure that the OCM Agent metrics can be exposed to Prometheus
The controller watches for changes to the above resources in its deployed namespace, in addition to changes to the cluster pull secret (openshift-config/pull-secret) which contains the OCM Agent's auth token.
The OCM Agent Controller is also responsible for creating/removing ConfigMap resource (named ocm-agent) in the openshift-monitoring namespace.
This resource is used by the configure-alertmanager-operator to appropriately configure AlertManager to communicate to OCM Agent.
The ConfigMap contains the following items:
| Key | Description | Example |
|---|---|---|
serviceURL |
OCM Agent service URI | http://ocm-agent.openshift-ocm-agent-operator.svc.cluster.local:8081/alertmanager-receiver |
The OCM Agent Controller will monitor the cluster proxy setting and inject the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables to the OCM Agent deployment automatically based on the values of the proxy/cluster object.