forked from kube-logging/logging-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support TLS configuration with k8s.io/tls secrets
Modify the custom resources to optionally support specifying the certificate and key for each service using a secret of type `kubernetes.io/tls`.The pre-existing method of configuration, using a `Secret` that contained both cert/key pairs plus the CA cert remains the default. Also update the helm charts to optional support the new type of configuration. Fixes: kube-logging#133
- Loading branch information
Showing
15 changed files
with
194 additions
and
56 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
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
|
||
# TLS Configuration | ||
|
||
To configure TLS for Fluentd and Fluentbit the operator needs TLS certificates | ||
set via the Fluentd and Fluentbit Custom Resources respectively. This can be | ||
done in two ways: | ||
|
||
## Generic Opaque secret (default) | ||
|
||
Create a secret like this: | ||
|
||
``` | ||
apiVersion: v1 | ||
data: | ||
caCert: ... | ||
clientCert: ... | ||
clientKey: ... | ||
serverCert: ... | ||
serverKey: ... | ||
kind: Secret | ||
metadata: | ||
name: something-something-tls | ||
type: Opaque | ||
``` | ||
|
||
Note that we are providing three certificates in the same secret, one for | ||
Fluentd (`serverCert`), one for Fluentbit (`clientCert`), and the CA | ||
certificate (`caCert`). | ||
|
||
Then in your custom resource configure like this: | ||
|
||
``` | ||
apiVersion: logging.banzaicloud.com/v1alpha1 | ||
kind: Fluentd/Fluentbit | ||
metadata: | ||
name: my-fluent-thing | ||
spec: | ||
... | ||
tls: | ||
enabled: true | ||
secretName: something-something-tls | ||
sharedKey: changeme | ||
``` | ||
|
||
|
||
## `kubernetes.io/tls` | ||
|
||
The alternative is if your certificates are in secrets of type `kubernetes.io/tls`, e.g. | ||
|
||
``` | ||
apiVersion: v1 | ||
data: | ||
ca.crt: LS0tLS1... | ||
tls.crt: LS0tLS1... | ||
tls.key: LS0tLS1... | ||
kind: Secret | ||
metadata: | ||
name: something-something-tls | ||
type: kubernetes.io/tls | ||
``` | ||
|
||
Then configure your custom resources like this: | ||
|
||
``` | ||
apiVersion: logging.banzaicloud.com/v1alpha1 | ||
kind: Fluentd/Fluentbit | ||
metadata: | ||
name: my-fluent-thing | ||
spec: | ||
... | ||
tls: | ||
enabled: true | ||
secretName: something-something-tls | ||
secretType: tls | ||
sharedKey: changeme | ||
``` | ||
|
||
Note: in this case we can use the same secret for both Fluentbit and Fluentd, | ||
or create separate secrets for each. | ||
|
||
Note: the secret's data include the CA certificate, which is in-line with the | ||
structure created by [jetstack/cert-manager](https://github.com/jetstack/cert-manager/). | ||
|
||
## Usage with the helm chart | ||
|
||
For the generic Opaque secret just set `tls.enabled=True` and optionally provide the `tls.secretName` value to use your own certificates (instead of the automatically generated ones from the chart). | ||
|
||
For `kubernetes.io/tls` install `logging-operator-fluent` with a `values.yaml` like this: | ||
|
||
``` | ||
tls: | ||
enabled: true | ||
fluentbit: | ||
tlsSecret: something-something-tls | ||
fluentd: | ||
tlsSecret: otherthing-otherthing-tls | ||
``` | ||
|
||
For more information see the helm chart's [README.md](https://github.com/banzaicloud/logging-operator/blob/master/charts/logging-operator-fluent/README.md). |
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
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
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
Oops, something went wrong.