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

Openshift service certificates #1712

Merged
merged 2 commits into from
Aug 22, 2023

Conversation

pjuarezd
Copy link
Member

@pjuarezd pjuarezd commented Aug 5, 2023

Support for TLS Certificates issued by service-ca in Openshift

About Service CA Certificates

Service-ca is the Operator that signs certificates for services TLS traffic, the service CA expiration is 26 months and is automatically refreshed when there is less than 13 months validity left.

Service-ca certificates differentiates from certificates generated from a CertificateSigningRequest (CSR) because the CSR in Openshift issues certificates using the openshift-kube-controller-manager Operator, this operator is a control plane certificate, and rotate every 30 days.

Additionally to the expiration, the recommended way to secure traffic in Openshift is using Service certificates.

Some of the benefits are:

  1. Longer certificate and CA duration
  2. The certificate and key are automatically replaced when they get close to expiration.
  3. On rotation of the CA the previous service CA configuration is still trusted until its expiration
  4. Store TLS key/certificates in secrets
  5. Automatic store the CA bundle in the configmap openshift-service-ca.crt under the same namespace.
  6. Because certificate and CA bundle are available in configmap and secrets, can be mounted in the pod.
  7. deployment and statefulsets will automatically restart the pods if the secret or configmap mounted changes (AKA expire/rotate)

Scope

This PR covers the Services created for Minio Operator: console and sts. A next PR will cover the life cycle of certificates for the tenant and KES.

The certificate generation using service-ca is true only for Openshift, all of enabled only when the flag env variable
MINIO_OPERATOR_RUNTIME=OpenShift is set, otherwise Operator keeps the previous behavior of generate internal certificates using CSR's

Other enhancements for Openshift

  • Operator Console TLS certificate is enabled by default
  • Is now allowed to install the Minio Operator in the namespace minio-operator, before was mandatory to be installed in the openshift-operators namespace.

Fix openshift tests

  • Install Operator-sdk only if the binary is not available
  • Allow select the Openshift version
  • Bugix: Operator image used is the locally built instead of pull from registry

Copy link
Contributor

@jiuker jiuker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Others, should be fine to me.

pkg/apis/minio.min.io/v2/helper.go Outdated Show resolved Hide resolved
pkg/controller/main-controller.go Outdated Show resolved Hide resolved
pkg/apis/minio.min.io/v2/helper.go Outdated Show resolved Hide resolved
pkg/controller/main-controller.go Outdated Show resolved Hide resolved
pkg/controller/main-controller.go Outdated Show resolved Hide resolved
pkg/controller/main-controller.go Show resolved Hide resolved
pkg/controller/main-controller.go Outdated Show resolved Hide resolved
testing/openshift-common.sh Outdated Show resolved Hide resolved
@pjuarezd pjuarezd force-pushed the openshift-service-certificates branch from d5b0b22 to 84e39ad Compare August 18, 2023 18:28
- Allow Operator to be installed on it's own namespace in OperatorHub

Fix Openshift test:
* Allow select Openshift version
* Load Operator image from local build instead of remote registry
* Only download operator-sdk if not existing in local

Signed-off-by: pjuarezd <[email protected]>
@pjuarezd pjuarezd force-pushed the openshift-service-certificates branch from 68eee97 to 437416b Compare August 18, 2023 22:06
shtripat
shtripat previously approved these changes Aug 21, 2023
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good now. couple of rename of variables

pkg/apis/minio.min.io/v2/helper.go Outdated Show resolved Hide resolved
pkg/controller/tls.go Outdated Show resolved Hide resolved
Signed-off-by: pjuarezd <[email protected]>
Copy link
Contributor

@jiuker jiuker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pjuarezd pjuarezd merged commit 1542ad5 into minio:master Aug 22, 2023
24 checks passed
@pjuarezd pjuarezd deleted the openshift-service-certificates branch August 22, 2023 03:29
@djwfyi djwfyi mentioned this pull request Sep 6, 2023
2 tasks
@cniackz
Copy link
Contributor

cniackz commented Sep 12, 2023

Thank you @pjuarezd for this PR, you are amazing!.
Tomorrow we will study and document your PR, me and @feorlen
👍

@cniackz cniackz added the enhancement New feature or request label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants