Skip to content

Deploy check in to prod #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/deploy-clickhouse-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
tls_cert_dir: /var/lib/dehydrated/certs
- role: clickhouse_proxy
vars:
clickhouse_url: "clickhouse3.prod.ooni.io"
clickhouse_url: "{{'clickhouse1.prod.ooni.io' if inventory_hostname == 'clickhouseproxy.prod.ooni.io' else 'clickhouse3.prod.ooni.io'}}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if should be using dev and prod groups to specify these urls differently

clickhouse_port: 9000
clickhouse_proxy_public_fqdn: "{{ inventory_hostname }}"
- role: prometheus_node_exporter
Expand Down
2 changes: 2 additions & 0 deletions ansible/group_vars/clickhouse/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ nftables_clickhouse_allow:
ip: 5.9.112.244
- fqdn: clickhouseproxy.dev.ooni.io
ip: "{{ lookup('dig', 'clickhouseproxy.dev.ooni.io/A') }}"
- fqdn: clickhouseproxy.prod.ooni.io
ip: "{{ lookup('dig', 'clickhouseproxy.prod.ooni.io/A') }}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, even moreso important here, since ideally we would not allow access to the production clickhouse from the dev environment


nftables_zookeeper_allow:
- fqdn: data1.htz-fsn.prod.ooni.nu
Expand Down
5 changes: 5 additions & 0 deletions tf/environments/prod/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ data "aws_ssm_parameter" "oonipg_url" {
name = "/oonidevops/secrets/ooni-tier0-postgres/postgresql_write_url"
}

data "aws_ssm_parameter" "clickhouse_readonly_url" {
name = "/oonidevops/secrets/clickhouse_readonly_url"
}

# Manually managed with the AWS console
data "aws_ssm_parameter" "prometheus_metrics_password" {
name = "/oonidevops/ooni_services/prometheus_metrics_password"
Expand Down Expand Up @@ -561,6 +565,7 @@ module "ooniapi_ooniprobe" {
POSTGRESQL_URL = data.aws_ssm_parameter.oonipg_url.arn
JWT_ENCRYPTION_KEY = data.aws_ssm_parameter.jwt_secret.arn
PROMETHEUS_METRICS_PASSWORD = data.aws_ssm_parameter.prometheus_metrics_password.arn
CLICKHOUSE_URL = data.aws_ssm_parameter.clickhouse_readonly_url.arn
}

ooniapi_service_security_groups = [
Expand Down
Loading