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

[tlse] tls for PlacementAPI pod configuration #92

Merged

Conversation

Deydra71
Copy link
Contributor

@Deydra71 Deydra71 commented Oct 13, 2023

Public/Internal service cert secrets and the CA bundle secret can be passed to configure httpd virtual hosts for tls termination. The certs get direct mounted to the appropriate place in etc/pki/tls/certs/%s.crt|key and a CA bundle to
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem . Job deployments for bootstrap/cron get the CA bundle added if configured.

Depends-On: openstack-k8s-operators/lib-common#428

Jira: OSPRH-2368

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 13, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

"optional": true
},
{
"source": "/var/lib/config-data/ca-trust",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stuggi
Since we will be using one CA bundle file created by openstack-operator, we can specify the individual file instead the general folder (?)

Copy link
Contributor

Choose a reason for hiding this comment

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

yes lets do that

@SeanMooney
Copy link
Collaborator

this PR should contian updates to the samples and kuttl and even tests to test it
before it can be merged

@SeanMooney SeanMooney added requires-envtest This pr requires envtest coverage before it merges requires-kuttl This PR requires kuttl tests before it can merge requires-samples This PR requires samples to be updated before it can merge labels Oct 13, 2023
@Deydra71
Copy link
Contributor Author

Deydra71 commented Oct 13, 2023

this PR should contian updates to the samples and kuttl and even tests to test it before it can be merged

It's in the draft state still ^^

@SeanMooney
Copy link
Collaborator

yes i know just wanted to call that out
apparently the patches that added the service override functionality did not add that coverage so i don't want use to continue to extend this functionality uhntil that gap is closed

@stuggi
Copy link
Contributor

stuggi commented Oct 13, 2023

yes i know just wanted to call that out apparently the patches that added the service override functionality did not add that coverage so i don't want use to continue to extend this functionality uhntil that gap is closed

I had added envtest coverage in serviceoverride PR https://github.com/openstack-k8s-operators/placement-operator/blob/main/tests/functional/placementapi_controller_test.go#L452 / https://github.com/openstack-k8s-operators/placement-operator/blob/main/tests/functional/placementapi_controller_test.go#L537

Copy link
Collaborator

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

The general direction looks good to me

@Deydra71 Deydra71 force-pushed the tls-support branch 7 times, most recently from 030e9ef to 2cc67b3 Compare October 22, 2023 07:57
@Deydra71
Copy link
Contributor Author

@gibizer Could you please review, and give ok to test label if sufficient? I still need to make updates to kuttl and functional test, but otherwise the general TLS support is set from major part.

@Deydra71 Deydra71 requested a review from gibizer October 23, 2023 06:26
properties:
disableNonTLSListeners:
type: boolean
secretName:
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that this is probably not enough. we create two services per api, public and internal to allow to use different service types (also LoadBalancer types if you do not use routes for public). With the current tls struct here, we only allow passing in one secret for the service operator.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean this is not a blocker for this PR since its main focus is to get the cacert bundle in so that it can validate e.g. tls connection to db/rabbit. the second step would be to enable the tls for placement itself. just something we have to enhance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see, updating the Service struct could bring more mess as it's already being used in other's implementations. I suggest keeping this PR focused on CA bundle support and then in next implement the support for the public and internal service type.

@Deydra71 Deydra71 force-pushed the tls-support branch 3 times, most recently from 7157889 to 0e75c13 Compare October 26, 2023 09:00
@Deydra71
Copy link
Contributor Author

Deydra71 commented Nov 1, 2023

On hold until the agreed changes of the TLS structure are implemented in the lib-common.

@Deydra71 Deydra71 changed the title [TLS] Add support for the TLS configuration [tlse] tls for PlacementAPI pod configuration Dec 11, 2023
Comment on lines 24 to 27
metadata:
name: cert-public-svc
labels:
service: placement
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@openshift-ci openshift-ci bot removed the approved label Jan 19, 2024
@Deydra71 Deydra71 force-pushed the tls-support branch 3 times, most recently from d578b11 to 6779da3 Compare January 22, 2024 09:07
@gibizer
Copy link
Collaborator

gibizer commented Jan 22, 2024

/test placement-operator-build-deploy-kuttl

Warning: Push failed, retrying in 5s ...
Registry server Address: 
Registry server User Name: openstack-k8s-operators+cirobot
Registry server Email: 
Registry server Password: <<non-empty>>
error: build error: Failed to push image: trying to reuse blob sha256:07a64a71e01156f8f99039bc246149925c6d1480d3957de78510bbec6ec68f7a at destination: pinging container registry quay.rdoproject.org: Get "https://quay.rdoproject.org/v2/": net/http: TLS handshake timeout

Copy link
Collaborator

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

I'm happy with this. So

api/go.mod Outdated Show resolved Hide resolved
controllers/placementapi_controller.go Show resolved Hide resolved
Public/Internal service cert secrets and the CA bundle secret
can be passed to configure httpd virtual hosts for tls termination.
The certs are mounted to in
var/lib/config-data/tls/certs/%s.crt|key and a CA bundle to
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem.
Server cert and key are intended to be moved by kolla to
/etc/pki/tls/certs|private.

Depends-On: openstack-k8s-operators/lib-common#428

Signed-off-by: Veronika Fisarova <[email protected]>
Copy link
Collaborator

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

Looks good to me. I assume it was tested together with openstack-k8s-operators/openstack-operator#625 and works.

@openshift-ci openshift-ci bot added the lgtm label Jan 25, 2024
Copy link
Contributor

openshift-ci bot commented Jan 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Deydra71, gibizer

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 72883dc into openstack-k8s-operators:main Jan 25, 2024
6 checks passed
stuggi added a commit to stuggi/openstack-operator that referenced this pull request Jan 25, 2024
Creates certs for k8s service of the service operator when
spec.tls.endpoint.internal.enabled: true

For a service like nova which talks to multiple service internal
endpoints, this has to be set for each of them for, like:

~~~
  customServiceConfig: |
    [keystone_authtoken]
    insecure = true
    [placement]
    insecure = true
    [neutron]
    insecure = true
    [glance]
    insecure = true
    [cinder]
    insecure = true
~~~

Depends-On: openstack-k8s-operators/lib-common#428
Depends-On: openstack-k8s-operators#620
Depends-On: openstack-k8s-operators/placement-operator#92

Jira: OSPRH-2368
stuggi added a commit to stuggi/openstack-operator that referenced this pull request Jan 29, 2024
Creates certs for k8s service of the service operator when
spec.tls.endpoint.internal.enabled: true

For a service like nova which talks to multiple service internal
endpoints, this has to be set for each of them for, like:

~~~
  customServiceConfig: |
    [keystone_authtoken]
    insecure = true
    [placement]
    insecure = true
    [neutron]
    insecure = true
    [glance]
    insecure = true
    [cinder]
    insecure = true
~~~

Depends-On: openstack-k8s-operators/lib-common#428
Depends-On: openstack-k8s-operators#620
Depends-On: openstack-k8s-operators/placement-operator#92

Jira: OSPRH-2368
stuggi added a commit to stuggi/openstack-operator that referenced this pull request Jan 30, 2024
Creates certs for k8s service of the service operator when
spec.tls.endpoint.internal.enabled: true

For a service like nova which talks to multiple service internal
endpoints, this has to be set for each of them for, like:

~~~
  customServiceConfig: |
    [keystone_authtoken]
    insecure = true
    [placement]
    insecure = true
    [neutron]
    insecure = true
    [glance]
    insecure = true
    [cinder]
    insecure = true
~~~

Depends-On: openstack-k8s-operators/lib-common#428
Depends-On: openstack-k8s-operators#620
Depends-On: openstack-k8s-operators/placement-operator#92

Jira: OSPRH-2368
stuggi added a commit to stuggi/openstack-operator that referenced this pull request Feb 13, 2024
Creates certs for k8s service of the service operator when
spec.tls.endpoint.internal.enabled: true

For a service like nova which talks to multiple service internal
endpoints, this has to be set for each of them for, like:

~~~
  customServiceConfig: |
    [keystone_authtoken]
    insecure = true
    [placement]
    insecure = true
    [neutron]
    insecure = true
    [glance]
    insecure = true
    [cinder]
    insecure = true
~~~

Depends-On: openstack-k8s-operators/lib-common#428
Depends-On: openstack-k8s-operators#620
Depends-On: openstack-k8s-operators/placement-operator#92

Jira: OSPRH-2368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants