-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from gardener/certmanager
cert-manager component
- Loading branch information
Showing
26 changed files
with
464 additions
and
40 deletions.
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
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 |
---|---|---|
|
@@ -34,3 +34,7 @@ landscape: | |
- email: "[email protected]" | ||
username: "Admin" | ||
password: "MyHardPassword123$" | ||
|
||
# cert-manager: | ||
# email: "[email protected]" | ||
# server: live |
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 @@ | ||
# | ||
# remove this file if no dedicated deploy or delete code | ||
# is required | ||
# | ||
deploy() | ||
{ | ||
true | ||
} | ||
|
||
delete() | ||
{ | ||
true | ||
} |
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,12 @@ | ||
--- | ||
component: | ||
imports: | ||
- cert-manager/solver | ||
- cert-controller: cert-manager/controller | ||
- namespace | ||
- ingress-controller | ||
|
||
stubs: | ||
- lib/templates/utilities.yaml | ||
- lib/templates/certs.yaml | ||
- lib/templates/state.yaml |
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,32 @@ | ||
--- | ||
imports: (( &temporary )) | ||
landscape: (( &temporary )) | ||
|
||
settings: | ||
certificate: | ||
name: dashboard-identity-ingress | ||
domain: (( "*." imports.ingress-controller.export.ingress_domain )) | ||
secret_name: identity-dashboard-tls | ||
namespace: (( landscape.namespace )) | ||
|
||
plugins: | ||
- kubectl: cert | ||
- -echo: "The export generation waits for the certificate, which may take some time." | ||
|
||
cert: | ||
kubeconfig: (( .landscape.clusters[0].kubeconfig )) | ||
manifests: | ||
- apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Certificate | ||
metadata: | ||
name: (( .settings.certificate.name )) | ||
namespace: (( .settings.certificate.namespace )) | ||
spec: | ||
secretName: (( .settings.certificate.secret_name )) | ||
renewBefore: 360h # 15d | ||
commonName: (( .settings.certificate.domain )) | ||
dnsNames: | ||
- (( .settings.certificate.domain )) | ||
issuerRef: | ||
name: (( imports.cert-controller.export.issuerName )) | ||
kind: Issuer |
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,34 @@ | ||
--- | ||
settings: (( &temporary )) | ||
landscape: (( &temporary )) | ||
env: (( &temporary )) | ||
|
||
wait_for_certificate: | ||
<<: (( &temporary )) | ||
check_command: | ||
- "kubectl" | ||
- "--kubeconfig" | ||
- (( lookup_file(landscape.clusters.[0].kubeconfig, env.ROOTDIR).[0] )) | ||
- "-n" | ||
- (( .settings.certificate.namespace )) | ||
- "get" | ||
- "certificate" | ||
- (( .settings.certificate.name )) | ||
- "-o" | ||
- "json" | ||
get_command: | ||
- "kubectl" | ||
- "--kubeconfig" | ||
- (( lookup_file(landscape.clusters.[0].kubeconfig, env.ROOTDIR).[0] )) | ||
- "-n" | ||
- (( .settings.certificate.namespace )) | ||
- "get" | ||
- "secret" | ||
- (( .settings.certificate.secret_name )) | ||
- "-o" | ||
- "json" | ||
result: (( sync( exec_uncached( check_command ), value.status.conditions[0].status == "True", wait_for_certificate.b64dall( exec( get_command ).data ), 600 ) )) | ||
b64dall: (( |x|-> sum[x|{}|s,k,v|-> s {k=base64_decode(v)}] )) | ||
|
||
export: | ||
<<: (( .settings )) |
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,11 @@ | ||
--- | ||
component: | ||
imports: | ||
- tiller | ||
- dns-controller | ||
- namespace | ||
|
||
stubs: | ||
- lib/templates/utilities.yaml | ||
- lib/templates/certs.yaml | ||
- lib/templates/state.yaml |
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,131 @@ | ||
--- | ||
imports: (( &temporary )) | ||
landscape: (( &temporary )) | ||
utilities: (( &temporary )) | ||
|
||
settings: | ||
groupName: cert.gardener.cloud | ||
solverName: certificate-dns-bridge | ||
namespace: cert-manager # will be created - don't choose an existing one! | ||
serviceAccountName: cert-manager | ||
self-signed: (( .caSpec.url == "self-signed" )) | ||
issuerName: (( .settings.self-signed ? "ca-issuer" :"acme-issuer" )) | ||
caSecret: "self-signed-ca" | ||
ca: | ||
given: (( &temporary ( valid( .caSpec.ca.crt ) -and ( ( ! .settings.self-signed ) -or valid( .caSpec.ca.key ) ) ) )) # a given CA needs crt and key for self-signed mode | ||
crt: (( given ? .caSpec.ca.crt :( .state.ca.value.cert || ~~ ) )) | ||
key: (( given ? ( .caSpec.ca.key || ~~ ) :( .state.ca.value.key || ~~ ) )) | ||
|
||
caSpec: | ||
<<: (( &temporary )) | ||
instantiateIfNeeded: (( |x|-> type( x ) == "template" ? *x :x )) | ||
server: (( caSpec.instantiateIfNeeded( .servers[.landscape.cert-manager.server.url] || .landscape.cert-manager.server ) )) | ||
url: (( server.url || server )) | ||
ca: (( server.ca || ~~ )) | ||
|
||
plugins: | ||
- git | ||
- chart-checkout | ||
- kubectl: namespace | ||
- kubectl: crds | ||
- helm | ||
- -echo: (( .settings.self-signed ? ( .settings.ca.given ? "Using provided CA" :"Using self-signed CA" ) :"Using ACME server at " .caSpec.url )) | ||
- kubectl: issuer | ||
|
||
git: | ||
<<: (( landscape.versions.cert-manager.controller )) | ||
files: | ||
- "deploy/manifests/00-crds.yaml" | ||
|
||
chart-checkout: | ||
repo: (( landscape.versions.cert-manager.controller.helm_repo )) | ||
name: cert-manager | ||
version: (( landscape.versions.cert-manager.controller.helm_tag )) | ||
|
||
namespace: | ||
name: (( settings.namespace )) | ||
kubeconfig: (( landscape.clusters.[0].kubeconfig )) | ||
manifests: | ||
- apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
labels: | ||
certmanager.k8s.io/disable-validation: "true" | ||
name: (( .namespace.name )) | ||
|
||
crds: | ||
kubeconfig: (( landscape.clusters.[0].kubeconfig )) | ||
files: | ||
- "git/repo/deploy/manifests/00-crds.yaml" | ||
|
||
issuer: (( .settings.self-signed ? *ca_issuer :*acme_issuer )) | ||
|
||
acme_issuer: | ||
<<: (( &template &temporary )) | ||
kubeconfig: (( landscape.clusters.[0].kubeconfig )) | ||
manifests: | ||
- apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Issuer | ||
metadata: | ||
name: (( settings.issuerName )) | ||
namespace: (( .landscape.namespace )) | ||
spec: | ||
acme: | ||
server: (( .caSpec.url )) | ||
email: (( .landscape.cert-manager.email || .landscape.identity.users[0].email )) | ||
privateKeySecretRef: | ||
name: (( settings.issuerName "-secret" )) | ||
solvers: | ||
- dns01: | ||
webhook: | ||
groupName: (( settings.groupName )) | ||
solverName: (( settings.solverName )) | ||
config: | ||
dns-class: (( .imports.dns-controller.export.dns-class )) | ||
namespace: (( .imports.dns-controller.export.namespace )) | ||
|
||
ca_issuer: | ||
<<: (( &template &temporary )) | ||
kubeconfig: (( landscape.clusters.[0].kubeconfig )) | ||
manifests: | ||
- apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: (( .settings.caSecret )) | ||
namespace: (( .landscape.namespace )) | ||
type: kubernetes.io/tls | ||
data: | ||
tls.crt: (( base64( .settings.ca.crt ) )) | ||
tls.key: (( base64( .settings.ca.key ) )) | ||
- apiVersion: certmanager.k8s.io/v1alpha1 | ||
kind: Issuer | ||
metadata: | ||
name: (( settings.issuerName )) | ||
namespace: (( .landscape.namespace )) | ||
spec: | ||
ca: | ||
secretName: (( .settings.caSecret )) | ||
|
||
|
||
servers: | ||
<<: (( &temporary )) | ||
live: https://acme-v02.api.letsencrypt.org/directory | ||
staging: | ||
<<: (( &template )) # to not download the letsencrypt certs every time | ||
url: https://acme-staging-v02.api.letsencrypt.org/directory | ||
ca: | ||
crt: (( exec( "curl", "-s", "https://letsencrypt.org/certs/fakelerootx1.pem" ) "\n" exec( "curl", "-s", "https://letsencrypt.org/certs/fakeleintermediatex1.pem" ) )) | ||
|
||
helm: | ||
kubeconfig: (( landscape.clusters.[0].kubeconfig )) | ||
source: "chart-checkout/charts/cert-manager" | ||
name: cert-manager | ||
namespace: (( .namespace.name )) | ||
values: | ||
serviceAccount: | ||
create: true | ||
name: (( .settings.serviceAccountName )) | ||
|
||
state: | ||
<<: (( &state(merge none) )) | ||
ca: (( .settings.self-signed -and ( ! .settings.ca.given ) ? ( utilities.certs.selfSignedCA("self-signed-ca", false) ) :~~ )) |
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,4 @@ | ||
--- | ||
settings: (( &temporary )) | ||
|
||
export: (( settings )) |
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,8 @@ | ||
--- | ||
component: | ||
imports: | ||
- tiller | ||
- dns-controller | ||
- cert-controller: cert-manager/controller | ||
|
||
stubs: [] |
Oops, something went wrong.