-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add a 2i2c federation member on Hetzner #3169
Merged
+439
−23
Merged
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ff2a59b
Add a 2i2c federation member on Hetzner
yuvipanda 2a6581b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bc9ef71
Credit 2i2c
yuvipanda d6ee272
Add 2i2c to redirector
yuvipanda 4438b89
Setup a local docker registry for faster pushes / pulls
yuvipanda 595601e
Fix network policy labels
yuvipanda c30441a
Add missing registry config
yuvipanda 64e478f
Add note about local path provisioner
yuvipanda 8fb4f33
Add note about docker registry config
yuvipanda b97f254
Add registry secrets
yuvipanda 05ec4a4
Add encrypted ssh key for machine access
yuvipanda ce94809
Use hetzner object storage as backend for registry
yuvipanda 5deee2e
Run two replicas of the registry
yuvipanda 29b881a
Move storage config to right place
yuvipanda 7832301
Add to wisdom
yuvipanda 27a057a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 8490ecd
Add simple docs on k3s
yuvipanda dab0eb6
Add shared secret for registry load balancing
yuvipanda 0f979e4
Actually add the 2i2c hetzner kubeconfig file
yuvipanda 42a4edb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 51a756b
Add note about DNS
yuvipanda 7122515
Switch to newer bigger Hetzner machine
yuvipanda 42764ea
Bump up nginx memory limit
yuvipanda 0212202
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c4402bc
add hetzner-2i2c to deployment workflow
minrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
projectName: hetzner-2i2c | ||
|
||
registry: | ||
enabled: true | ||
storage: | ||
filesystem: | ||
storageClassName: "local-path" | ||
ingress: | ||
hosts: | ||
- registry.2i2c.mybinder.org | ||
|
||
cryptnono: | ||
detectors: | ||
monero: | ||
enabled: false | ||
|
||
binderhub: | ||
config: | ||
BinderHub: | ||
hub_url: https://hub.2i2c.mybinder.org | ||
badge_base_url: https://mybinder.org | ||
sticky_builds: true | ||
image_prefix: registry.2i2c.mybinder.org/i- | ||
# image_prefix: quay.io/mybinder-hetzner-2i2c/image- | ||
# build_docker_host: /var/run/dind/docker.sock | ||
# TODO: we should have CPU requests, too | ||
# use this to limit the number of builds per node | ||
# complicated: dind memory request + KubernetesBuildExecutor.memory_request * builds_per_node ~= node memory | ||
KubernetesBuildExecutor: | ||
memory_request: "2G" | ||
docker_host: /var/run/dind/docker.sock | ||
|
||
LaunchQuota: | ||
total_quota: 300 | ||
|
||
# DockerRegistry: | ||
# token_url: "https://2lmrrh8f.gra7.container-registry.ovh.net/service/token?service=harbor-registry" | ||
|
||
replicas: 1 | ||
|
||
extraVolumes: | ||
- name: secrets | ||
secret: | ||
secretName: events-archiver-secrets | ||
extraVolumeMounts: | ||
- name: secrets | ||
mountPath: /secrets | ||
readOnly: true | ||
extraEnv: | ||
GOOGLE_APPLICATION_CREDENTIALS: /secrets/service-account.json | ||
|
||
dind: {} | ||
|
||
ingress: | ||
hosts: | ||
- 2i2c.mybinder.org | ||
|
||
jupyterhub: | ||
# proxy: | ||
# chp: | ||
# resources: | ||
# requests: | ||
# cpu: "1" | ||
# limits: | ||
# cpu: "1" | ||
ingress: | ||
hosts: | ||
- hub.2i2c.mybinder.org | ||
tls: | ||
- secretName: kubelego-tls-hub | ||
hosts: | ||
- hub.2i2c.mybinder.org | ||
|
||
imageCleaner: | ||
# Use 40GB as upper limit, size is given in bytes | ||
imageGCThresholdHigh: 40e9 | ||
imageGCThresholdLow: 30e9 | ||
imageGCThresholdType: "absolute" | ||
|
||
grafana: | ||
ingress: | ||
hosts: | ||
- grafana.2i2c.mybinder.org | ||
tls: | ||
- hosts: | ||
- grafana.2i2c.mybinder.org | ||
secretName: kubelego-tls-grafana | ||
datasources: | ||
datasources.yaml: | ||
apiVersion: 1 | ||
datasources: | ||
- name: prometheus | ||
orgId: 1 | ||
type: prometheus | ||
url: https://prometheus.2i2c.mybinder.org | ||
access: direct | ||
isDefault: true | ||
editable: false | ||
# persistence: | ||
# storageClassName: csi-cinder-high-speed | ||
|
||
prometheus: | ||
server: | ||
persistentVolume: | ||
size: 50Gi | ||
retention: 30d | ||
ingress: | ||
hosts: | ||
- prometheus.2i2c.mybinder.org | ||
tls: | ||
- hosts: | ||
- prometheus.2i2c.mybinder.org | ||
secretName: kubelego-tls-prometheus | ||
|
||
ingress-nginx: | ||
controller: | ||
replicas: 1 | ||
scope: | ||
enabled: true | ||
service: | ||
loadBalancerIP: 138.199.149.127 | ||
|
||
static: | ||
ingress: | ||
hosts: | ||
- static.2i2c.mybinder.org | ||
tls: | ||
secretName: kubelego-tls-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: registry-config | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
data: | ||
config.yml: | | ||
{{ .Values.registry.config | toJson }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: registry | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
component: registry | ||
spec: | ||
replicas: {{ .Values.registry.replicas }} | ||
selector: | ||
matchLabels: | ||
app: registry | ||
release: {{ .Release.Name }} | ||
component: registry | ||
template: | ||
metadata: | ||
annotations: | ||
checksum/registry-config: {{ include (print $.Template.BasePath "/registry/configmap.yaml") . | sha256sum }} | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
component: registry | ||
spec: | ||
automountServiceAccountToken: false | ||
nodeSelector: {{ toJson .Values.registry.nodeSelector }} | ||
volumes: | ||
- name: registry-config | ||
configMap: | ||
name: registry-config | ||
- name: registry-secret | ||
secret: | ||
secretName: registry-secret | ||
- name: registry-storage | ||
persistentVolumeClaim: | ||
claimName: registry | ||
containers: | ||
- name: registry | ||
image: registry:2.8.3 | ||
volumeMounts: | ||
- name: registry-config | ||
mountPath: /etc/distribution/config.yml | ||
subPath: config.yml | ||
- name: registry-storage | ||
mountPath: /var/lib/registry | ||
- name: registry-secret | ||
mountPath: /etc/distribution/auth.htpasswd | ||
subPath: auth.htpasswd | ||
{{- with .Values.registry.resources }} | ||
resources: | ||
{{- . | toYaml | nindent 10 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: registry | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
annotations: | ||
kubernetes.io/tls-acme: "true" | ||
# things be big yo | ||
nginx.ingress.kubernetes.io/proxy-body-size: 4096m | ||
spec: | ||
ingressClassName: nginx | ||
rules: | ||
{{- range $host := .Values.registry.ingress.hosts }} | ||
- host: {{ $host }} | ||
http: | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: registry | ||
port: | ||
number: 5000 | ||
{{- end }} | ||
tls: | ||
- secretName: tls-registry | ||
hosts: | ||
{{- range $host := .Values.registry.ingress.hosts }} | ||
- {{ $host }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: registry | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
storageClassName: {{ .Values.registry.storage.filesystem.storageClassName }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: {{ .Values.registry.storage.filesystem.size }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: registry-secret | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
type: Opaque | ||
data: | ||
auth.htpasswd: {{ htpasswd .Values.registry.auth.username .Values.registry.auth.password | b64enc }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.registry.enabled }} | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: registry | ||
labels: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
type: {{ .Values.registry.service.type }} | ||
selector: | ||
app: registry | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
ports: | ||
- name: registry | ||
protocol: TCP | ||
port: 5000 | ||
{{- end }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future PR we should add this to the watch-dependencies workflow
mybinder.org-deploy/.github/workflows/watch-dependencies.yaml
Lines 33 to 39 in b9439b5