|
| 1 | +--- |
| 2 | +title: Creating Your Own Catalog |
| 3 | +description: Defining your own service catalogs with Plural |
| 4 | +--- |
| 5 | + |
| 6 | +## Overview |
| 7 | + |
| 8 | +{% callout severity="info" %} |
| 9 | +TLDR: skip to [Examples](/catalog/creation#examples) to see a link to our Github repository with our full default catalog for working examples |
| 10 | +{% /callout %} |
| 11 | + |
| 12 | +Plural Service Catalogs are ultimately driven off of two kubernetes custom resources: `Catalog` and `PrAutomation`. Here are examples of both: |
| 13 | + |
| 14 | +```yaml |
| 15 | +apiVersion: deployments.plural.sh/v1alpha1 |
| 16 | +kind: Catalog |
| 17 | +metadata: |
| 18 | + name: data-engineering |
| 19 | +spec: |
| 20 | + name: data-engineering |
| 21 | + category: data |
| 22 | + icon: https://docs.plural.sh/favicon-128.png |
| 23 | + author: Plural |
| 24 | + description: | |
| 25 | + Sets up OSS data infrastructure using Plural |
| 26 | + bindings: |
| 27 | + create: |
| 28 | + - groupName: developers # controls who can spawn prs from this catalog |
| 29 | +``` |
| 30 | +
|
| 31 | +```yaml |
| 32 | +apiVersion: deployments.plural.sh/v1alpha1 |
| 33 | +kind: PrAutomation |
| 34 | +metadata: |
| 35 | + name: airbyte |
| 36 | +spec: |
| 37 | + name: airbyte |
| 38 | + icon: https://plural-assets.s3.us-east-2.amazonaws.com/uploads/repos/d79a69b7-dfcd-480a-a51d-518865fd6e7c/airbyte.png |
| 39 | + identifier: mgmt |
| 40 | + documentation: | |
| 41 | + Sets up an airbyte instance for a given cloud |
| 42 | + creates: |
| 43 | + git: |
| 44 | + ref: sebastian/prod-2981-set-up-catalog-pipeline # TODO set to main |
| 45 | + folder: catalogs/data/airbyte |
| 46 | + templates: |
| 47 | + - source: helm |
| 48 | + destination: helm/airbyte/{{ context.cluster }} |
| 49 | + external: true |
| 50 | + - source: services/oauth-proxy-ingress.yaml.liquid |
| 51 | + destination: services/apps/airbyte/oauth-proxy-ingress.yaml.liquid |
| 52 | + external: true |
| 53 | + - source: "terraform/{{ context.cloud }}" |
| 54 | + destination: "terraform/apps/airbyte/{{ context.cluster }}" |
| 55 | + external: true |
| 56 | + - source: airbyte-raw-servicedeployment.yaml |
| 57 | + destination: "bootstrap/apps/airbyte/{{ context.cluster }}/airbyte-raw-servicedeployment.yaml" |
| 58 | + external: true |
| 59 | + - source: airbyte-servicedeployment.yaml |
| 60 | + destination: "bootstrap/apps/airbyte/{{ context.cluster }}/airbyte-servicedeployment.yaml" |
| 61 | + external: true |
| 62 | + - source: airbyte-stack.yaml |
| 63 | + destination: "bootstrap/apps/airbyte/{{ context.cluster }}/airbyte-stack.yaml" |
| 64 | + external: true |
| 65 | + - source: oauth-proxy-config-servicedeployment.yaml |
| 66 | + destination: "bootstrap/apps/airbyte/{{ context.cluster }}/oauth-proxy-config-servicedeployment.yaml" |
| 67 | + external: true |
| 68 | + - source: README.md |
| 69 | + destination: documentation/airbyte/README.md |
| 70 | + external: true |
| 71 | + repositoryRef: |
| 72 | + name: scaffolds |
| 73 | + catalogRef: # <-- NOTE this references the Catalog CRD |
| 74 | + name: data-engineering |
| 75 | + scmConnectionRef: |
| 76 | + name: plural |
| 77 | + title: "Setting up airbyte on cluster {{ context.cluster }} for {{ context.cloud }}" |
| 78 | + message: | |
| 79 | + Set up airbyte on {{ context.cluster }} ({{ context.cloud }}) |
| 80 | +
|
| 81 | + Will set up an airbyte deployment, including object storage and postgres setup |
| 82 | + configuration: |
| 83 | + - name: cluster |
| 84 | + type: STRING |
| 85 | + documentation: Handle of the cluster you want to deploy airbyte to. |
| 86 | + - name: stackCluster |
| 87 | + type: STRING |
| 88 | + documentation: Handle of the cluster used to run Infrastructure Stacks for provisioning the infrastructure. Defaults to the management cluster. |
| 89 | + default: mgmt |
| 90 | + - name: cloud |
| 91 | + type: ENUM |
| 92 | + documentation: Cloud provider you want to deploy airbyte to. |
| 93 | + values: |
| 94 | + - aws |
| 95 | + - name: bucket |
| 96 | + type: STRING |
| 97 | + documentation: The name of the S3/GCS/Azure Blob bucket you'll use for airbyte logs. This must be globally unique. |
| 98 | + - name: hostname |
| 99 | + type: STRING |
| 100 | + documentation: The DNS name you'll host airbyte under. |
| 101 | + - name: region |
| 102 | + type: STRING |
| 103 | + documentation: The cloud provider region you're going to use to deploy cloud resources. |
| 104 | +``` |
| 105 | +
|
| 106 | +A catalog is a container for many PRAutomations which themselves control the code-generation to accomplish the provisioning task being implemented. In this case, we're provisioning [Airbyte](https://airbyte.com/). The real work is being done in the referenced templates. |
| 107 | +
|
| 108 | +## Examples |
| 109 | +
|
| 110 | +The best way to get some inspiration on how to write your own templates is to look through some examples, and that's why we've made our default service catalog open source. You can browse it here: |
| 111 | +
|
| 112 | +https://github.com/pluralsh/scaffolds/tree/main/setup/catalogs |
0 commit comments