Custom resources for advanced configuration

IBM® Automation foundation uses Kubernetes custom resources (CRs) for configuration. All the CRs are in the API groups that end with automation.ibm.com. These API groups have a version of v1beta1.

The following custom resources are used internally by IBM Automation foundation but awareness of them is useful for advanced configuration tasks.

Custom resource kind Purpose
Cartridge Describes a cartridge (extension) of IBM Automation foundation
CartridgeRequirements Describes the requirements of a cartridge (extension) of IBM Automation foundation
EventProcessor Describes an event processor

The custom resource definitions (CRDs) for these kinds are declared in IBM Automation foundation's ClusterServiceVersion.

Similar to a Kubernetes resource, these custom resources contain the following elements:

Note the following points about a CRD:

Cartridge

The Cartridge custom resource represents a cartridge that extends IBM Automation foundation. Complete information on Cartridge registration is found at Registration.

Cartridge CustomResourceDefinition

Cartridge YAML structure

The Cartridge definition is organized in the following structure.

apiVersion: core.automation.ibm.com/v1beta1
kind: Cartridge
metadata: ~
spec: 
  description: ~
  version: ~
status: 
  components: 
    ui: 
      endpoints: 
        caSecret: 
          secretName: ~
          key: ~
        casecret: 
          secretname: ~
          key: ~
        name: ~
        scope: ~
        type: ~
        uri: ~

Cartridge details

Cartridge sample YAML

The following example shows a Cartridge definition:

apiVersion: core.automation.ibm.com/v1beta1
kind: Cartridge
metadata:
  name: com.acme.smartdecisions-dashboard
  namespace: acme-iaf
spec:
  description: "ACME Smart Decisions Dashboard"
  version: "v1.0"
  license:
    accept: true

Cartridge status

The returned status section takes the following form:

status:
  components:
    ui:
      endpoints:
        type: UI
        name: external-route-https
        scope: External
        uri: https://iaf-system-ui.acme-iaf.acme.com
        caSecret:
          secretName: iaf-system-ui-tls-secret
          key: ca.crt
        casecret:
           secretname: iaf-system-ui-tls-secret
           key: ca.crt
  conditions:
  - lastTransitionTime: '2021-03-03T14:12:00Z'
    status: 'True'
    type: BedrockReady
  - lastTransitionTime: '2021-03-03T14:26:01Z'
    message: Cartridge successfully registered
    reason: Registered
    status: 'True'
    type: Ready

CartridgeRequirements

The CartridgeRequirements CR represents a cartridge that extends IBM Automation foundation. This CR is to be issued after the Cartridge CR is issued and need not wait until the Cartridge CR is Ready.

CartridgeRequirements CustomResourceDefinition

CartridgeRequirements YAML structure

The CartridgeRequirements definition is organized in the following structure:

apiVersion: base.automation.ibm.com/v1beta1
kind: CartridgeRequirements
metadata: 
  annotations: ~
spec: 
  requirements: ~
  externalCartridges: ~  
status: 
  components: 
    apicurio: 
      endpoints: 
        name: ~
        scope: ~
        type: ~
        uri: ~
    elasticsearch: 
      endpoints: 
        authentication: 
          secret: 
            secretName: ~
          type: ~
        caSecret: 
          key: ~
          secretName: ~
        name: ~
        scope: ~
        type: ~
        uri: ~
    kafka: 
      endpoints: 
        authentication: 
          secret: 
            secretName: ~
          type: ~
        bootstrapServers: ~
        caSecret: 
          key: ~
          secretName: ~
        name: ~
        scope: ~
        type: ~
  conditions: ~
  managedResources: ~

CartridgeRequirements details

Note:

Note: While deleting AutomationBase and CartridgeRequirements, you will have to manually delete the corresponding KafkaComposite too. See Troubleshooting for more details.

An alternative that is a temporary workaround is to include a dummy update in the CartridgeRequriements CR after AutomationBase CR shows ElasticReady status. For example, you can add the following field under the section status > components in the CartridgeRequirments CR, which triggers the reconcile again for CartridgeRequirements and all the operational data store details are updated in the CartridgeRequirements CR with a new Elasticsearch user created.

  "elasticsearch: {}"

