Skip to content

Commit 2414c3b

Browse files
committed
Deployment for webhook dispatcher app
This commit brings a deployment configuration for a new webhook dispatcher application. It consist of following parts: - postgres database - webhook dispatcher application - services, routes, secrets, pvc, configs The application deployment is fully driven by the Ansible. As part of the commit I also split the "local" user workspace into separate ansible inventory that share a data with stage but can be customized. JIRA: ISV-6109 Signed-off-by: Ales Raszka <araszka@redhat.com>
1 parent 17abd27 commit 2414c3b

34 files changed

Lines changed: 995 additions & 306 deletions

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ build-and-deploy-playground:
2121
deploy-playground:
2222
@echo "Deploying playground..."
2323
ansible-playbook \
24-
ansible/playbooks/deploy.yml \
24+
ansible/playbooks/deploy-playground.yml \
2525
-e oc_namespace=$(USER)-playground \
2626
-e integration_tests_operator_bundle_version=$(OPERATOR_VERSION) \
2727
-e operator_pipeline_image_pull_spec=$(PIPELINE_IMAGE) \
2828
-e suffix=123 \
2929
-e ocp_token=`oc whoami -t` \
3030
-e branch=$(USER) \
31+
-e operator_pipeline_github_user=$(GITHUB_USER) \
3132
-e env=stage \
3233
--skip-tags ci,import-index-images \
3334
-vv \
Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
---
22
integration_tests_operator_package_name: test-e2e-community-operator
3-
operator_pipeline_url: "https://community-operator-pipeline-{{ oc_namespace }}.apps.pipelines-stage.0ce8.p1.openshiftapps.com"
3+
operator_pipeline_webhook_dispatcher_url: "https://webhook-dispatcher-{{ oc_namespace }}.{{ operator_pipeline_base_url }}/api/v1/webhooks/github-pipeline"
44
integration_tests_git_base_branch: community # contains config.yaml containing pointer to community-operators index
55
integration_tests_organization: community-operators
66
integration_tests_ci_pipeline_enabled: false
77

88
integration_tests_ci_file_reviewers:
99
- rh-operator-bundle-test-e2e
10+
11+
12+
operator_pipeline_dispatcher_config:
13+
- name: Hosted pipeline for community operators
14+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
15+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
16+
capacity:
17+
type: ocp_tekton
18+
pipeline_name: "operator-hosted-pipeline"
19+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
20+
namespace: "{{ oc_namespace }}"
21+
callback_url: "{{ operator_pipeline_community_pipeline_callback_url }}"
22+
23+
- name: Release pipeline for community operators
24+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
25+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
26+
capacity:
27+
type: ocp_tekton
28+
pipeline_name: "operator-release-pipeline"
29+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
30+
namespace: "{{ oc_namespace }}"
31+
callback_url: "{{ operator_pipeline_community_pipeline_callback_url }}"

ansible/inventory/group_vars/operator-pipeline-integration-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,23 @@ integration_tests_git_repo_url: "git@github.com:{{ integration_tests_git_upstrea
3838

3939
# A branch name for event listener to listen to
4040
branch: "{{ integration_tests_git_upstream_branch }}"
41+
42+
operator_pipeline_dispatcher_config:
43+
- name: Hosted pipeline for certified operators
44+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
45+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
46+
capacity:
47+
type: ocp_tekton
48+
pipeline_name: "operator-hosted-pipeline"
49+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
50+
namespace: "{{ oc_namespace }}"
51+
callback_url: "{{ operator_pipeline_callback_url }}"
52+
- name: Release pipeline for certified operators
53+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
54+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
55+
capacity:
56+
type: ocp_tekton
57+
pipeline_name: "operator-release-pipeline"
58+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
59+
namespace: "{{ oc_namespace }}"
60+
callback_url: "{{ operator_pipeline_callback_url }}"

ansible/inventory/group_vars/operator-pipeline-prod.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
env: prod
33
ocp_host: https://api.pipelines-prod.ijdb.p1.openshiftapps.com:6443
4+
operator_pipeline_base_url: "apps.pipelines-prod.ijdb.p1.openshiftapps.com"
5+
46
branch: main
57
operator_pipeline_webhook_secret: ../../vaults/prod/github-webhook-secret-prod.txt
68

@@ -33,3 +35,9 @@ redhat_marketplace_index: registry.redhat.io/redhat/redhat-marketplace-index
3335

3436
# Settings for the index image bootstrap signing pipeline
3537
index_img_bootstrap_signing_pipeline_registry_auth_path: ../../vaults/common/index-bootstrap-signing-pipeline.json
38+
39+
40+
# Webhook dispatcher
41+
operator_pipeline_certified_operators_repository_name: "redhat-openshift-ecosystem/certified-operators"
42+
operator_pipeline_marketplace_operators_repository_name: "redhat-openshift-ecosystem/redhat-marketplace-operators"
43+
operator_pipeline_community_operators_repository_name: "redhat-openshift-ecosystem/community-operators-prod"

ansible/inventory/group_vars/operator-pipeline.yml

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ operator_pipeline_image_tag: latest
1414
operator_pipeline_image_pull_spec: "{{ operator_pipeline_image_repo }}:{{ operator_pipeline_image_tag }}"
1515
operator_pipeline_pending_namespace: "operator-pipeline-{{ env }}"
1616

17+
operator_pipeline_base_url: "apps.pipelines-stage.0ce8.p1.openshiftapps.com"
18+
1719
tekton_pruner_keep: 10
1820

1921
##### Secrets locations
@@ -41,7 +43,6 @@ operator_pipeline_gpg_passphrase_path: ../../vaults/{{ env }}/operator-pipeline-
4143
# SSH key for the operator pipeline bot to access git repositories
4244
operator_pipeline_bot_ssh_key_path: ../../vaults/common/github-bot-ssh
4345

44-
operator_pipeline_url: "https://operator-pipeline-{{ oc_namespace }}.apps.pipelines-stage.0ce8.p1.openshiftapps.com"
4546
operator_pipeline_webhook_secret: ../../vaults/common/github-webhook-secret-preprod.txt
4647

4748
kerberos_keytab_isv: ../../vaults/common/nonprod-operatorpipelines.keytab
@@ -59,3 +60,85 @@ community_operator_hosted_pipeline_registry_auth_path: ../../vaults/{{ env }}/re
5960
community_operator_pipeline_pending_namespace: "community-operator-pipeline-{{ env }}"
6061

6162
signing_pub_key_local_path: ../../vaults/{{ env }}/sig-key.pub
63+
64+
# Webhook dispatcher
65+
operator_pipeline_webhook_dispatcher_config_file: ../../vaults/common/webhook-dispatcher-config.yml
66+
operator_pipeline_dispatcher_hosted_pipeline_events:
67+
- labeled
68+
- opened
69+
- reopened
70+
- synchronize
71+
- ready_for_review
72+
operator_pipeline_dispatcher_release_pipeline_events:
73+
- labeled
74+
- closed
75+
76+
operator_pipeline_dispatcher_hosted_capacity: 3
77+
operator_pipeline_dispatcher_release_capacity: 3
78+
79+
operator_pipeline_callback_url: "https://operator-pipeline-{{ oc_namespace }}.{{ operator_pipeline_base_url}}"
80+
operator_pipeline_community_pipeline_callback_url: "https://community-operator-pipeline-{{ oc_namespace }}.{{ operator_pipeline_base_url }}"
81+
82+
operator_pipeline_certified_operators_repository_name: "redhat-openshift-ecosystem/certified-operators-preprod"
83+
operator_pipeline_marketplace_operators_repository_name: "redhat-openshift-ecosystem/redhat-marketplace-operators-preprod"
84+
operator_pipeline_community_operators_repository_name: "redhat-openshift-ecosystem/community-operators-pipeline-preprod"
85+
86+
operator_pipeline_dispatcher_config:
87+
- name: Hosted pipeline for certified operators
88+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
89+
full_repository_name: "{{ operator_pipeline_certified_operators_repository_name }}"
90+
capacity:
91+
type: ocp_tekton
92+
pipeline_name: "operator-hosted-pipeline"
93+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
94+
namespace: "{{ oc_namespace }}"
95+
callback_url: "{{ operator_pipeline_callback_url }}"
96+
- name: Release pipeline for certified operators
97+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
98+
full_repository_name: "{{ operator_pipeline_certified_operators_repository_name }}"
99+
capacity:
100+
type: ocp_tekton
101+
pipeline_name: "operator-release-pipeline"
102+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
103+
namespace: "{{ oc_namespace }}"
104+
callback_url: "{{ operator_pipeline_callback_url }}"
105+
106+
- name: Hosted pipeline for marketplace operators
107+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
108+
full_repository_name: "{{ operator_pipeline_marketplace_operators_repository_name }}"
109+
capacity:
110+
type: ocp_tekton
111+
pipeline_name: "operator-hosted-pipeline"
112+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
113+
namespace: "{{ oc_namespace }}"
114+
callback_url: "{{ operator_pipeline_callback_url }}"
115+
116+
- name: Release pipeline for marketplace operators
117+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
118+
full_repository_name: "{{ operator_pipeline_marketplace_operators_repository_name }}"
119+
capacity:
120+
type: ocp_tekton
121+
pipeline_name: "operator-release-pipeline"
122+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
123+
namespace: "{{ oc_namespace }}"
124+
callback_url: "{{ operator_pipeline_callback_url }}"
125+
126+
- name: Hosted pipeline for community operators
127+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
128+
full_repository_name: "{{ operator_pipeline_community_operators_repository_name }}"
129+
capacity:
130+
type: ocp_tekton
131+
pipeline_name: "operator-hosted-pipeline"
132+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
133+
namespace: "{{ oc_namespace }}"
134+
callback_url: "{{ operator_pipeline_community_pipeline_callback_url }}"
135+
136+
- name: Release pipeline for community operators
137+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
138+
full_repository_name: "{{ operator_pipeline_community_operators_repository_name }}"
139+
capacity:
140+
type: ocp_tekton
141+
pipeline_name: "operator-release-pipeline"
142+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
143+
namespace: "{{ oc_namespace }}"
144+
callback_url: "{{ operator_pipeline_community_pipeline_callback_url }}"

