Skip to content
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

[WIP] Upgrade to cert-manager from kube-lego #1162

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
258469c
Add cert-manager to meta-chart requirements.yaml
sgibson91 Sep 8, 2019
c7d42e8
Add _helpers.tpl file
sgibson91 Sep 8, 2019
8ef38b5
Add clusterissuer.yaml
sgibson91 Sep 8, 2019
8e1783c
Ignore vscode settings
sgibson91 Sep 11, 2019
a71c2a6
Switch kube-lego for cert-manager in mybinder/values.yaml
sgibson91 Sep 16, 2019
5d71a55
Allow tls-acme in mybinder/values.yaml
sgibson91 Sep 16, 2019
8510822
Rename secrets in templates/ to certmanager
sgibson91 Sep 16, 2019
e6db3cf
Add cert-manager config to staging.yaml
sgibson91 Sep 16, 2019
5094671
Correct typo
sgibson91 Sep 16, 2019
8d1c883
Merge branch 'master' into cert-manager
sgibson91 Sep 16, 2019
2afad01
Revert changing names of secrets so LetsEncrypt doesn't ban us
sgibson91 Sep 30, 2019
2a5bfa7
Replace helm chart name with correct ref
sgibson91 Sep 30, 2019
2440478
Set default issuer name to be staging in values and override it elsew…
sgibson91 Sep 30, 2019
6527d3d
Don't remove kube-lego dependency until migration is complete
sgibson91 Sep 30, 2019
9cfc3d2
Add cert-manager to meta-chart requirements.yaml
sgibson91 Sep 8, 2019
5aa11f6
Add _helpers.tpl file
sgibson91 Sep 8, 2019
4857e23
Add clusterissuer.yaml
sgibson91 Sep 8, 2019
f60223f
Ignore vscode settings
sgibson91 Sep 11, 2019
515547a
Switch kube-lego for cert-manager in mybinder/values.yaml
sgibson91 Sep 16, 2019
61aed60
Allow tls-acme in mybinder/values.yaml
sgibson91 Sep 16, 2019
1067d10
Rename secrets in templates/ to certmanager
sgibson91 Sep 16, 2019
e9d0ee3
Add cert-manager config to staging.yaml
sgibson91 Sep 16, 2019
2622b0f
Correct typo
sgibson91 Sep 16, 2019
9b2312b
Revert changing names of secrets so LetsEncrypt doesn't ban us
sgibson91 Sep 30, 2019
72bca36
Replace helm chart name with correct ref
sgibson91 Sep 30, 2019
2b4ec15
Set default issuer name to be staging in values and override it elsew…
sgibson91 Sep 30, 2019
f0313e7
Don't remove kube-lego dependency until migration is complete
sgibson91 Sep 30, 2019
f8e8925
Merge branch 'cert-manager' of https://github.com/sgibson91/mybinder.…
sgibson91 Oct 1, 2019
61a364f
Merge branch 'master' into cert-manager
sgibson91 Oct 19, 2019
cc54384
Undo changes to mybinder/templates/pdb-kube-lego.yaml
sgibson91 Oct 19, 2019
a82179f
Remove some changes to mybinder/values.yaml
sgibson91 Oct 19, 2019
6bf9f14
Remove cert-manager config from values for time being
sgibson91 Oct 19, 2019
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ mybinder/requirements.lock
docs/_build
travis/crypt-key
env

.vscode/
9 changes: 9 additions & 0 deletions config/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ binderhub:
hosts:
- gke.staging.mybinder.org
- gke2.staging.mybinder.org
tls:
- secretName: certmanager-tls-binder-staging
hosts:
- gke.staging.mybinder.org
- gke2.staging.mybinder.org

jupyterhub:
singleuser:
Expand Down Expand Up @@ -119,3 +124,7 @@ federationRedirect:
url: https://gke2.staging.mybinder.org
weight: 1
health: https://gke2.staging.mybinder.org/versions

cert-manager:
ingressShim:
defaultIssuerName: "staging"
sgibson91 marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions mybinder/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ dependencies:
- name: grafana
version: 1.18.0
repository: https://kubernetes-charts.storage.googleapis.com
- name: kube-lego
version: 0.4.2
repository: https://kubernetes-charts.storage.googleapis.com
- name: cert-manager
repository: https://charts.jetstack.io
version: v0.10.0
sgibson91 marked this conversation as resolved.
Show resolved Hide resolved
- name: binderhub
version: 0.2.0-fbbc302
repository: https://jupyterhub.github.io/helm-chart
32 changes: 32 additions & 0 deletions mybinder/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mybinder.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "mybinder.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "mybinder.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
sgibson91 marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 34 additions & 0 deletions mybinder/templates/clusterissuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: prod
labels:
helm.sh/chart: {{ include "mybinder.chart" . }}
app.kubernetes.io/name: {{ include "mybinder.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: {{ .Values.letsencrypt.contactEmail }}
privateKeySecretRef:
name: mybinder-prod-acme-key
http01: {}
---
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: staging
labels:
helm.sh/chart: {{ include "mybinder.chart" . }}
app.kubernetes.io/name: {{ include "mybinder.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: {{ .Values.letsencrypt.contactEmail }}
privateKeySecretRef:
name: mybinder-staging-acme-key
http01: {}
2 changes: 1 addition & 1 deletion mybinder/templates/gcs-proxy/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ spec:
{{- range $bucket := .Values.gcsProxy.buckets }}
- {{ $bucket.host }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion mybinder/templates/matomo/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ spec:
{{ range $host := .Values.matomo.ingress.hosts }}
- {{ $host }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions mybinder/templates/pdb-kube-lego.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: kube-lego
name: cert-manager
labels:
app: kube-lego
app: cert-manager
release: {{ .Release.Name }}
spec:
minAvailable: 0
selector:
matchLabels:
app: kube-lego
app: cert-manager
release: {{ .Release.Name }}
20 changes: 9 additions & 11 deletions mybinder/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ binderhub:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
https:
enabled: true
type: kube-lego
kubernetes.io/tls-acme: "true"

dind:
enabled: true
Expand Down Expand Up @@ -316,14 +314,14 @@ static:
- /badge.svg
- /badge_logo.svg

kube-lego:
config:
LEGO_EMAIL: [email protected]
LEGO_URL: https://acme-v01.api.letsencrypt.org/directory
rbac:
create: true
image:
tag: 0.1.7
cert-manager:
ingressShim:
defaultIssuerName: "staging"
defaultIssuerKind: "ClusterIssuer"
defaultACMEChallengeType: "http01"

letsencrypt:
contactEmail: [email protected]

grafana:
ingress:
Expand Down