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

docs: replace cert-manager #1210

Merged
merged 44 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e089a5d
k8s doc references on landing page
StackScribe Mar 2, 2023
3246ac6
process go.mod file
StackScribe Mar 2, 2023
4c4ef1d
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 8, 2023
84bc148
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 9, 2023
9937c95
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 17, 2023
3350da4
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 21, 2023
74d49ed
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 23, 2023
b97cc28
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 24, 2023
91dac8e
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 30, 2023
489dcde
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Mar 31, 2023
4232dd7
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Apr 4, 2023
f02cb14
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Apr 6, 2023
76c23bc
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Apr 11, 2023
f377a78
periods at end of list items
StackScribe Apr 11, 2023
4fab192
Each manifest
StackScribe Apr 12, 2023
bc83733
annotations match above
StackScribe Apr 12, 2023
6cbd89d
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 12, 2023
4102d7b
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 12, 2023
fdac309
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 12, 2023
3d55530
more explicit that cert-manager is optional step
StackScribe Apr 12, 2023
addefb8
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 12, 2023
83476c1
Merge branch 'main' into 0411-cert-manager
StackScribe Apr 12, 2023
8988a56
Merge branch 'main' into 0411-cert-manager
StackScribe Apr 13, 2023
35df1d8
Add architectural description of cert-manager
StackScribe Apr 13, 2023
cb57909
Merge branch '0411-cert-manager' of github.com:StackScribe/lifecycle-…
StackScribe Apr 13, 2023
122188d
Merge branch 'main' into 0411-cert-manager
StackScribe Apr 13, 2023
2cd118e
markdownlint-fix
StackScribe Apr 13, 2023
9dc8a45
Merge branch '0411-cert-manager' of github.com:StackScribe/lifecycle-…
StackScribe Apr 13, 2023
321970d
Merge branch 'main' of github.com:keptn/lifecycle-toolkit
StackScribe Apr 15, 2023
60ba57c
how to delete klt cert-manager
StackScribe Apr 17, 2023
199d5b3
delete concepts/overview again
StackScribe Apr 17, 2023
96cca0c
rebase issues
StackScribe Apr 17, 2023
f011c8e
fix merge conflicts
StackScribe Apr 12, 2023
61907c1
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 12, 2023
2e2c03f
Update docs/content/en/docs/install/cert-manager.md
StackScribe Apr 17, 2023
e614b76
rebase merge conflicts
StackScribe Apr 17, 2023
b9ee5e6
rebase merge conflicts
StackScribe Apr 17, 2023
94ffb44
rebase merge conflicts
StackScribe Apr 17, 2023
dc65b8a
Merge branch '0411-cert-manager' of github.com:StackScribe/lifecycle-…
StackScribe Apr 17, 2023
f55d49a
Merge branch 'main' into 0411-cert-manager
StackScribe Apr 17, 2023
c365e6c
markdownlint-fix
StackScribe Apr 17, 2023
71f4755
Merge branch '0411-cert-manager' of github.com:StackScribe/lifecycle-…
StackScribe Apr 17, 2023
e38594c
xref error
StackScribe Apr 17, 2023
fcbb58e
Merge branch 'main' into 0411-cert-manager
StackScribe Apr 17, 2023
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
65 changes: 65 additions & 0 deletions docs/content/en/docs/concepts/architecture/cert-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Keptn Certificate Manager
description: Learn how the cert-manager works
icon: concepts
layout: quickstart
weight: 100
hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html
---

### Keptn Cert Manager

The Lifecycle Toolkit includes a Mutating Webhook
that requires TLS certificates to be mounted as a volume in its pod.
In version 0.6.0 and later, the certificate creation
is handled automatically by
the [klt-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/klt-cert-manager/README.md).

How it works:

* The certificate is created as a secret
in the `keptn-lifecycle-toolkit-system` namespace
with a renewal threshold of 12 hours.
* If the certificate expires,
the [klt-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/klt-cert-manager/README.md)
renews it.
* The Lifecycle Toolkit operator waits for a valid certificate to be ready.
* When the certificate is ready,
it is mounted on an empty dir volume in the operator.

`klt-cert-manager` is a customized certificate manager
that is installed with the Lifecycle Toolkit by default.
It is included to simplify installation for new users
and because it is much smaller than most standard certificate managers.
However, KLT is compatible with most certificate managers
and can be configured to use another certificate manager if you prefer.
See [Use your own cert-manager](../../install/cert-manager.md)
for instructions.

## Invalid certificate errors