ansible/inventory/operator-pipeline.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ operator-pipeline-prod:
1313
operator-pipeline-prod-project:
1414

1515
operator-pipeline-stage:
16+
children:
17+
operator-pipeline-stage-env:
18+
playground-stage-env:
19+
20+
operator-pipeline-stage-env:
1621
hosts:
1722
operator-pipeline-stage-project:
1823

@@ -24,6 +29,10 @@ operator-pipeline-qa:
2429
hosts:
2530
operator-pipeline-qa-project:
2631

32+
playground-stage-env:
33+
hosts:
34+
playground-stage-project:
35+
2736
# Integration tests
2837
operator-pipeline-integration-tests:
2938
children:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Deploy playground
3+
hosts: "playground-stage-env"
4+
vars_files:
5+
- ../vaults/{{ env }}/secret-vars.yml
6+
- ../vaults/{{ env }}/ocp-token.yml
7+
roles:
8+
- operator-pipeline
9+
environment:
10+
K8S_AUTH_API_KEY: '{{ ocp_token }}'
11+
K8S_AUTH_HOST: '{{ ocp_host }}'

ansible/playbooks/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
collections:
33
- name: kubernetes.core
4-
version: 2.4.0
4+
version: 5.3.0
55
- name: community.general
66
version: 9.5.0

ansible/roles/operator-pipeline/defaults/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ index_img_bootstrap_labels:
1313
app: index-img-bootstrap
1414
suffix: "{{ suffix }}"
1515
env: "{{ env }}"
16+
17+
operator_pipeline_webhook_dispatcher_name: "webhook-dispatcher"
18+
operator_pipeline_webhook_dispatcher_db_secret_name: "{{ operator_pipeline_webhook_dispatcher_name }}-db-secret"
19+
operator_pipeline_webhook_dispatcher_pvc_name: "{{ operator_pipeline_webhook_dispatcher_name }}-db-pvc"
20+
operator_pipeline_webhook_dispatcher_config_map_name: "{{ operator_pipeline_webhook_dispatcher_name }}-config-map"
21+
operator_pipeline_webhook_dispatcher_config_file: "{{ operator_pipeline_webhook_dispatcher_name }}-config.yml"

ansible/roles/operator-pipeline/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,10 @@
8080
- signing-pipeline
8181
- bootstrap-signing
8282

83+
- name: Deploy webhook dispatcher
84+
ansible.builtin.import_tasks: tasks/webhook-dispatcher.yml
85+
tags:
86+
- webhook-dispatcher
87+
8388
- name: Import operator release webhooks
8489
ansible.builtin.import_tasks: tasks/operator-pipeline-webhooks.yml

0 commit comments

Comments
 (0)