Skip to content

Commit 032ca95

Browse files
committed
Turn locals into vars, and add a staging setup
1 parent 440808e commit 032ca95

File tree

5 files changed

+79
-63
lines changed

5 files changed

+79
-63
lines changed

config/staging.yaml

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
projectName: binderhub-288415
1+
projectName: staging
22

33
# binderhubEnabled: false
44

55
binderhub:
66
config:
77
BinderHub:
88
pod_quota: 20
9-
hub_url: https://hub.gke2.staging.mybinder.org
9+
hub_url: https://hub.ovh.staging.mybinder.org
1010
badge_base_url: https://staging.mybinder.org
11-
image_prefix: us-central1-docker.pkg.dev/binderhub-288415/staging/r2d-2023-04-
11+
image_prefix: 985ed7pp.c1.va1.container-registry.ovh.us/mybinder-builds/
1212
sticky_builds: true
13-
DockerRegistry:
14-
token_url: "https://us-central1-docker.pkg.dev/v2/token"
15-
16-
registry:
17-
url: "https://us-central1-docker.pkg.dev"
18-
username: "_json_key"
1913

2014
extraEnv:
2115
EVENT_LOG_NAME: "binderhub-staging-events-text"
@@ -25,12 +19,6 @@ binderhub:
2519
cpu: 0.1
2620
memory: 512Mi
2721

28-
hpa:
29-
enabled: true
30-
maxReplicas: 3
31-
minReplicas: 1
32-
targetCPU: 90 # 90% of cpu request, so 90m CPU
33-
3422
dind:
3523
resources:
3624
requests:
@@ -42,8 +30,7 @@ binderhub:
4230

4331
ingress:
4432
hosts:
45-
- gke.staging.mybinder.org
46-
- gke2.staging.mybinder.org
33+
- ovh.staging.mybinder.org
4734

4835
jupyterhub:
4936
hub:
@@ -60,13 +47,11 @@ binderhub:
6047
limit: 0.5
6148
ingress:
6249
hosts:
63-
- hub.gke.staging.mybinder.org
64-
- hub.gke2.staging.mybinder.org
50+
- hub.ovh.staging.mybinder.org
6551
tls:
6652
- secretName: kubelego-tls-jupyterhub-staging
6753
hosts:
68-
- hub.gke.staging.mybinder.org
69-
- hub.gke2.staging.mybinder.org
54+
- hub.ovh.staging.mybinder.org
7055
scheduling:
7156
userPlaceholder:
7257
replicas: 1
@@ -87,12 +72,10 @@ minesweeper:
8772
grafana:
8873
ingress:
8974
hosts:
90-
- grafana.staging.mybinder.org
91-
- grafana.gke2.staging.mybinder.org
75+
- grafana.ovh.staging.mybinder.org
9276
tls:
9377
- hosts:
94-
- grafana.staging.mybinder.org
95-
- grafana.gke2.staging.mybinder.org
78+
- grafana.ovh.staging.mybinder.org
9679
secretName: kubelego-tls-grafana
9780
datasources:
9881
datasources.yaml:
@@ -101,7 +84,7 @@ grafana:
10184
- name: prometheus
10285
orgId: 1
10386
type: prometheus
104-
url: https://prometheus.staging.mybinder.org
87+
url: https://prometheus.ovh.staging.mybinder.org
10588
isDefault: true
10689
editable: false
10790
persistence:
@@ -111,12 +94,10 @@ prometheus:
11194
server:
11295
ingress:
11396
hosts:
114-
- prometheus.staging.mybinder.org
115-
- prometheus.gke2.staging.mybinder.org
97+
- prometheus.ovh.staging.mybinder.org
11698
tls:
11799
- hosts:
118-
- prometheus.staging.mybinder.org
119-
- prometheus.gke2.staging.mybinder.org
100+
- prometheus.ovh.staging.mybinder.org
120101
secretName: kubelego-tls-prometheus
121102
persistentVolume:
122103
size: 12G
@@ -126,8 +107,8 @@ prometheus:
126107
ingress-nginx:
127108
controller:
128109
replicaCount: 2
129-
service:
130-
loadBalancerIP: 35.222.35.25
110+
# service:
111+
# loadBalancerIP: 35.222.35.25
131112
resources:
132113
requests:
133114
cpu: 10m
@@ -139,8 +120,7 @@ ingress-nginx:
139120
static:
140121
ingress:
141122
hosts:
142-
- static.staging.mybinder.org
143-
- static.gke2.staging.mybinder.org
123+
- static.ovh.staging.mybinder.org
144124

