# Install WebSub

## Installation

* Go to Rancher -> Apps -> Repositories. Add a repository with this URL if it doesn't exist [https://openg2p.github.io/openg2p-helm](https://openg2p.github.io/openg2p-helm/rancher) (name can be given as `openg2p-extras`).
* Select the namespace which contains OpenG2P Social Registry/PBMS/other modules, in the Rancher namespace filter.
* Go to Rancher -> Apps -> Charts. Refresh all charts. Search and select WebSub. Choose name of installation like `websub`.
* Configure hostname to reach this WebSub, and Keycloak Base Url, and click "Edit Values.yaml":
  * Disable Kafka Installation under `kafka` section:

    <pre class="language-yaml" data-full-width="false"><code class="lang-yaml">...
    kafka:
      enabled: false
    ...
    </code></pre>
  * Get the name of existing Kafka service running in the namespace depending on which OpenG2P module you want to use with this WebSub instance. Example: `social-registry-kafka` . The exact service names can be checked under Rancher -> Service Discovery -> Services.
  * Replace Kafka Service name in values.yaml, against the following property. Example:

    <pre class="language-yaml" data-full-width="false"><code class="lang-yaml">...
    # kafkaInstallationName: '{{ include "common.names.fullname" .Subcharts.kafka }}'
    # Above line is replaced with the following.
    kafkaInstallationName: social-registry-kafka
    ...
    </code></pre>
* Click proceed and Finalize WebSub installation.

## Post-installation Keycloak Setup

* Assign the following realm roles to the Service Account of `openg2p-sr-<ns>` client, if this WebSub instance is required to be used with Social Registry. If required with PBMS assign to `openg2p-pbms-<ns>` client. Create the realm roles if they do not exist already.
  * `PUBLISH_WEBSUB_GROUP_CREATED_ALL_INDIVIDUAL`.
  * `PUBLISH_WEBSUB_GROUP_UPDATED_ALL_INDIVIDUAL`.
  * `PUBLISH_WEBSUB_INDIVIDUAL_CREATED_ALL_INDIVIDUAL`.
  * `PUBLISH_WEBSUB_INDIVIDUAL_UPDATED_ALL_INDIVIDUAL`.
* The role name needs to be in the form of `PUBLISH_<event_name>_ALL_INDIVIDUAL`.
  * For any additional events create and assign the roles accordingly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/operations/deployment/deployment-guide/install-websub.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