CartridgeRequirements sample YAML

Following is an example:

apiVersion: base.automation.ibm.com/v1beta1
kind: CartridgeRequirements
metadata:
  name: acme-smartdecisions-dashboard
  namespace: acme-iaf
  annotations:
    com.ibm.automation.cartridge: com.acme.smartdecisions-dashboard
spec:
  license:
    accept: true
  version: 1.1.0
  requirements:
    - Events
    - EventProcessors (Deprecated)
    - OperationalDataStore

CartridgeRequirements status

The returned status section takes the following form:

status:
  components:
    elasticsearch:
      endpoints:
      - type: API
        name: external-route-https
        scope: External
        uri: https://iaf-system-es.acme-iaf.acme.com
        authentication:
          type: BasicSecret
          secret:
            secretName: <cartridge-technical-name>-es-<type>-auth
        caSecret:
          secretName: iaf-system-es-tls-secret
          key: ca.crt
      - type: API
        name: internal-service-https
        scope: Internal
        uri: https://iaf-system-es.acme-iaf
        authentication:
          type: BasicSecret
          secret:
            secretName: <cartridge-technical-name>-es-<type>-auth
        caSecret:
          secretName: iaf-system-es-tls-secret
          key: ca.crt
    kafka:
      endpoints:
      - type: Kafka
        name: internal-service-plain
        scope: Internal
        bootstrapServers: iaf-system-kafka.acme-iaf.svc:9092
      - type: Kafka
        name: internal-service-tls
        scope: Internal
        bootstrapServers: iaf-system-kafka.acme-iaf.svc:9093
        authentication:
          type: ScramSha512Secret
          secret:
            secretName: <cartridge-technical-name>-kafka-<type>-auth
        caSecret:
          secretName: iaf-system-kafka-tls-secret
          key: ca.crt
      - type: Kafka
        name: external-route-tls
        scope: External
        bootstrapServers: iaf-system-kafka.acme-iaf.acme.com:443
        authentication:
         type: ScramSha512Secret
          secret:
            secretName: <cartridge-technical-name>-kafka-<type>-auth
        caSecret:
          secretName: iaf-system-kafka-tls-secret
          key: ca.crt
  conditions:
  - lastTransitionTime: '2021-03-03T14:32:06Z'
    status: 'True'
    type: CartridgeReady
  - lastTransitionTime: '2021-03-03T14:31:35Z'
    status: 'True'
    type: ElasticUserReady
  - lastTransitionTime: '2021-03-03T14:32:05Z'
    status: 'True'
    type: KafkaUserReady
  - lastTransitionTime: '2021-03-04T05:01:03Z'
    message: CartridgeRequirements successfully registered
    reason: Registered
    status: 'True'
    type: Ready

Note:

Topic Sharing

The following currently applies to IBM Events only. For EventStreams, the KafkaTopic read/write permissions would be set manually using IAMs.

The field spec.externalCartridges can be provided in the CartridgeRequirements operand. The externalCartridges is a list of Cartridge names (Cartridges that already exist, or the Cartridges that will exist in the future) that are expected to provide shared data onto a predefined KafkaTopic, which would be relevant to the CartridgeRequirements corresponding to the Cartridge. Below is an example :

apiVersion: base.automation.ibm.com/v1beta1
kind: CartridgeRequirements
metadata:
  name: cartridge-requirements-a
  annotations:
    com.ibm.automation.cartridge: cartridge1-name
spec:
  license:
    accept: true
  version: vnext
  requirements:
    - Events
apiVersion: base.automation.ibm.com/v1beta1
kind: CartridgeRequirements
metadata:
  name: cartridge-requirements-b
  annotations:
    com.ibm.automation.cartridge: cartridge2-name
spec:
  license:
    accept: true
  version: vnext
  requirements:
    - Events
  externalCartridges:
    - cartridge1-name
