anchor.diff:  endif::community[]
   
   // Type: assembly
  -// ModuleID: deploying-and-managing-debezium-postgresql-connectors
  -// Title: Deploying and managing {prodname} PostgreSQL connectors
  -[[postgresql-deploying-a-connector]]
  +// ModuleID: deployment-of-debezium-postgresql-connectors
  +// Title: Deployment of {prodname} PostgreSQL connectors
  +[[postgresql-deployment]]
   == Deployment
   
   ifdef::community[]
  
positive.code: 
  Be sure to consult the {link-kafka-docs}.html[Kafka documentation] for all of the configuration properties for Kafka producers and consumers. The PostgreSQL connector does use the {link-kafka-docs}.html#consumerconfigs[new consumer configuration properties].
  
  // Type: assembly
  // ModuleID: how-debezium-postgresql-connectors-handle-faults-and-problems
  // Title: How {prodname} PostgreSQL connectors handle faults and problems
  
negative.code: endif::community[]
  
  ifdef::product[]
  To deploy a {prodname} PostgreSQL connector, add the connector files to Kafka Connect, create a custom container to run the connector, and add connector configuration to your container. Details are in the following topics: 
  
  * xref:deploying-debezium-postgresql-connectors[]
  * xref:descriptions-of-debezium-postgresql-connector-configuration-properties[]
  
  // Type: procedure
  // ModuleID: deploying-debezium-postgresql-connectors
  // Title: Deploying {prodname} PostgreSQL connectors
  [[postgresql-deploying-a-connector]]
  === Deploying connectors
  
  To deploy a {prodname} connector, use the provided {prodname} container to build a custom Kafka Connect container image. After pushing the custom image to your container registry, create a `KafkaConnector` custom resource (CR) that configures your connector, and apply this CR to your container. 
  
  .Prerequisites
  
  * PostgreSQL is running and you performed the steps to {LinkDebeziumUserGuide}#setting-up-postgresql-to-run-a-debezium-connector[set up PostgreSQL to run a {prodname} connector].
  
  * link:https://access.redhat.com/products/red-hat-amq#streams[Red Hat AMQ Streams] was used to set up and start running Apache Kafka and Kafka Connect on OpenShift. AMQ Streams offers operators and images that bring Kafka to OpenShift. 
  
  * Podman or Docker is installed and you have sufficient rights to create and manage containers.
  
  .Procedure
  
  . Add the {prodname} PostgreSQL connector files to Kafka Connect: 
  .. Download the {prodname} link:https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=red.hat.integration&downloadType=distributions[PostgreSQL connector archive].
  
  .. Extract the {prodname} PostgreSQL connector archive to create a directory structure for the connector plug-in, for example: 
  +
  [subs="+macros"]
  ----
  pass:quotes[*tree ./my-plugins/*]
  ./my-plugins/
  ├── debezium-connector-postgresql
  │   ├── ...
  ----
  
  .. Add the plug-in's parent directory to your Kafka Connect `plugin.path`. For example, if you extracted the {prodname} PostgreSQL connector to `/kafka/connect/debezium-connector-postgresql`, execute this command: 
  +
  [source]
  ----
  plugin.path=/kafka/connect
  ----
  
  .. Restart your Kafka Connect process so that it picks up the new files in the plug-in's parent directory. 
  
  . Create and publish a custom image for running your {prodname} connector:
  
  .. Create a new `Dockerfile` by using `{DockerKafkaConnect}` as the base image. In the following example, you would replace _my-plugins_ with the name of your plug-ins directory:
  +
  [subs="+macros,+attributes"]
  ----
  FROM {DockerKafkaConnect}
  USER root:root
  pass:quotes[COPY _./my-plugins/_ /opt/kafka/plugins/]
  USER 1001
  ----
  +
  Before Kafka Connect starts running the connector, Kafka Connect loads any third-party plug-ins that are in the `/opt/kafka/plugins` directory.
  
  .. Build the container image. For example, if you saved the `Dockerfile` that you created in the previous step as `debezium-container-for-postgresql`, and if the `Dockerfile` is in the current directory, then you would run the following command:
  +
  [source,shell,options="nowrap"]
  ----
  podman build -t debezium-container-for-postgresql:latest .
  ----
  
  .. Push your custom image to your container registry, for example:
  +
  [source,shell,options="nowrap"]
  ----
  podman push debezium-container-for-postgresql:latest
  ----
  
  .. Update your Kafka environment to point to the new container image. Do this by editing your `KafkaConnect` custom resource to set the `spec.image` property to the name of the new container image. If set, this property overrides the `STRIMZI_DEFAULT_KAFKA_CONNECT_IMAGE` variable in the Cluster Operator. For example:
  +
  [source,yaml,subs="+attributes"]
  ----
  apiVersion: kafka.strimzi.io/v1beta1
  kind: KafkaConnect
  metadata:
    name: my-connect-cluster
    annotations: strimzi.io/use-connector-resources: "true"
  spec:
    image: debezium-container-for-postgresql
  ----
  +
  The `metadata.annotations` setting indicates to the Cluster Operator that `KafkaConnector` resources are used to configure connectors in this Kafka Connect cluster.
  +
  The `spec.image` setting specifies the name of the image that you created to run your {prodname} connector. 
  +
  Alternatively, you can edit the `install/cluster-operator/050-Deployment-strimzi-cluster-operator.yaml` file to set the  `STRIMZI_DEFAULT_KAFKA_CONNECT_IMAGE` variable to point to the new container image. If you edit this file you must apply it to your OpenShift cluster and then reinstall the Cluster Operator.
  
  . Create a `KafkaConnector` custom resource that configures your {prodname} PostgreSQL connector instance. Typically, you configure a {prodname} PostgreSQL connector in a `.yaml` file that sets connector configuration properties. For example, a connector configuration can produce events for a subset of the schemas and tables, or it can ignore, mask, or truncate columns that are sensitive, too large, or not needed. See the {link-prefix}:{link-postgresql-connector}#postgresql-connector-properties[complete list of PostgreSQL connector properties] that can be specified in these configurations.
  +
  The following example configures a {prodname} connector that connects to a PostgreSQL server on port 5432 at 192.168.99.100, whose logical name is `fullfillment`.
  +
  [source,yaml,options="nowrap"]
  ----
  apiVersion: kafka.strimzi.io/v1alpha1
    kind: KafkaConnector
    metadata:
      name: inventory-connector  // <1>
      labels: 
        strimzi.io/cluster: my-connect-cluster
    spec:
      class: io.debezium.connector.postgresql.PostgresConnector
      tasksMax: 1  // <2>
  