ce7cb702218693d08ea6d83464d2457c9250027c
This commit is contained in:
commit
34c5f8963c
5 changed files with 145336 additions and 0 deletions
35
vendor/infrastructure/cert-manager/config/issuers.yaml
vendored
Normal file
35
vendor/infrastructure/cert-manager/config/issuers.yaml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: vault-internal
|
||||
spec:
|
||||
vault:
|
||||
path: pki_int/sign/cert-manager
|
||||
server: https://vault-active-tls.vault.svc.cluster.local:443
|
||||
serverName: vault-active-direct.vault.svc.cluster.local
|
||||
caBundleSecretRef:
|
||||
name: vault-root-ca
|
||||
key: ca.crt
|
||||
auth:
|
||||
kubernetes:
|
||||
role: cert-manager
|
||||
mountPath: /v1/auth/kubernetes
|
||||
serviceAccountRef:
|
||||
name: cert-manager
|
||||
---
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: ClusterIssuer
|
||||
metadata:
|
||||
name: letsencrypt
|
||||
spec:
|
||||
acme:
|
||||
server: https://acme-v02.api.letsencrypt.org/directory
|
||||
email: [email protected]
|
||||
privateKeySecretRef:
|
||||
name: letsencrypt-account-key
|
||||
solvers:
|
||||
- dns01:
|
||||
cloudflare:
|
||||
apiTokenSecretRef:
|
||||
name: cloudflare-api-token
|
||||
key: api-token
|
||||
7
vendor/infrastructure/cert-manager/config/kustomization.yaml
vendored
Normal file
7
vendor/infrastructure/cert-manager/config/kustomization.yaml
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- vault-root-ca.yaml
|
||||
- vso.yaml
|
||||
- vault-auth.yaml
|
||||
- issuers.yaml
|
||||
24
vendor/infrastructure/cert-manager/config/vault-auth.yaml
vendored
Normal file
24
vendor/infrastructure/cert-manager/config/vault-auth.yaml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: vault-auth
|
||||
namespace: cert-manager
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: [serviceaccounts/token]
|
||||
resourceNames: [cert-manager]
|
||||
verbs: [create]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: vault-auth
|
||||
namespace: cert-manager
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: cert-manager
|
||||
namespace: cert-manager
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: vault-auth
|
||||
20
vendor/infrastructure/cert-manager/config/vault-root-ca.yaml
vendored
Normal file
20
vendor/infrastructure/cert-manager/config/vault-root-ca.yaml
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultDynamicSecret
|
||||
metadata:
|
||||
name: vault-root-ca
|
||||
namespace: cert-manager
|
||||
spec:
|
||||
vaultAuthRef: kv
|
||||
mount: pki
|
||||
path: cert/ca
|
||||
requestHTTPMethod: GET
|
||||
refreshAfter: 1h
|
||||
destination:
|
||||
create: true
|
||||
overwrite: true
|
||||
name: vault-root-ca
|
||||
transformation:
|
||||
excludeRaw: true
|
||||
templates:
|
||||
ca.crt:
|
||||
text: '{{ get .Secrets "certificate" }}'
|
||||
31
vendor/infrastructure/cert-manager/config/vso.yaml
vendored
Normal file
31
vendor/infrastructure/cert-manager/config/vso.yaml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
# VSO syncs the Cloudflare API token from Vault KV -> cert-manager namespace
|
||||
# so the letsencrypt ClusterIssuer can use it for DNS-01 challenges.
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultAuth
|
||||
metadata:
|
||||
name: kv
|
||||
namespace: cert-manager
|
||||
spec:
|
||||
method: kubernetes
|
||||
mount: kubernetes
|
||||
kubernetes:
|
||||
role: cert-manager-kv
|
||||
serviceAccount: cert-manager
|
||||
vaultConnectionRef: vault/vault
|
||||
---
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: cloudflare-api-token
|
||||
namespace: cert-manager
|
||||
spec:
|
||||
type: kv-v2
|
||||
mount: secret
|
||||
path: cloudflare/cert-manager-dns01
|
||||
destination:
|
||||
name: cloudflare-api-token
|
||||
create: true
|
||||
overwrite: true
|
||||
refreshAfter: 1h
|
||||
vaultAuthRef: kv
|
||||
Loading…
Reference in a new issue