145125
redirector:
146126
enabled: true
@@ -156,14 +136,13 @@ matomo:
156136
instanceName: binderhub-288415:us-central1:matomo-staging
157137
trustedHosts:
158138
- staging.mybinder.org
159-
- gke2.staging.mybinder.org
160139
ingress:
161140
hosts:
162141
- staging.mybinder.org
163-
- gke2.staging.mybinder.org
164142

165143
analyticsPublisher:
166-
enabled: true
144+
# FIXME: Enable this
145+
enabled: false
167146
project: binderhub-288415
168147
destinationBucket: binder-staging-events-archive
169148
events:
@@ -177,7 +156,8 @@ analyticsPublisher:
177156
sourceBucket: binder-billing-archive
178157

179158
gcsProxy:
180-
enabled: true
159+
# FIXME: Enable this
160+
enabled: false
181161
buckets:
182162
- name: binder-staging-events-archive
183163
host: archive.analytics.gke2.staging.mybinder.org
@@ -197,12 +177,7 @@ federationRedirect:
197177
hosts:
198178
gke:
199179
prime: true
200-
url: https://gke2.staging.mybinder.org
201-
weight: 4
202-
health: https://gke2.staging.mybinder.org/health
203-
versions: https://gke2.staging.mybinder.org/versions
204-
gesis:
205-
url: https://notebooks.gesis.org/binder
180+
url: https://ovh.staging.mybinder.org
206181
weight: 100
207-
health: https://notebooks.gesis.org/binder/health
208-
versions: https://notebooks.gesis.org/binder/versions
182+
health: https://ovh.staging.mybinder.org/health
183+
versions: https://ovh.staging.mybinder.org/versions

terraform/ovh/main.tf

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ terraform {
2121
}
2222

2323
provider "ovh" {
24-
endpoint = "ovh-us"
24+
endpoint = var.endpoint
2525
# credentials loaded via source ./secrets/ovh-creds.sh
2626
}
27-
28-
locals {
29-
# FIXME: Turn this into variables when we have more than 1
30-
service_name = "5e4c805d3c614a1085d7b7bc1fee46d6" # id of the project `mybinder-2i2c`
31-
# Locate near our hetzner nodes, just in case we want to do data transfer in the future
32-
region = "US-EAST-VA"
33-
}
34-

terraform/ovh/registry.tf

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
data "ovh_cloud_project_capabilities_containerregistry_filter" "registry_plan" {
2-
service_name = local.service_name
3-
# SMALL is 200GB (too small)
4-
# MEDIUM is 600GB
5-
# LARGE is 5TiB
6-
plan_name = "LARGE"
7-
region = local.region
2+
service_name = var.service_name
3+
plan_name = var.registry_plan
4+
region = var.region
85
}
96

107
resource "ovh_cloud_project_containerregistry" "registry" {
11-
service_name = local.service_name
8+
service_name = var.service_name
129
plan_id = data.ovh_cloud_project_capabilities_containerregistry_filter.registry_plan.id
1310
region = data.ovh_cloud_project_capabilities_containerregistry_filter.registry_plan.region
14-
name = "mybinder-ovh"
11+
name = var.registry_name
1512
}
1613

1714
# admin user (needed for harbor provider)

terraform/ovh/staging.tfvars

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
endpoint = "ovh-us"
2+
3+
service_name = "5e4c805d3c614a1085d7b7bc1fee46d6"
4+
region = "US-EAST-VA"
5+
6+
registry_plan = "SMALL"
7+
registry_name = "mybinder-ovh-staging"

terraform/ovh/variables.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
variable "endpoint" {
2+
type = string
3+
description = <<-EOT
4+
OVH Endpoint to use for making API calls
5+
6+
One of "ovh-us", "ovh-ca" or "ovh-eu", based on which *kind of OVH account*
7+
is being used.
8+
EOT
9+
}
10+
11+
12+
variable "region" {
13+
type = string
14+
description = <<-EOT
15+
OVH Region to put all infrastructure in
16+
EOT
17+
}
18+
19+
20+
variable "service_name" {
21+
type = string
22+
description = <<-EOT
23+
OVH Public Cloud Project ID to create infrastructure in
24+
EOT
25+
}
26+
27+
variable "registry_name" {
28+
type = string
29+
description = <<-EOT
30+
Name of the managed registry to create
31+
EOT
32+
}
33+
34+
variable "registry_plan" {
35+
type = string
36+
description = <<-EOT
37+
What registry plan to put this registry on.
38+
39+
Options are:
40+
41+
- SMALL is 200GB (too small for production loads)
42+
- MEDIUM is 600GB
43+
- LARGE is 5TiB
44+
EOT
45+
}

0 commit comments

Comments
 (0)