Consuming Applications from RHCC
The intent of a Red Hat Certified Operator is to deploy and manage certified ISV application images from the Red Hat Container Catalog or a private registry. See below for examples.
For Ansible or Helm based operators, this is done simply by setting the image location in the K8s manifest templates contained within your Ansible playbook/role or Helm chart to RHCC. For golang operators, the Go struct(s) representing the Kubernetes manifest(s) of your application must have the image source set to RHCC. In the following examples, replace the example image source string with that of your published application image.
Ansible
To the RHCC image source in Ansible, we'll use an example tasks file from a role. Let's say this file is found at roles/example/tasks/main.yaml
within the operator project, and contains the following:
You can see where the image is set on the next to last line in the yaml snippet above.
Helm
In this helm example, lets assume the following deployment template exists at helm_charts/example/templates/example-deployment.yaml
:
The image is shown in the next to last line in the above gotpl snippet.
Go
Below example in Golang (snippet of pkg/apis/example/v1alpha1/types.go
from a hypothetical operator-sdk project):
In the above, the Spec field contents of the operator CR are defined, with the image field of the manifest being set by theExampleSpec.Image
field in the above example. Note that no value is actually set in the struct, though the field is shown to be user-configurable by setting the spec.image
field when creating the CR. Ideally, the image source would not be configurable, since we want to guarantee that the certified application images get pulled from RHCC. The default value for ExampleSpec.Image
gets set in pkg/apis/example/v1alpha1/defaults.go
as in the below example:
You can see the image source value in the next to last line of code in the golang snippet above.
Last updated