Skip to content

Commit 127c0a4

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 <[email protected]>
1 parent 87d8d8d commit 127c0a4

36 files changed

+1009
-306
lines changed

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: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
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"
43
integration_tests_git_base_branch: community # contains config.yaml containing pointer to community-operators index
54
integration_tests_organization: community-operators
65
integration_tests_ci_pipeline_enabled: false
76

87
integration_tests_ci_file_reviewers:
98
- rh-operator-bundle-test-e2e
9+
10+
11+
operator_pipeline_dispatcher_config:
12+
- name: Hosted pipeline for community operators
13+
events: "{{ operator_pipeline_dispatcher_hosted_pipeline_events }}"
14+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
15+
capacity:
16+
type: ocp_tekton
17+
pipeline_name: "operator-hosted-pipeline"
18+
max_capacity: "{{ operator_pipeline_dispatcher_hosted_capacity }}"
19+
namespace: "{{ oc_namespace }}"
20+
callback_url: "{{ operator_pipeline_community_pipeline_callback_url }}"
21+
22+
- name: Release pipeline for community operators
23+
events: "{{ operator_pipeline_dispatcher_release_pipeline_events }}"
24+
full_repository_name: "{{ integration_tests_git_upstream_repo }}"
25+
capacity:
26+
type: ocp_tekton
27+
pipeline_name: "operator-release-pipeline"
28+
max_capacity: "{{ operator_pipeline_dispatcher_release_capacity }}"
29+
namespace: "{{ oc_namespace }}"
30+
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: "[email protected]:{{ 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: 85 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,7 @@ 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"
46+
operator_pipeline_webhook_dispatcher_url: "https://webhook-dispatcher-{{ oc_namespace }}.{{ operator_pipeline_base_url }}/api/v1/webhooks/github-pipeline"
4547
operator_pipeline_webhook_secret: ../../vaults/common/github-webhook-secret-preprod.txt
4648

4749
kerberos_keytab_isv: ../../vaults/common/nonprod-operatorpipelines.keytab
@@ -59,3 +61,85 @@ community_operator_hosted_pipeline_registry_auth_path: ../../vaults/{{ env }}/re
5961
community_operator_pipeline_pending_namespace: "community-operator-pipeline-{{ env }}"
6062

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

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"

0 commit comments

Comments
 (0)