From bfccf60a37314c20ed654200d7bbc559c97a56d1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 11 Feb 2024 07:37:47 -0500 Subject: [PATCH 01/46] refactor: simplify tls handling by always redirecting --- plugins/scheduler-k3s/template.go | 11 +++++------ .../templates/chart/ingress-route.yaml | 9 ++++----- .../scheduler-k3s/templates/chart/ingress.yaml | 5 ++++- plugins/scheduler-k3s/triggers.go | 15 +++++---------- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/plugins/scheduler-k3s/template.go b/plugins/scheduler-k3s/template.go index c371daae8..3addd48d3 100644 --- a/plugins/scheduler-k3s/template.go +++ b/plugins/scheduler-k3s/template.go @@ -161,12 +161,11 @@ type ProcessCron struct { } type ProcessPortMap struct { - ContainerPort int32 `yaml:"container_port"` - HostPort int32 `yaml:"host_port"` - Scheme string `yaml:"scheme"` - Protocol PortmapProtocol `yaml:"protocol"` - Name string `yaml:"name"` - RedirectToHttps bool `yaml:"redirect_to_https"` + ContainerPort int32 `yaml:"container_port"` + HostPort int32 `yaml:"host_port"` + Scheme string `yaml:"scheme"` + Protocol PortmapProtocol `yaml:"protocol"` + Name string `yaml:"name"` } type PortmapProtocol string diff --git a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml index ca9e3f87e..f5fcbb96c 100644 --- a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml +++ b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml @@ -26,16 +26,15 @@ metadata: namespace: {{ $.Values.global.namespace }} spec: entryPoints: - {{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }} + {{- if $config.web.tls.enabled }} - websecure - {{- else }} - - web {{- end }} + - web routes: {{- range $ddx, $domain := $config.web.domains }} - kind: Rule match: Host(`{{ $domain }}`) - {{- if and $config.web.tls.enabled (and (eq $port_map.scheme "http") $port_map.redirect_to_https) }} + {{- if $config.web.tls.enabled }} middlewares: - name: {{ $.Values.global.app_name}}-{{ $processName }}-redirect-to-https namespace: {{ $.Values.global.namespace }} @@ -47,7 +46,7 @@ spec: port: {{ $port_map.name }} scheme: http {{- end }} - {{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }} + {{- if $config.web.tls.enabled }} tls: secretName: tls-{{ $.Values.global.app_name }}-{{ $processName }} {{- end }} diff --git a/plugins/scheduler-k3s/templates/chart/ingress.yaml b/plugins/scheduler-k3s/templates/chart/ingress.yaml index 36a622a8b..414022b07 100644 --- a/plugins/scheduler-k3s/templates/chart/ingress.yaml +++ b/plugins/scheduler-k3s/templates/chart/ingress.yaml @@ -18,6 +18,9 @@ metadata: {{ $k }}: {{ $v | quote }} {{- end }} {{- end }} + {{- if $config.web.tls.enabled }} + nginx.ingress.kubernetes.io/force-ssl-redirect: "true" + {{- end }} labels: app.kubernetes.io/instance: {{ $.Values.global.app_name }}-{{ $processName }} app.kubernetes.io/name: {{ $processName }} @@ -26,7 +29,7 @@ metadata: namespace: {{ $.Values.global.namespace }} spec: ingressClassName: nginx - {{- if and $config.web.tls.enabled (eq $port_map.scheme "https") }} + {{- if $config.web.tls.enabled }} tls: - hosts: {{- range $ddx, $domain := $config.web.domains }} diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index 16f824271..51caafee4 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -417,17 +417,12 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e protocol = PortmapProtocol_UDP } - redirecToHttps := false - if _, ok := portMaps[fmt.Sprintf("https-443-%d", portMap.ContainerPort)]; ok && portMap.Scheme == "http" { - redirecToHttps = true - } processValues.Web.PortMaps = append(processValues.Web.PortMaps, ProcessPortMap{ - ContainerPort: portMap.ContainerPort, - HostPort: portMap.HostPort, - Name: portMap.String(), - Protocol: protocol, - RedirectToHttps: redirecToHttps, - Scheme: portMap.Scheme, + ContainerPort: portMap.ContainerPort, + HostPort: portMap.HostPort, + Name: portMap.String(), + Protocol: protocol, + Scheme: portMap.Scheme, }) } From 433eb26f3ccbf35542e8dce5a1b5762623d3b81f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 11 Feb 2024 07:38:42 -0500 Subject: [PATCH 02/46] feat: always skip the https ingress/ingress-route/deployment port entry if there is a corresponding http entry Also inject the corresponding entries as necessary --- docs/deployment/schedulers/k3s.md | 2 +- .../templates/chart/deployment.yaml | 7 ++++++ .../templates/chart/ingress-route.yaml | 7 ++++++ .../templates/chart/ingress.yaml | 7 ++++++ plugins/scheduler-k3s/triggers.go | 24 +++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/docs/deployment/schedulers/k3s.md b/docs/deployment/schedulers/k3s.md index 540bd157d..e17a25fc7 100644 --- a/docs/deployment/schedulers/k3s.md +++ b/docs/deployment/schedulers/k3s.md @@ -243,7 +243,7 @@ dokku scheduler-k3s:set --global letsencrypt-email-prod automated@dokku.sh dokku scheduler-k3s:set --global letsencrypt-email-stag automated@dokku.sh ``` -After enabling and rebuilding, all apps with an `https` port mapping that utilize the related letsencrypt server will be automatically updated to enable ssl. All http requests will then be redirected to https. +After enabling and rebuilding, all apps with an `http:80` port mapping will have a corresponding `https:443` added and ssl will be automatically enabled. All http requests will then be redirected to https. ### Customizing the letsencrypt server diff --git a/plugins/scheduler-k3s/templates/chart/deployment.yaml b/plugins/scheduler-k3s/templates/chart/deployment.yaml index d064996fd..db957375e 100644 --- a/plugins/scheduler-k3s/templates/chart/deployment.yaml +++ b/plugins/scheduler-k3s/templates/chart/deployment.yaml @@ -1,5 +1,9 @@ {{- $processName := "PROCESS_NAME" }} {{- $config := index .Values.processes "PROCESS_NAME" }} +{{- $mappings := dict }} +{{- range $pdx, $port_map := $config.web.port_maps }} +{{- $mappings := set $mappings $port_map.name "true" }} +{{- end }} --- apiVersion: apps/v1 kind: Deployment @@ -76,6 +80,9 @@ spec: {{- if eq $processName "web" }} ports: {{- range $pdx, $port_map := $config.web.port_maps }} + {{- if and (eq $port_map.scheme "https") (hasKey $mappings (printf "http-80-%.0f" $port_map.container_port)) }} + {{- continue }} + {{- end }} - containerPort: {{ $port_map.container_port }} name: {{ $port_map.name }} protocol: {{ $port_map.protocol }} diff --git a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml index f5fcbb96c..578fa7b3c 100644 --- a/plugins/scheduler-k3s/templates/chart/ingress-route.yaml +++ b/plugins/scheduler-k3s/templates/chart/ingress-route.yaml @@ -1,7 +1,14 @@ {{- $processName := "PROCESS_NAME" }} {{- $config := index .Values.processes "PROCESS_NAME" }} {{- if and $config.web.domains (eq $.Values.global.network.ingress_class "traefik") }} +{{- $mappings := dict }} {{- range $pdx, $port_map := $config.web.port_maps }} +{{- $mappings := set $mappings $port_map.name "true" }} +{{- end }} +{{- range $pdx, $port_map := $config.web.port_maps }} +{{- if and (eq $port_map.scheme "https") (hasKey $mappings (printf "http-80-%.0f" $port_map.container_port)) }} +{{- continue }} +{{- end }} --- apiVersion: traefik.io/v1alpha1 kind: IngressRoute diff --git a/plugins/scheduler-k3s/templates/chart/ingress.yaml b/plugins/scheduler-k3s/templates/chart/ingress.yaml index 414022b07..4509cc5e2 100644 --- a/plugins/scheduler-k3s/templates/chart/ingress.yaml +++ b/plugins/scheduler-k3s/templates/chart/ingress.yaml @@ -1,7 +1,14 @@ {{- $processName := "PROCESS_NAME" }} {{- $config := index .Values.processes "PROCESS_NAME" }} {{- if and $config.web.domains (eq $.Values.global.network.ingress_class "nginx") }} +{{- $mappings := dict }} {{- range $pdx, $port_map := $config.web.port_maps }} +{{- $mappings := set $mappings $port_map.name "true" }} +{{- end }} +{{- range $pdx, $port_map := $config.web.port_maps }} +{{- if and (eq $port_map.scheme "https") (hasKey $mappings (printf "http-80-%.0f" $port_map.container_port)) }} +{{- continue }} +{{- end }} --- apiVersion: networking.k8s.io/v1 kind: Ingress diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index 51caafee4..b89be6147 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -426,6 +426,30 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e }) } + for _, portMap := range processValues.Web.PortMaps { + _, httpOk := portMaps[fmt.Sprintf("http-80-%d", portMap.ContainerPort)] + _, httpsOk := portMaps[fmt.Sprintf("https-443-%d", portMap.ContainerPort)] + if portMap.Scheme == "http" && !httpsOk && tlsEnabled { + processValues.Web.PortMaps = append(processValues.Web.PortMaps, ProcessPortMap{ + ContainerPort: portMap.ContainerPort, + HostPort: 443, + Name: fmt.Sprintf("https-443-%d", portMap.ContainerPort), + Protocol: PortmapProtocol_TCP, + Scheme: "https", + }) + } + + if portMap.Scheme == "https" && !httpOk { + processValues.Web.PortMaps = append(processValues.Web.PortMaps, ProcessPortMap{ + ContainerPort: portMap.ContainerPort, + HostPort: 80, + Name: fmt.Sprintf("http-80-%d", portMap.ContainerPort), + Protocol: PortmapProtocol_TCP, + Scheme: "http", + }) + } + } + sort.Sort(NameSorter(processValues.Web.PortMaps)) sort.Strings(processValues.Web.Domains) } From abbc13cb857eacdf0cfe30bed152de3ed0108e85 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 12 Feb 2024 01:30:17 -0500 Subject: [PATCH 03/46] fix: ensure the ingress class is properly set for certificate usage Without this, switching to nginx ingress fails as the cluster issuer isn't properly configured --- plugins/scheduler-k3s/functions.go | 20 +++++++++++--------- plugins/scheduler-k3s/triggers.go | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index 5571cb19e..540d922a3 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -149,16 +149,18 @@ func applyClusterIssuers(ctx context.Context) error { clusterIssuerValues := ClusterIssuerValues{ ClusterIssuers: map[string]ClusterIssuer{ "letsencrypt-stag": { - Email: letsencryptEmailStag, - Enabled: letsencryptEmailStag != "", - Name: "letsencrypt-stag", - Server: "https://acme-staging-v02.api.letsencrypt.org/directory", + Email: letsencryptEmailStag, + Enabled: letsencryptEmailStag != "", + IngressClass: getGlobalIngressClass(), + Name: "letsencrypt-stag", + Server: "https://acme-staging-v02.api.letsencrypt.org/directory", }, "letsencrypt-prod": { - Email: letsencryptEmailProd, - Enabled: letsencryptEmailProd != "", - Name: "letsencrypt-prod", - Server: "https://acme-v02.api.letsencrypt.org/directory", + Email: letsencryptEmailProd, + Enabled: letsencryptEmailProd != "", + IngressClass: getGlobalIngressClass(), + Name: "letsencrypt-prod", + Server: "https://acme-v02.api.letsencrypt.org/directory", }, }, } @@ -496,7 +498,7 @@ func getComputedImagePullSecrets(appName string) string { } func getGlobalIngressClass() string { - return common.PropertyGetDefault("scheduler-k3s", "global", "ingress-class", DefaultIngressClass) + return common.PropertyGetDefault("scheduler-k3s", "--global", "ingress-class", DefaultIngressClass) } func getIngressAnnotations(appName string, processType string) (map[string]string, error) { diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index b89be6147..f566e32c8 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -351,7 +351,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e }, Namespace: namespace, Network: GlobalNetwork{ - IngressClass: common.PropertyGetDefault("scheduler-k3s", "--global", "ingress-class", DefaultIngressClass), + IngressClass: getGlobalIngressClass(), PrimaryPort: primaryPort, }, Secrets: map[string]string{}, From e6c17059f9c9a17c7c00b778ca36812adcf96305 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 13:20:58 +0000 Subject: [PATCH 04/46] chore(deps): bump mvdan.cc/sh/v3 from 3.7.0 to 3.8.0 in /plugins/cron Bumps [mvdan.cc/sh/v3](https://github.com/mvdan/sh) from 3.7.0 to 3.8.0. - [Release notes](https://github.com/mvdan/sh/releases) - [Changelog](https://github.com/mvdan/sh/blob/master/CHANGELOG.md) - [Commits](https://github.com/mvdan/sh/compare/v3.7.0...v3.8.0) --- updated-dependencies: - dependency-name: mvdan.cc/sh/v3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- plugins/cron/go.mod | 2 +- plugins/cron/go.sum | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/cron/go.mod b/plugins/cron/go.mod index 350a8e950..b04455e70 100644 --- a/plugins/cron/go.mod +++ b/plugins/cron/go.mod @@ -9,7 +9,7 @@ require ( github.com/robfig/cron/v3 v3.0.1 github.com/ryanuber/columnize v2.1.2+incompatible github.com/spf13/pflag v1.0.5 - mvdan.cc/sh/v3 v3.7.0 + mvdan.cc/sh/v3 v3.8.0 ) require ( diff --git a/plugins/cron/go.sum b/plugins/cron/go.sum index 2a0307208..5ff30c28b 100644 --- a/plugins/cron/go.sum +++ b/plugins/cron/go.sum @@ -8,8 +8,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= -github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -47,8 +47,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97 h1:3RPlVWzZ/PDqmVuf/FKHARG5EMid/tl7cv54Sw/QRVY= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ryanuber/columnize v2.1.2+incompatible h1:C89EOx/XBWwIXl8wm8OPJBd7kPF25UfsK2X7Ph/zCAk= github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -107,5 +107,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg= -mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8= +mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= +mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= From 62e85cc75238d571c5b503b1b557f0aacf962269 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:03:15 +0000 Subject: [PATCH 05/46] chore(deps): bump mkdocs-material from 9.5.8 to 9.5.9 in /docs/_build Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.8 to 9.5.9. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.8...9.5.9) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- docs/_build/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_build/requirements.txt b/docs/_build/requirements.txt index eac3b515b..600271075 100644 --- a/docs/_build/requirements.txt +++ b/docs/_build/requirements.txt @@ -8,7 +8,7 @@ MarkupSafe==2.1.5 mergedeep==1.3.4 mkdocs==1.5.3 mkdocs-exclude==1.0.2 -mkdocs-material==9.5.8 +mkdocs-material==9.5.9 mkdocs-material-extensions==1.3.1 packaging==23.2 Pygments==2.17.2 From 3c5f95ff18d99b50d23cd91ada7625bc6bd13342 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 12 Feb 2024 16:28:57 -0500 Subject: [PATCH 06/46] chore: update dependencies --- plugins/scheduler-docker-local/go.mod | 2 +- plugins/scheduler-docker-local/go.sum | 12 ++++++------ plugins/scheduler-k3s/go.mod | 6 +++--- plugins/scheduler-k3s/go.sum | 24 ++++++++++++------------ 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/plugins/scheduler-docker-local/go.mod b/plugins/scheduler-docker-local/go.mod index b0cefbd34..9c8664f04 100644 --- a/plugins/scheduler-docker-local/go.mod +++ b/plugins/scheduler-docker-local/go.mod @@ -29,7 +29,7 @@ require ( github.com/ryanuber/columnize v2.1.2+incompatible // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/sys v0.17.0 // indirect - mvdan.cc/sh/v3 v3.7.0 // indirect + mvdan.cc/sh/v3 v3.8.0 // indirect ) replace github.com/dokku/dokku/plugins/app-json => ../app-json diff --git a/plugins/scheduler-docker-local/go.sum b/plugins/scheduler-docker-local/go.sum index 0adb336c8..1cfdd6e17 100644 --- a/plugins/scheduler-docker-local/go.sum +++ b/plugins/scheduler-docker-local/go.sum @@ -8,8 +8,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= -github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -47,8 +47,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97 h1:3RPlVWzZ/PDqmVuf/FKHARG5EMid/tl7cv54Sw/QRVY= -github.com/rogpeppe/go-internal v1.10.1-0.20230524175051-ec119421bb97/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ryanuber/columnize v2.1.2+incompatible h1:C89EOx/XBWwIXl8wm8OPJBd7kPF25UfsK2X7Ph/zCAk= github.com/ryanuber/columnize v2.1.2+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -105,5 +105,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg= -mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8= +mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= +mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= diff --git a/plugins/scheduler-k3s/go.mod b/plugins/scheduler-k3s/go.mod index 13ece2af9..d0dc0c499 100644 --- a/plugins/scheduler-k3s/go.mod +++ b/plugins/scheduler-k3s/go.mod @@ -28,7 +28,7 @@ require ( k8s.io/kubectl v0.28.4 k8s.io/kubernetes v1.29.1 k8s.io/utils v0.0.0-20240102154912-e7106e64919e - mvdan.cc/sh/v3 v3.7.0 + mvdan.cc/sh/v3 v3.8.0 ) require ( @@ -152,13 +152,13 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.19.0 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/term v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230911183012-2d3300fd4832 // indirect google.golang.org/grpc v1.59.0 // indirect diff --git a/plugins/scheduler-k3s/go.sum b/plugins/scheduler-k3s/go.sum index ca72ab525..96404c637 100644 --- a/plugins/scheduler-k3s/go.sum +++ b/plugins/scheduler-k3s/go.sum @@ -74,8 +74,8 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSk github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -116,8 +116,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6FI= github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4= -github.com/frankban/quicktest v1.14.5 h1:dfYrrRyLtiqT9GyKXgdh+k4inNeTvmGbuSgZ3lx3GhA= -github.com/frankban/quicktest v1.14.5/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-acme/lego/v4 v4.14.0 h1:/skZoRHgVh0d2RK7l1g3Ch8HqeqP9LB8ZEjLdGEpcDE= github.com/go-acme/lego/v4 v4.14.0/go.mod h1:zjmvNCDLGz7GrC1OqdVpVmZFKSRabEDtWbdzmcpBsGo= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= @@ -383,8 +383,8 @@ github.com/rancher/wharfie v0.6.5 h1:Xxj/ki8d4BFeQBvyViW9jX8BqxaPlZwXvRD8BG2Mm/8 github.com/rancher/wharfie v0.6.5/go.mod h1:iGXn5Y9GEhsx1h/lPUXAklK4DoY4+6NOJF+Li1j248Y= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rubenv/sql-migrate v1.5.2 h1:bMDqOnrJVV/6JQgQ/MxOpU+AdO8uzYYA/TxFUBzFtS0= github.com/rubenv/sql-migrate v1.5.2/go.mod h1:H38GW8Vqf8F0Su5XignRyaRcbXbJunSWxs+kmzlg0Is= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -500,8 +500,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= @@ -570,8 +570,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -648,8 +648,8 @@ k8s.io/kubernetes v1.29.1 h1:fxJFVb8uqbYZDYHpwIsAndBQs360cQGb0xa1gYFh3fo= k8s.io/kubernetes v1.29.1/go.mod h1:xZPKU0yO0CBbLTnbd+XGyRmmtmaVuJykDb8gNCkeeUE= k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -mvdan.cc/sh/v3 v3.7.0 h1:lSTjdP/1xsddtaKfGg7Myu7DnlHItd3/M2tomOcNNBg= -mvdan.cc/sh/v3 v3.7.0/go.mod h1:K2gwkaesF/D7av7Kxl0HbF5kGOd2ArupNTX3X44+8l8= +mvdan.cc/sh/v3 v3.8.0 h1:ZxuJipLZwr/HLbASonmXtcvvC9HXY9d2lXZHnKGjFc8= +mvdan.cc/sh/v3 v3.8.0/go.mod h1:w04623xkgBVo7/IUK89E0g8hBykgEpN0vgOj3RJr6MY= oras.land/oras-go v1.2.4 h1:djpBY2/2Cs1PV87GSJlxv4voajVOMZxqqtq9AB8YNvY= oras.land/oras-go v1.2.4/go.mod h1:DYcGfb3YF1nKjcezfX2SNlDAeQFKSXmf+qrFmrh4324= sigs.k8s.io/gateway-api v0.8.0 h1:isQQ3Jx2qFP7vaA3ls0846F0Amp9Eq14P08xbSwVbQg= From 1ae2df52f56e44ed27038ff28c24dbea40d84ef3 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 12 Feb 2024 17:15:37 -0500 Subject: [PATCH 07/46] fix: use image pull secrets instead of registries.yaml to reference private repositories While this will now more or less require a local docker login - which can be overridden by setting the image-pull-secrets property - this ensures every deploy has a valid context. One annoying thing is that the secret is per-app vs global, meaning that if the secret must be rotated, all apps need to be redeployed. A future change can fix that by deploying a global secret, or if folks really desire, this can be done by setting the image-pull-secrets property on the app/globally. --- debian/control | 2 +- docs/deployment/schedulers/k3s.md | 2 +- plugins/scheduler-k3s/Makefile | 2 +- plugins/scheduler-k3s/functions.go | 4 - plugins/scheduler-k3s/registry.go | 78 ------------- plugins/scheduler-k3s/scheduler_k3s.go | 1 - .../scheduler-k3s/src/triggers/triggers.go | 4 - plugins/scheduler-k3s/subcommands.go | 26 ----- plugins/scheduler-k3s/template.go | 1 + .../templates/chart/cron-job.yaml | 3 +- .../templates/chart/deployment.yaml | 3 +- .../templates/chart/image-pull-secret.yaml | 23 ++++ .../scheduler-k3s/templates/chart/secret.yaml | 1 + plugins/scheduler-k3s/triggers.go | 105 +++--------------- 14 files changed, 49 insertions(+), 206 deletions(-) delete mode 100644 plugins/scheduler-k3s/registry.go create mode 100644 plugins/scheduler-k3s/templates/chart/image-pull-secret.yaml diff --git a/debian/control b/debian/control index 6741050b8..c207c0b56 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Version: 0.33.5 Section: web Priority: optional Architecture: amd64 -Depends: apache2-utils, acl, locales, git, cpio, curl, man-db, netcat, sshcommand, docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-compose-plugin | moby-compose, docker-buildx-plugin | moby-buildx, docker-container-healthchecker, docker-image-labeler, lambda-builder, net-tools, netrc, software-properties-common, parallel, procfile-util, python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip, util-linux +Depends: apache2-utils, locales, git, cpio, curl, man-db, netcat, sshcommand, docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-compose-plugin | moby-compose, docker-buildx-plugin | moby-buildx, docker-container-healthchecker, docker-image-labeler, lambda-builder, net-tools, netrc, software-properties-common, parallel, procfile-util, python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip, util-linux Recommends: herokuish, bash-completion, dokku-update, dokku-event-listener Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn, sudo, python3, debconf Maintainer: Jose Diaz-Gonzalez diff --git a/docs/deployment/schedulers/k3s.md b/docs/deployment/schedulers/k3s.md index e17a25fc7..f21315f53 100644 --- a/docs/deployment/schedulers/k3s.md +++ b/docs/deployment/schedulers/k3s.md @@ -219,7 +219,7 @@ The default value may be set by passing an empty value for the option: dokku scheduler-k3s:set node-js-app image-pull-secrets ``` -The `image-pull-secrets` property can also be set globally. The global default is empty string, and k3s will use the local `registries.yaml` for any private registry pulls. +The `image-pull-secrets` property can also be set globally. The global default is empty string, and k3s will use Dokku's locally configured `~/.docker/config.json` for any private registry pulls. ```shell dokku scheduler-k3s:set --global image-pull-secrets 60s diff --git a/plugins/scheduler-k3s/Makefile b/plugins/scheduler-k3s/Makefile index 2a41b159a..50a1184af 100644 --- a/plugins/scheduler-k3s/Makefile +++ b/plugins/scheduler-k3s/Makefile @@ -1,5 +1,5 @@ SUBCOMMANDS = subcommands/initialize subcommands/cluster-add subcommands/cluster-list subcommands/cluster-remove subcommands/report subcommands/set subcommands/show-kubeconfig subcommands/uninstall -TRIGGERS = triggers/install triggers/post-app-clone-setup triggers/post-app-rename-setup triggers/post-delete triggers/post-registry-login triggers/report triggers/scheduler-deploy triggers/scheduler-enter triggers/scheduler-logs triggers/scheduler-post-delete triggers/scheduler-run triggers/scheduler-run-list triggers/scheduler-stop +TRIGGERS = triggers/install triggers/post-app-clone-setup triggers/post-app-rename-setup triggers/post-delete triggers/report triggers/scheduler-deploy triggers/scheduler-enter triggers/scheduler-logs triggers/scheduler-post-delete triggers/scheduler-run triggers/scheduler-run-list triggers/scheduler-stop BUILD = commands subcommands triggers PLUGIN_NAME = scheduler-k3s diff --git a/plugins/scheduler-k3s/functions.go b/plugins/scheduler-k3s/functions.go index 540d922a3..90b6e617e 100644 --- a/plugins/scheduler-k3s/functions.go +++ b/plugins/scheduler-k3s/functions.go @@ -1120,10 +1120,6 @@ func isK3sInstalled() error { return fmt.Errorf("k3s binary is not available") } - if !common.FileExists(RegistryConfigPath) { - return fmt.Errorf("k3s registry config is not available") - } - if !common.FileExists(KubeConfigPath) { return fmt.Errorf("k3s kubeconfig is not available") } diff --git a/plugins/scheduler-k3s/registry.go b/plugins/scheduler-k3s/registry.go deleted file mode 100644 index 824e1b7b4..000000000 --- a/plugins/scheduler-k3s/registry.go +++ /dev/null @@ -1,78 +0,0 @@ -package scheduler_k3s - -import ( - "context" - "fmt" - - "github.com/dokku/dokku/plugins/common" -) - -func copyRegistryToNode(ctx context.Context, remoteHost string) error { - common.LogInfo1Quiet(fmt.Sprintf("Updating k3s registry configuration on %s", remoteHost)) - sftpCmd, err := common.CallSftpCopy(common.SftpCopyInput{ - AllowUknownHosts: true, - DestinationPath: "/tmp/registries.yaml", - RemoteHost: remoteHost, - SourcePath: RegistryConfigPath, - }) - if err != nil { - return fmt.Errorf("Error copying registries.yaml to remote host: %w", err) - } - - if sftpCmd.ExitErr != nil { - return fmt.Errorf("Error copying registries.yaml to remote host: %s", sftpCmd.ExitErr.Error()) - } - - common.LogVerboseQuiet("Moving k3s registry configuration into place") - mvCmd, err := common.CallSshCommand(common.SshCommandInput{ - AllowUknownHosts: true, - Args: []string{"/tmp/registries.yaml", RegistryConfigPath}, - Command: "mv", - RemoteHost: remoteHost, - StreamStdio: true, - Sudo: true, - }) - if err != nil { - return fmt.Errorf("Unable to call mv command over ssh: %w", err) - } - - if mvCmd.ExitCode != 0 { - return fmt.Errorf("Invalid exit code from mv command over ssh: %d", mvCmd.ExitCode) - } - - common.LogVerboseQuiet("Updating k3s registry permissions") - chmodCmd, err := common.CallSshCommand(common.SshCommandInput{ - AllowUknownHosts: true, - Args: []string{"0644", RegistryConfigPath}, - Command: "chmod", - RemoteHost: remoteHost, - StreamStdio: true, - Sudo: true, - }) - if err != nil { - return fmt.Errorf("Unable to call chmod command over ssh: %w", err) - } - - if chmodCmd.ExitCode != 0 { - return fmt.Errorf("Invalid exit code from chmod command over ssh: %d", chmodCmd.ExitCode) - } - - common.LogVerboseQuiet("Updating k3s registry ower") - chownCmd, err := common.CallSshCommand(common.SshCommandInput{ - AllowUknownHosts: true, - Args: []string{"root:root", RegistryConfigPath}, - Command: "chown", - RemoteHost: remoteHost, - StreamStdio: true, - Sudo: true, - }) - if err != nil { - return fmt.Errorf("Unable to call chown command over ssh: %w", err) - } - - if chownCmd.ExitCode != 0 { - return fmt.Errorf("Invalid exit code from chown command over ssh: %d", chownCmd.ExitCode) - } - - return nil -} diff --git a/plugins/scheduler-k3s/scheduler_k3s.go b/plugins/scheduler-k3s/scheduler_k3s.go index 78a857fa4..36bd33e35 100644 --- a/plugins/scheduler-k3s/scheduler_k3s.go +++ b/plugins/scheduler-k3s/scheduler_k3s.go @@ -42,7 +42,6 @@ var ( const DefaultIngressClass = "traefik" const GlobalProcessType = "--global" const KubeConfigPath = "/etc/rancher/k3s/k3s.yaml" -const RegistryConfigPath = "/etc/rancher/k3s/registries.yaml" var ( runtimeScheme = runtime.NewScheme() diff --git a/plugins/scheduler-k3s/src/triggers/triggers.go b/plugins/scheduler-k3s/src/triggers/triggers.go index 4e99e14d8..ee171e767 100644 --- a/plugins/scheduler-k3s/src/triggers/triggers.go +++ b/plugins/scheduler-k3s/src/triggers/triggers.go @@ -35,10 +35,6 @@ func main() { case "post-delete": appName := flag.Arg(0) err = scheduler_k3s.TriggerPostDelete(appName) - case "post-registry-login": - server := flag.Arg(0) - username := flag.Arg(1) - err = scheduler_k3s.TriggerPostRegistryLogin(server, username) case "report": appName := flag.Arg(0) err = scheduler_k3s.ReportSingleApp(appName, "", "") diff --git a/plugins/scheduler-k3s/subcommands.go b/plugins/scheduler-k3s/subcommands.go index 5a72476d9..5e5bd930e 100644 --- a/plugins/scheduler-k3s/subcommands.go +++ b/plugins/scheduler-k3s/subcommands.go @@ -241,27 +241,6 @@ func CommandInitialize(ingressClass string, serverIP string, taintScheduling boo return fmt.Errorf("Invalid exit code from k3s installer command: %d", installerCmd.ExitCode) } - if err := common.TouchFile(RegistryConfigPath); err != nil { - return fmt.Errorf("Error creating initial registries.yaml file") - } - - common.LogInfo2Quiet("Setting registries.yaml permissions") - registryAclCmd, err := common.CallExecCommand(common.ExecCommandInput{ - Command: "setfacl", - Args: []string{ - "-m", - "user:dokku:rwx", - RegistryConfigPath, - }, - StreamStdio: true, - }) - if err != nil { - return fmt.Errorf("Unable to call setfacl command: %w", err) - } - if registryAclCmd.ExitCode != 0 { - return fmt.Errorf("Invalid exit code from setfacl command: %d", registryAclCmd.ExitCode) - } - clientset, err := NewKubernetesClient() if err != nil { return fmt.Errorf("Unable to create kubernetes client: %w", err) @@ -572,11 +551,6 @@ func CommandClusterAdd(role string, remoteHost string, serverIP string, allowUkn return fmt.Errorf("Unable to find node after joining cluster, node will not be annotated/labeled appropriately access registry secrets") } - err = copyRegistryToNode(ctx, remoteHost) - if err != nil { - return fmt.Errorf("Error copying registries.yaml to remote host: %w", err) - } - labels := ServerLabels if role == "worker" { labels = WorkerLabels diff --git a/plugins/scheduler-k3s/template.go b/plugins/scheduler-k3s/template.go index 3addd48d3..5003a3965 100644 --- a/plugins/scheduler-k3s/template.go +++ b/plugins/scheduler-k3s/template.go @@ -45,6 +45,7 @@ type GlobalValues struct { type GlobalImage struct { ImagePullSecrets string `yaml:"image_pull_secrets"` Name string `yaml:"name"` + PullSecretBase64 string `yaml:"pull_secret_base64"` Type string `yaml:"type"` WorkingDir string `yaml:"working_dir"` } diff --git a/plugins/scheduler-k3s/templates/chart/cron-job.yaml b/plugins/scheduler-k3s/templates/chart/cron-job.yaml index 73cceec23..ddd5cbefb 100644 --- a/plugins/scheduler-k3s/templates/chart/cron-job.yaml +++ b/plugins/scheduler-k3s/templates/chart/cron-job.yaml @@ -111,7 +111,8 @@ spec: workingDir: {{ $.Values.global.image.working_dir }} {{- end }} {{- if $.Values.global.image.image_pull_secrets }} - imagePullSecrets: {{ $.Values.global.image.image_pull_secrets }} + imagePullSecrets: + - name: {{ $.Values.global.image.image_pull_secrets }} {{- end }} restartPolicy: Never serviceAccountName: {{ $.Values.global.app_name }} diff --git a/plugins/scheduler-k3s/templates/chart/deployment.yaml b/plugins/scheduler-k3s/templates/chart/deployment.yaml index db957375e..38d1eea83 100644 --- a/plugins/scheduler-k3s/templates/chart/deployment.yaml +++ b/plugins/scheduler-k3s/templates/chart/deployment.yaml @@ -125,6 +125,7 @@ spec: workingDir: {{ $.Values.global.image.working_dir }} {{- end }} {{- if $.Values.global.image.image_pull_secrets }} - imagePullSecrets: {{ $.Values.global.image.image_pull_secrets }} + imagePullSecrets: + - name: {{ $.Values.global.image.image_pull_secrets }} {{- end }} serviceAccountName: {{ $.Values.global.app_name }} diff --git a/plugins/scheduler-k3s/templates/chart/image-pull-secret.yaml b/plugins/scheduler-k3s/templates/chart/image-pull-secret.yaml new file mode 100644 index 000000000..3ffec7186 --- /dev/null +++ b/plugins/scheduler-k3s/templates/chart/image-pull-secret.yaml @@ -0,0 +1,23 @@ +{{- if $.Values.global.image.pull_secret_base64 }} +--- +apiVersion: v1 +kind: Secret +metadata: + annotations: + app.kubernetes.io/version: {{ $.Values.global.deploment_id | quote }} + dokku.com/managed: "true" + {{- if and $.Values.global.annotations $.Values.global.annotations.secret }} + {{- range $k, $v := $.Values.global.annotations.secret }} + {{ $k }}: {{ $v | quote }} + {{- end }} + {{- end }} + labels: + app.kubernetes.io/instance: image-pull-{{ $.Values.global.app_name }}.{{ $.Values.global.deploment_id }} + app.kubernetes.io/name: image-pull-{{ $.Values.global.app_name }} + app.kubernetes.io/part-of: {{ $.Values.global.app_name }} + name: image-pull-{{ $.Values.global.app_name }}.{{ $.Values.global.deploment_id }} + namespace: {{ $.Values.global.namespace }} +data: + .dockerconfigjson: "{{ $.Values.global.image.pull_secret_base64 }}" +type: kubernetes.io/dockerconfigjson +{{- end }} diff --git a/plugins/scheduler-k3s/templates/chart/secret.yaml b/plugins/scheduler-k3s/templates/chart/secret.yaml index af4f8131c..f8ac42d21 100644 --- a/plugins/scheduler-k3s/templates/chart/secret.yaml +++ b/plugins/scheduler-k3s/templates/chart/secret.yaml @@ -1,3 +1,4 @@ +--- apiVersion: v1 kind: Secret metadata: diff --git a/plugins/scheduler-k3s/triggers.go b/plugins/scheduler-k3s/triggers.go index f566e32c8..3ff7a52ab 100644 --- a/plugins/scheduler-k3s/triggers.go +++ b/plugins/scheduler-k3s/triggers.go @@ -23,11 +23,8 @@ import ( "github.com/dokku/dokku/plugins/config" "github.com/dokku/dokku/plugins/cron" "github.com/fatih/color" - "github.com/hashicorp/go-multierror" "github.com/kballard/go-shellquote" - "github.com/rancher/wharfie/pkg/registries" "github.com/ryanuber/columnize" - "gopkg.in/yaml.v3" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" "k8s.io/kubernetes/pkg/client/conditions" @@ -78,88 +75,6 @@ func TriggerPostDelete(appName string) error { return propertyErr } -// TriggerPostRegistryLogin updates the `/etc/rancher/k3s/registries.yaml` to include -// auth information for the registry. Note that if the file does not exist, it won't be updated. -func TriggerPostRegistryLogin(server string, username string) error { - if !common.FileExists("/usr/local/bin/k3s") { - return nil - } - - password := os.Getenv("DOCKER_REGISTRY_PASS") - - yamlFile, err := os.ReadFile(RegistryConfigPath) - if err != nil { - return fmt.Errorf("Unable to read existing registries.yaml: %w", err) - } - - var registry registries.Registry - err = yaml.Unmarshal(yamlFile, ®istry) - if err != nil { - return fmt.Errorf("Unable to unmarshal registry configuration from yaml: %w", err) - } - - common.LogInfo1("Updating k3s configuration") - if registry.Auths == nil { - registry.Auths = map[string]registries.AuthConfig{} - } - - if server == "docker.io" { - server = "registry-1.docker.io" - } - - registry.Auths[server] = registries.AuthConfig{ - Username: username, - Password: password, - } - - data, err := yaml.Marshal(®istry) - if err != nil { - return fmt.Errorf("Unable to marshal registry configuration to yaml: %w", err) - } - - if err := os.WriteFile(RegistryConfigPath, data, os.FileMode(0644)); err != nil { - return fmt.Errorf("Unable to write registry configuration to file: %w", err) - } - - ctx, cancel := context.WithCancel(context.Background()) - signals := make(chan os.Signal, 1) - signal.Notify(signals, os.Interrupt, syscall.SIGHUP, - syscall.SIGINT, - syscall.SIGQUIT, - syscall.SIGTERM) - go func() { - <-signals - cancel() - }() - - clientset, err := NewKubernetesClient() - if err != nil { - return fmt.Errorf("Error creating kubernetes client: %w", err) - } - - nodes, err := clientset.ListNodes(ctx, ListNodesInput{}) - if err != nil { - return fmt.Errorf("Error listing nodes: %w", err) - } - - var result error - for _, node := range nodes { - remoteHost, ok := node.Annotations["dokku.com/remote-host"] - if !ok { - continue - } - - err := copyRegistryToNode(ctx, remoteHost) - if err != nil { - wrappedErr := fmt.Errorf("Error copying registry to node: %w", err) - result = multierror.Append(result, wrappedErr) - common.LogWarn(wrappedErr.Error()) - } - } - - return result -} - // TriggerSchedulerDeploy deploys an image tag for a given application func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) error { if scheduler != "k3s" { @@ -208,8 +123,6 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e return fmt.Errorf("Error parsing rollback-on-failure value as boolean: %w", err) } - imagePullSecrets := getComputedImagePullSecrets(appName) - imageSourceType := "dockerfile" if common.IsImageCnbBased(image) { imageSourceType = "pack" @@ -256,7 +169,22 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e } deploymentId := time.Now().Unix() - globalTemplateFiles := []string{"service-account", "secret"} + pullSecretBase64 := base64.StdEncoding.EncodeToString([]byte("")) + imagePullSecrets := getComputedImagePullSecrets(appName) + if imagePullSecrets == "" { + dockerConfigPath := filepath.Join(os.Getenv("DOKKU_ROOT"), ".docker/config.json") + if fi, err := os.Stat(dockerConfigPath); err == nil && !fi.IsDir() { + b, err := os.ReadFile(dockerConfigPath) + if err != nil { + return fmt.Errorf("Error reading docker config: %w", err) + } + + imagePullSecrets = fmt.Sprintf("image-pull-%s.%d", appName, deploymentId) + pullSecretBase64 = base64.StdEncoding.EncodeToString(b) + } + } + + globalTemplateFiles := []string{"service-account", "secret", "image-pull-secret"} for _, templateName := range globalTemplateFiles { b, err := templates.ReadFile(fmt.Sprintf("templates/chart/%s.yaml", templateName)) if err != nil { @@ -345,6 +273,7 @@ func TriggerSchedulerDeploy(scheduler string, appName string, imageTag string) e DeploymentID: fmt.Sprint(deploymentId), Image: GlobalImage{ ImagePullSecrets: imagePullSecrets, + PullSecretBase64: pullSecretBase64, Name: image, Type: imageSourceType, WorkingDir: workingDir, From 688ee518af311794f81e501c2072803c7ea123e7 Mon Sep 17 00:00:00 2001 From: Dokku Bot Date: Mon, 12 Feb 2024 22:56:50 +0000 Subject: [PATCH 08/46] Release 0.33.6 # History ## 0.33.6 Install/update via the bootstrap script: ```shell wget -NP . https://dokku.com/install/v0.33.6/bootstrap.sh sudo DOKKU_TAG=v0.33.6 bash bootstrap.sh ``` ### Bug Fixes - #6589: @josegonzalez Use image pull secrets instead of registries.yaml to reference private repositories when deploying via k3s - #6581: @josegonzalez Fix issues in tls handling when deploying via k3s - #6582: @josegonzalez Correctly handle extra whitespace in scale file contents - #6390: @renweibo Prefer systemctl over sv when both exist while restarting nginx - #6579: @josegonzalez Ensure k3s can be installed with taints ### New Features - #6585: @josegonzalez Add more context to errors in fetching cron entries - #6583: @josegonzalez Add WithContext functions for all subprocess-related code ### Refactors - #6584: @josegonzalez Use new CallExecCommand when checking to see how help is being called ### Dependencies - #6586: @dependabot[bot] chore(deps): bump mvdan.cc/sh/v3 from 3.7.0 to 3.8.0 in /plugins/cron - #6587: @dependabot[bot] chore(deps): bump mkdocs-material from 9.5.8 to 9.5.9 in /docs/_build - #6381: @dependabot[bot] chore(deps): bump actions/upload-artifact from 3 to 4 - #6578: @josegonzalez Bump go modules ### Other - #6576: @Tashows Allow creating a detached container with TTY enabled for attaching remote terminal --- HISTORY.md | 37 ++++++++++++++ README.md | 4 +- debian/control | 2 +- docs/advanced-usage/plugin-management.md | 58 +++++++++++----------- docs/assets/favicons/browserconfig.xml | 8 +-- docs/assets/favicons/manifest.json | 12 ++--- docs/assets/versions.json | 2 +- docs/development/release-process.md | 2 +- docs/getting-started/install/docker.md | 6 +-- docs/getting-started/installation/index.md | 4 +- docs/home.html | 50 +++++++++---------- docs/template.html | 36 +++++++------- plugins/00_dokku-standard/plugin.toml | 2 +- plugins/20_events/plugin.toml | 2 +- plugins/app-json/plugin.toml | 2 +- plugins/apps/plugin.toml | 2 +- plugins/builder-dockerfile/plugin.toml | 2 +- plugins/builder-herokuish/plugin.toml | 2 +- plugins/builder-lambda/plugin.toml | 2 +- plugins/builder-nixpacks/plugin.toml | 2 +- plugins/builder-null/plugin.toml | 2 +- plugins/builder-pack/plugin.toml | 2 +- plugins/builder/plugin.toml | 2 +- plugins/buildpacks/plugin.toml | 2 +- plugins/caddy-vhosts/plugin.toml | 2 +- plugins/certs/plugin.toml | 2 +- plugins/checks/plugin.toml | 2 +- plugins/common/plugin.toml | 2 +- plugins/config/plugin.toml | 2 +- plugins/cron/plugin.toml | 2 +- plugins/docker-options/plugin.toml | 2 +- plugins/domains/plugin.toml | 2 +- plugins/enter/plugin.toml | 2 +- plugins/git/plugin.toml | 2 +- plugins/haproxy-vhosts/plugin.toml | 2 +- plugins/logs/plugin.toml | 2 +- plugins/network/plugin.toml | 2 +- plugins/nginx-vhosts/plugin.toml | 2 +- plugins/openresty-vhosts/plugin.toml | 2 +- plugins/plugin/plugin.toml | 2 +- plugins/ports/plugin.toml | 2 +- plugins/proxy/plugin.toml | 2 +- plugins/ps/plugin.toml | 2 +- plugins/registry/plugin.toml | 2 +- plugins/repo/plugin.toml | 2 +- plugins/resource/plugin.toml | 2 +- plugins/run/plugin.toml | 2 +- plugins/scheduler-docker-local/plugin.toml | 2 +- plugins/scheduler-k3s/plugin.toml | 2 +- plugins/scheduler-null/plugin.toml | 2 +- plugins/scheduler/plugin.toml | 2 +- plugins/shell/plugin.toml | 2 +- plugins/ssh-keys/plugin.toml | 2 +- plugins/storage/plugin.toml | 2 +- plugins/trace/plugin.toml | 2 +- plugins/traefik-vhosts/plugin.toml | 2 +- 56 files changed, 173 insertions(+), 136 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index c6d64a728..2cecc1ded 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,42 @@ # History +## 0.33.6 + +Install/update via the bootstrap script: + +```shell +wget -NP . https://dokku.com/install/v0.33.6/bootstrap.sh +sudo DOKKU_TAG=v0.33.6 bash bootstrap.sh +``` + +### Bug Fixes + +- #6589: @josegonzalez Use image pull secrets instead of registries.yaml to reference private repositories when deploying via k3s +- #6581: @josegonzalez Fix issues in tls handling when deploying via k3s +- #6582: @josegonzalez Correctly handle extra whitespace in scale file contents +- #6390: @renweibo Prefer systemctl over sv when both exist while restarting nginx +- #6579: @josegonzalez Ensure k3s can be installed with taints + +### New Features + +- #6585: @josegonzalez Add more context to errors in fetching cron entries +- #6583: @josegonzalez Add WithContext functions for all subprocess-related code + +### Refactors + +- #6584: @josegonzalez Use new CallExecCommand when checking to see how help is being called + +### Dependencies + +- #6586: @dependabot[bot] chore(deps): bump mvdan.cc/sh/v3 from 3.7.0 to 3.8.0 in /plugins/cron +- #6587: @dependabot[bot] chore(deps): bump mkdocs-material from 9.5.8 to 9.5.9 in /docs/_build +- #6381: @dependabot[bot] chore(deps): bump actions/upload-artifact from 3 to 4 +- #6578: @josegonzalez Bump go modules + +### Other + +- #6576: @Tashows Allow creating a detached container with TTY enabled for attaching remote terminal + ## 0.33.5 Install/update via the bootstrap script: diff --git a/README.md b/README.md index 7b4c43726..f3ab03117 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,8 @@ Otherwise, you will need to import the keypair manually after installation using To install the latest stable release, run the following commands as a user who has access to `sudo`: ```shell -wget -NP . https://dokku.com/install/v0.33.5/bootstrap.sh -sudo DOKKU_TAG=v0.33.5 bash bootstrap.sh +wget -NP . https://dokku.com/install/v0.33.6/bootstrap.sh +sudo DOKKU_TAG=v0.33.6 bash bootstrap.sh ``` You can then proceed to configure your server domain (via `dokku domains:set-global`) and user access (via `dokku ssh-keys:add`) to complete the installation. diff --git a/debian/control b/debian/control index c207c0b56..795aa1e8d 100644 --- a/debian/control +++ b/debian/control @@ -1,5 +1,5 @@ Package: dokku -Version: 0.33.5 +Version: 0.33.6 Section: web Priority: optional Architecture: amd64 diff --git a/docs/advanced-usage/plugin-management.md b/docs/advanced-usage/plugin-management.md index 99871ac4a..d89242814 100644 --- a/docs/advanced-usage/plugin-management.md +++ b/docs/advanced-usage/plugin-management.md @@ -36,35 +36,35 @@ dokku plugin:list ``` plugn: dev - 00_dokku-standard 0.33.5 enabled dokku core standard plugin - 20_events 0.33.5 enabled dokku core events logging plugin - app-json 0.33.5 enabled dokku core app-json plugin - apps 0.33.5 enabled dokku core apps plugin - build-env 0.33.5 enabled dokku core build-env plugin - buildpacks 0.33.5 enabled dokku core buildpacks plugin - certs 0.33.5 enabled dokku core certificate management plugin - checks 0.33.5 enabled dokku core checks plugin - common 0.33.5 enabled dokku core common plugin - config 0.33.5 enabled dokku core config plugin - docker-options 0.33.5 enabled dokku core docker-options plugin - domains 0.33.5 enabled dokku core domains plugin - enter 0.33.5 enabled dokku core enter plugin - git 0.33.5 enabled dokku core git plugin - logs 0.33.5 enabled dokku core logs plugin - network 0.33.5 enabled dokku core network plugin - nginx-vhosts 0.33.5 enabled dokku core nginx-vhosts plugin - plugin 0.33.5 enabled dokku core plugin plugin - proxy 0.33.5 enabled dokku core proxy plugin - ps 0.33.5 enabled dokku core ps plugin - repo 0.33.5 enabled dokku core repo plugin - resource 0.33.5 enabled dokku core resource plugin - scheduler-docker-local 0.33.5 enabled dokku core scheduler-docker-local plugin - shell 0.33.5 enabled dokku core shell plugin - ssh-keys 0.33.5 enabled dokku core ssh-keys plugin - storage 0.33.5 enabled dokku core storage plugin - tags 0.33.5 enabled dokku core tags plugin - tar 0.33.5 enabled dokku core tar plugin - trace 0.33.5 enabled dokku core trace plugin + 00_dokku-standard 0.33.6 enabled dokku core standard plugin + 20_events 0.33.6 enabled dokku core events logging plugin + app-json 0.33.6 enabled dokku core app-json plugin + apps 0.33.6 enabled dokku core apps plugin + build-env 0.33.6 enabled dokku core build-env plugin + buildpacks 0.33.6 enabled dokku core buildpacks plugin + certs 0.33.6 enabled dokku core certificate management plugin + checks 0.33.6 enabled dokku core checks plugin + common 0.33.6 enabled dokku core common plugin + config 0.33.6 enabled dokku core config plugin + docker-options 0.33.6 enabled dokku core docker-options plugin + domains 0.33.6 enabled dokku core domains plugin + enter 0.33.6 enabled dokku core enter plugin + git 0.33.6 enabled dokku core git plugin + logs 0.33.6 enabled dokku core logs plugin + network 0.33.6 enabled dokku core network plugin + nginx-vhosts 0.33.6 enabled dokku core nginx-vhosts plugin + plugin 0.33.6 enabled dokku core plugin plugin + proxy 0.33.6 enabled dokku core proxy plugin + ps 0.33.6 enabled dokku core ps plugin + repo 0.33.6 enabled dokku core repo plugin + resource 0.33.6 enabled dokku core resource plugin + scheduler-docker-local 0.33.6 enabled dokku core scheduler-docker-local plugin + shell 0.33.6 enabled dokku core shell plugin + ssh-keys 0.33.6 enabled dokku core ssh-keys plugin + storage 0.33.6 enabled dokku core storage plugin + tags 0.33.6 enabled dokku core tags plugin + tar 0.33.6 enabled dokku core tar plugin + trace 0.33.6 enabled dokku core trace plugin ``` > [!WARNING] diff --git a/docs/assets/favicons/browserconfig.xml b/docs/assets/favicons/browserconfig.xml index 30d9aaa13..dbd8035bb 100644 --- a/docs/assets/favicons/browserconfig.xml +++ b/docs/assets/favicons/browserconfig.xml @@ -2,10 +2,10 @@ - - - - + + + + #da532c diff --git a/docs/assets/favicons/manifest.json b/docs/assets/favicons/manifest.json index 8f5c43d5b..479c3dfc0 100644 --- a/docs/assets/favicons/manifest.json +++ b/docs/assets/favicons/manifest.json @@ -2,37 +2,37 @@ "name": "Dokku", "icons": [ { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-36x36.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-36x36.png", "sizes": "36x36", "type": "image\/png", "density": "0.75" }, { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-48x48.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-48x48.png", "sizes": "48x48", "type": "image\/png", "density": "1.0" }, { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-72x72.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-72x72.png", "sizes": "72x72", "type": "image\/png", "density": "1.5" }, { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-96x96.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-96x96.png", "sizes": "96x96", "type": "image\/png", "density": "2.0" }, { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-144x144.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-144x144.png", "sizes": "144x144", "type": "image\/png", "density": "3.0" }, { - "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.5\/docs\/assets\/favicons\/android-chrome-192x192.png", + "src": "https:\/\/cdn.jsdelivr.net\/dokku\/dokku@v0.33.6\/docs\/assets\/favicons\/android-chrome-192x192.png", "sizes": "192x192", "type": "image\/png", "density": "4.0" diff --git a/docs/assets/versions.json b/docs/assets/versions.json index ee3ac373c..be34853be 100644 --- a/docs/assets/versions.json +++ b/docs/assets/versions.json @@ -30,6 +30,6 @@ "0.30.11", "0.31.5", "0.32.4", - "0.33.5" + "0.33.6" ] } diff --git a/docs/development/release-process.md b/docs/development/release-process.md index ad7356b43..bf73b5076 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -29,7 +29,7 @@ The workflow looks like this: ```shell # having dokku-arch in ../dokku-arch vagrant up build-arch -# wait for "==> build-arch: ==> Finished making: dokku 0.33.5-2 (Mon Feb 22 23:20:37 CET 2016)" +# wait for "==> build-arch: ==> Finished making: dokku 0.33.6-2 (Mon Feb 22 23:20:37 CET 2016)" cd ../dokku-arch git add PKGBUILD .SRCINFO git commit -m 'Update to dokku 0.9.9' diff --git a/docs/getting-started/install/docker.md b/docs/getting-started/install/docker.md index 74691c3e4..d78f5b0f1 100644 --- a/docs/getting-started/install/docker.md +++ b/docs/getting-started/install/docker.md @@ -3,7 +3,7 @@ Pull the dokku/dokku image: ```shell -docker pull dokku/dokku:0.33.5 +docker pull dokku/dokku:0.33.6 ``` Next, run the image. @@ -19,7 +19,7 @@ docker container run \ --publish 8443:443 \ --volume /var/lib/dokku:/mnt/dokku \ --volume /var/run/docker.sock:/var/run/docker.sock \ - dokku/dokku:0.33.5 + dokku/dokku:0.33.6 ``` The above command will start a new docker container that is ready when a message similar to `Runit started as PID 12345` appears. @@ -61,7 +61,7 @@ redis: https://github.com/dokku/dokku-redis.git The alternative is to build a custom docker image via a custom Dockerfile. This Dockerfile can run any `plugin:install` command. Note that the version installed at that time will be the one that persists. Below is an example Dockerfile showing this method. ```Dockerfile -FROM dokku/dokku:0.33.5 +FROM dokku/dokku:0.33.6 RUN dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres RUN dokku plugin:install https://github.com/dokku/dokku-redis.git redis ``` diff --git a/docs/getting-started/installation/index.md b/docs/getting-started/installation/index.md index bc854a779..8a6f343a9 100644 --- a/docs/getting-started/installation/index.md +++ b/docs/getting-started/installation/index.md @@ -37,8 +37,8 @@ To install the latest stable version of Dokku, you can run the following shell c ```shell # for debian systems, installs Dokku via apt-get -wget -NP . https://dokku.com/install/v0.33.5/bootstrap.sh -sudo DOKKU_TAG=v0.33.5 bash bootstrap.sh +wget -NP . https://dokku.com/install/v0.33.6/bootstrap.sh +sudo DOKKU_TAG=v0.33.6 bash bootstrap.sh ``` The installation process takes about 5-10 minutes, depending upon internet connection speed. diff --git a/docs/home.html b/docs/home.html index 7bfc0addf..3b7ed9f55 100644 --- a/docs/home.html +++ b/docs/home.html @@ -10,26 +10,26 @@ Dokku - The smallest PaaS implementation you've ever seen - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + @@ -38,7 +38,7 @@ - + @@ -98,7 +98,7 @@
-
Latest release v0.33.5
+
Latest release v0.33.6

An open source PAAS alternative to Heroku.

Dokku helps you build and manage the lifecycle of applications from building to scaling.

@@ -125,7 +125,7 @@

$ - sudo DOKKU_TAG=v0.33.5 bash bootstrap.sh + sudo DOKKU_TAG=v0.33.6 bash bootstrap.sh


@@ -226,8 +226,8 @@ Create - - + + Deploy @@ -382,11 +382,11 @@ - + - + @@ -402,7 +402,7 @@ - + diff --git a/docs/template.html b/docs/template.html index e75d7f0cb..c3a40adf9 100644 --- a/docs/template.html +++ b/docs/template.html @@ -9,26 +9,26 @@ Dokku - {{DOC_TITLE}} - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + +