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

Updated mariadb to serve over tls #696

Merged

Conversation

VaniHaripriya
Copy link
Contributor

@VaniHaripriya VaniHaripriya commented Aug 30, 2024

The issue resolved by this Pull Request:

Resolves #RHOAIENG-4972

Description of your changes:

  • Updated MariaDB config to server over TLS.
  • Added the oc annotation to generate the certs.
  • Added a config map with the ssl info.

Testing instructions

  • Deploy DSPO and the dspa using the below yaml file for two scenarios. After deployment, verify that the health
    checks are successful.
  • Create a pipeline run and ensure that it completes successfully.
  • Execute the following command inside the MariaDB pod terminal to verify that the TLS setup is correctly configured.
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -h 127.0.0.1 -D $MYSQL_DATABASE
   
MariaDB [mlpipeline]> SHOW GLOBAL VARIABLES LIKE 'have_ssl';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_ssl      | YES   |
+---------------+-------+
1 row in set (0.001 sec)
TLS Enabled
  1. Deploy the following DSPA
apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
kind: DataSciencePipelinesApplication
metadata:
  name: sample
spec:
  podToPodTLS: true
  dspVersion: v2
  apiServer:
    enableSamplePipeline: true
    cABundle:
      configMapKey: ca.crt
      configMapName: kube-root-ca.crt
  objectStorage:   
    enableExternalRoute: true
    minio:
      deploy: true
      image: 'quay.io/opendatahub/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance'  
  mlpipelineUI:
    image: quay.io/opendatahub/ds-pipelines-frontend:latest
TLS Disabled
  1. Deploy the following DSPA
apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
kind: DataSciencePipelinesApplication
metadata:
  name: sample
spec:
  podToPodTLS: false
  dspVersion: v2
  apiServer:
    enableSamplePipeline: true
    cABundle:
      configMapKey: ca.crt
      configMapName: kube-root-ca.crt
  objectStorage:  
    enableExternalRoute: true
    minio:
      deploy: true
      image: 'quay.io/opendatahub/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance'  
  mlpipelineUI:
    image: quay.io/opendatahub/ds-pipelines-frontend:latest

Checklist

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@dsp-developers
Copy link
Contributor

A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696
An OCP cluster where you are logged in as cluster admin is required.

To use this image run the following:

cd $(mktemp -d)
git clone [email protected]:opendatahub-io/data-science-pipelines-operator.git
cd data-science-pipelines-operator/
git fetch origin pull/696/head
git checkout -b pullrequest f3a81ee0eba65788cceed4f723428d6946594abf
oc new-project opendatahub
make deploy IMG="quay.io/opendatahub/data-science-pipelines-operator:pr-696"

More instructions here on how to deploy and test a Data Science Pipelines Application.

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

3 similar comments
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

1 similar comment
@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-696

PodToPodTLS bool

PodToPodTLS bool
CustomExtraParams string
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not 100% clear to me, but I believe TLS should be enabled when PodToPodTLS is true. Can you confirm @HumairAK?

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed.

so instead of doing this:

  database:
    customExtraParams: '{"tls":"true"}'

just make that happen automatically when PodToPodTLS is true

Copy link
Contributor

Choose a reason for hiding this comment

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

also it doesn't look like the value of customExtraParams is actually used anywhere, which is a bit puzzling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@HumairAK could you confirm that TLS should be enabled when PodToPodTLS is true. I remember that we discussed to use CustomExtraParams instead of PodToPodTLS in this case, so just want to make sure of that.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry for the delayed response, yes that's correct, we only want to enable mariadb when podtopodtls is set to true, in this scenario we should probably configure extra params automatically as needed to make this work

Copy link
Contributor

Choose a reason for hiding this comment

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

in this scenario we should probably configure extra params automatically as needed to make this work

so we don't need the customExtraParams at all. Cool. Thanks for confirming.

@hbelmiro
Copy link
Contributor

hbelmiro commented Sep 4, 2024

/verified

@anishasthana
Copy link
Member

/retest

@gregsheremeta
Copy link
Contributor

some nitpicks, but
/lgtm

controllers/database.go Outdated Show resolved Hide resolved
controllers/dspipeline_params.go Outdated Show resolved Hide resolved
@openshift-ci openshift-ci bot removed the lgtm label Sep 19, 2024
@gregsheremeta
Copy link
Contributor

/lgtm

nice work!

@openshift-ci openshift-ci bot added the lgtm label Sep 20, 2024
@HumairAK
Copy link
Contributor

awesome thanks folks!

/approve

Copy link
Contributor

openshift-ci bot commented Sep 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: HumairAK

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 7270713 into opendatahub-io:main Sep 20, 2024
7 checks passed
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