When a certificate is left over from an older version,
the webhook or the operator may generate errors
because of an invalid certificate.
To solve this, delete the certificate and restart the operator.

The KLT cert-manager certificate is stored as a secret in the `klt` namespace.
To retrieve it:

```shell
kubectl get secrets -n keptn-lifecycle-toolkit-system
```

This returns something like:

```shell
NAME TYPE DATA AGE
klt-certs Opaque 5 4d23h
```

Specify the `NAME` of the KLT certificate (`klt-certs` in this case)
to delete the KLT certificate:

```shell
kubectl delete secret klt-certs -n keptn-lifecycle-toolkit-system
```

This file was deleted.

3 changes: 3 additions & 0 deletions docs/content/en/docs/install/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ or as part of an existing production cluster.
1. Understand the [Software versions and resources](reqs.md)
that are required
1. [Bring or create your Kubernetes cluster](k8s.md)
1. [Replace the default cert-manager](cert-manager.md) (optional)
StackScribe marked this conversation as resolved.
Show resolved Hide resolved
This step is only required if you want to replace the default KLT cert-manager
with another cert-manager.
1. [Install the Keptn Lifecycle Controller](install.md)
1. [Integrate the Keptn Lifecycle Controller into your Kubernetes cluster](integrate.md)
1. [Upgrade](upgrade.md) to a new version of the Keptn Lifecycle Toolkit
99 changes: 99 additions & 0 deletions docs/content/en/docs/install/cert-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
title: Use your own cert-manager (optional)
description: Replace the default KLT cert-manager
weight: 30
hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.html
---

The Keptn Lifecycle Toolkit includes
a light-weight, customized cert-manager
that is used to register Webhooks to the [KubeAPI](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/).
Bundling the cert-manager simplifies the installation for new users
and provides the functionality KLT needs
without the overhead of other cert-managers.
For a description of the architecture, see
[Keptn Certificate Manager](../concepts/architecture/cert-manager.md).

KLT, however, works well with standard cert-managers.
The KLT cert-manager can also coexist with another cert-manager.
If you are already using a different cert-manager,
you can continue to use that cert-manager for other components
and use the KLT cert-manager just for KLT activities
or you can configure KLT to use that cert-manager.

If you want KLT to use your cert-manager,
you must configure it *before* you install KLT.
The steps are:

* Install the cert-manager of your choice
if it is not already installed.
* Modify the `Deployment` manifest of each KLT operator component.
* Add the `Certificate` CRD for the cert-manager you are using.

## Modify the KLT manifest

You must modify the KLT manifest for each KLT operator component
to make it aware of the cert-manager you are using.
These instructions implement
[cert-manager.io](https://cert-manager.io/);
the process is similar for other cert-managers.

To configure KLT to use your cert-manager,
change the `Deployment` manifest of each KLT operator component
and **replace** the following `volumes` definition

```yaml
- emptyDir: {}
name: certs-dir
```

with

```yaml
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert
```

Each manifest must have the following special annotation:

```yaml
cert-manager.io/inject-ca-from=klt-serving-cert/keptn-lifecycle-toolkit-system
```

The value of the annotation must match the
`name/namespace` of the cert-manager CRD discussed below.

## Add the CRD for your cert-manager

This is the CRD for `cert-manager.io`:

```yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: klt-serving-cert
namespace: keptn-lifecycle-toolkit-system
spec:
dnsNames:
- lifecycle-webhook-service.keptn-lifecycle-toolkit-system.svc
- lifecycle-webhook-service.keptn-lifecycle-toolkit-system.svc.cluster.local
issuerRef:
kind: Issuer
name: klt-selfsigned-issuer
secretName webhook-server-cert
```

Note the following about these fields:

* The `apiVersion` field refers to the API for the cert-manager.
* The `metadata` section includes two fields.
The value of these fields must match the annotations
used in the KLT operator manifests.
* The value of the `secretName` field
must match the value of the `secretName` field used
in the `volumes` definition section of the KLT operator manifests above.

See the [CA Injector](https://cert-manager.io/docs/concepts/ca-injector/)
documentation for more details.
9 changes: 9 additions & 0 deletions docs/content/en/docs/install/reqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ hidechildren: false # this flag hides all sub-pages in the sidebar-multicard.htm
The Keptn Lifecycle Controller requires Kubernetes v1.24.0 or later.

## Resource requirements

## cert-manager

KLT includes a lightweight cert-manager
that is used for installation and Webhooks.
You can configure a different cert-manager
before you install KLT.
See [Implement your own cert-manager](cert-manager.md)
for instructions.