apiVersion: base.automation.ibm.com/v1beta1
kind: CartridgeRequirements
metadata:
  name: cartridge-requirements-c
  annotations:
    com.ibm.automation.cartridge: cartridge3-name
spec:
  license:
    accept: true
  version: vnext
  requirements:
    - Events
  externalCartridges:
    - cartridge1-name
    - cartridge2-name

The above resources would have the following permissions:

Providing an externalCartridge will only allow read access to the KafkaTopics prefixed with externalCartridge.shared. Data would have to be intentionally written to the .shared KafkaTopics by the relevant Cartridge in order for it to be shared.

It should be noted that the .shared KafkaTopic is made up of the technical name of the Cartridge, rather than the full name of the Cartridge. Notice that it is cartridge1.shared rather than cartridge1-name.shared. It is important to also consider this when adding shared data to the .shared KafkaTopic.

EventProcessor

Deprecation note: Event Processing Operand versions 1.0.0 and 2.0.0 are now deprecated in favour of Event Processing Operand version 3.0.0. However, you can continue to use these Operand versions until they are removed in 6 months from the release of IBM Automation foundation v1.2.

EventProcessor CustomResourceDefinition

EventProcessor YAML structure

The EventProcessor definition is organized in the following structure:

apiVersion: eventprocessing.automation.ibm.com/v1beta1
kind: EventProcessor
metadata: 
  annotations: ~
spec: 
  flink: 
    audit: ~
    authentication: ~
    env: ~
    image: ~
    jobManager: 
      nodeSelector: ~
      template: 
        pod: 
          metadata: 
            annotations: ~
          spec: 
            affinity: ~
            containers: 
              image: ~
              imagePullPolicy: ~
              name: ~
              resources: ~
            tolerations: ~
    logConfig: 
      log4j-console.properties: ~
      logback-console.xml: ~
    monitoring: ~
    properties: ~
    serviceAccountName: ~
    storage: 
      class: ~
      fsGroup: ~
      selector: ~
      size: ~
      supplementalGroups: ~
      volumeClaimTemplate: ~
    taskManager: 
      nodeSelector: ~
      replicas: ~
      template: 
        pod: 
          metadata: 
            annotations: ~
          spec: 
            affinity: ~
            containers: 
              image: ~
              imagePullPolicy: ~
              name: ~
              resources: ~
            tolerations: ~
    tls: 
      caSecret: 
        key: ~
        secretName: ~
      issuerRef: 
        group: ~
        kind: ~
        name: ~
    volumeMounts: ~
    volumes: ~
  license: ~
  version: ~
status: 
  conditions: ~
  endpoints: 
    authentication: 
      secretName: ~
      type: ~
    caSecret: 
      key: ~
      secretName: ~
    name: ~
    scope: ~
    type: ~
    uri: ~

EventProcessor details

EventProcessor sample YAML

The following example shows an EventProcessor definition:

apiVersion: eventprocessing.automation.ibm.com/v1beta1
kind: EventProcessor
metadata:
  name: acme-smartdecisions-eventprocessor
  namespace: acme-cp4a
  annotations:
    com.ibm.automation.cartridge: com.acme.smartdecisions-dashboard
spec:
  version: "v2.0"
  license:
    accept: true
  flink:
    tls: {}
    authentication: {}
    taskManager:
      replicas: 2
  ...
status:
  endpoints:
    - name: FlinkJobManager
      type: API
      scope: Internal
      uri: https://some-service.namespace.svc:8081
      caSecret:
        secretName: my-ca-secret
        key: ca.crt
      authentication:
        type: BasicSecret
        secretName: my-auth-secret
  conditions:
    - lastTransitionTime: '2021-03-04T11:04:13Z'
      message: Event Processor is ready
      reason: Created
      status: 'True'
      type: Ready
    - lastTransitionTime: '2021-03-04T11:04:13Z'
      message: Default credentials should be updated for security reasons
      reason: RandomlyGeneratedJobManagerCredentials
      status: 'True'
      type: Warning

For more information about event processors, see Event Processors section.