Skip to content

Commit 513fe72

Browse files
committed
Adds support for noobaa external postgres
Signed-off-by: vbadrina <[email protected]>
1 parent 5646fc8 commit 513fe72

File tree

15 files changed

+882
-35
lines changed

15 files changed

+882
-35
lines changed

locales/en/plugin__odf-console.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,10 +628,23 @@
628628
"Data Foundation will use a StorageClass provided by the Local Storage Operator (LSO) on top of your attached drives. This option is available on any platform with devices attached to nodes.": "Data Foundation will use a StorageClass provided by the Local Storage Operator (LSO) on top of your attached drives. This option is available on any platform with devices attached to nodes.",
629629
"Connect an external storage platform": "Connect an external storage platform",
630630
"Data Foundation will create a dedicated StorageClass.": "Data Foundation will create a dedicated StorageClass.",
631+
"Use external PostgreSQL": "Use external PostgreSQL",
632+
"Allow Noobaa to connect to an external postgres server": "Allow Noobaa to connect to an external postgres server",
631633
"NFS is currently not supported for external storage type. To proceed with an external storage type, disable this option.": "NFS is currently not supported for external storage type. To proceed with an external storage type, disable this option.",
632634
"NFS is currently not supported for external storage type.": "NFS is currently not supported for external storage type.",
633635
"Enable network file system (NFS)": "Enable network file system (NFS)",
634636
"Allow NFS to use low resources by default.": "Allow NFS to use low resources by default.",
637+
"Server name": "Server name",
638+
"Port": "Port",
639+
"Database name": "Database name",
640+
"Enable TLS/SSL": "Enable TLS/SSL",
641+
"Enable this for encrytion on flight with the Postgres server": "Enable this for encrytion on flight with the Postgres server",
642+
"Allow self-signed certificates": "Allow self-signed certificates",
643+
"Adding this option will allow the postgres server to use a self-signed certificates.": "Adding this option will allow the postgres server to use a self-signed certificates.",
644+
"Enable client-side certificates": "Enable client-side certificates",
645+
"Select this option to upload and use your client side certificates": "Select this option to upload and use your client side certificates",
646+
"Accepted file types: .pem, .crt, .key": "Accepted file types: .pem, .crt, .key",
647+
"Files should be named private and public followed by compatible extensions": "Files should be named private and public followed by compatible extensions",
635648
"Deploys MultiCloud Object Gateway without block and file services.": "Deploys MultiCloud Object Gateway without block and file services.",
636649
"Deploys Data Foundation with block, shared fileSystem and object services.": "Deploys Data Foundation with block, shared fileSystem and object services.",
637650
"Deployment type": "Deployment type",
@@ -795,7 +808,6 @@
795808
"Please enter a URL": "Please enter a URL",
796809
"Please enter a valid port": "Please enter a valid port",
797810
"Address": "Address",
798-
"Port": "Port",
799811
"Client certificate": "Client certificate",
800812
"CA certificate": "CA certificate",
801813
"Client private key": "Client private key",
@@ -1115,6 +1127,7 @@
11151127
"Subscription": "Subscription",
11161128
"Subscriptions": "Subscriptions",
11171129
"Project": "Project",
1130+
"Show password": "Show password",
11181131
"Deployment details": "Deployment details",
11191132
"Metrics": "Metrics",
11201133
"CPU usage": "CPU usage",

packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@
1818
.odf-backing-store__dropdown--margin-top {
1919
margin-top: var(--pf-global--spacer--sm);
2020
}
21+
22+
.odf-backing-store__ssl {
23+
padding-left: var(--pf-global--spacer--xl);
24+
padding-bottom: var(--pf-global--spacer--xl); ;
25+
}
26+
27+
.odf-backing-store__tls--margin-top {
28+
margin-top: var(--pf-global--spacer--md);
29+
}
30+
31+
32+

packages/odf/components/create-storage-system/create-storage-system-steps/backing-storage-step/backing-storage-step.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ import {
3535
Radio,
3636
Alert,
3737
AlertVariant,
38+
Checkbox,
3839
} from '@patternfly/react-core';
3940
import { ErrorHandler } from '../../error-handler';
4041
import { WizardState, WizardDispatch } from '../../reducer';
4142
import { EnableNFS } from './enable-nfs';
43+
import { PostgresConnectionDetails } from './noobaa-external-postgres/postgres-connection-details';
4244
import { SelectDeployment } from './select-deployment';
4345
import { SetCephRBDStorageClassDefault } from './set-rbd-sc-default';
4446
import './backing-storage-step.scss';
@@ -189,6 +191,8 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
189191
isRBDStorageClassDefault,
190192
externalStorage,
191193
deployment,
194+
externalPostgres,
195+
useExternalPostgres,
192196
} = state;
193197

194198
const { t } = useCustomTranslation();
@@ -364,6 +368,38 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
364368
/>
365369
</>
366370
)}
371+
<Checkbox
372+
id="use-external-postgress"
373+
label={t('Use external PostgreSQL')}
374+
description={t(
375+
'Allow Noobaa to connect to an external postgres server'
376+
)}
377+
isChecked={useExternalPostgres}
378+
onChange={() =>
379+
dispatch({
380+
type: 'backingStorage/useExternalPostgres',
381+
payload: !useExternalPostgres,
382+
})
383+
}
384+
className="odf-backing-store__radio--margin-bottom"
385+
/>
386+
{useExternalPostgres && (
387+
<PostgresConnectionDetails
388+
dispatch={dispatch}
389+
tlsFiles={[
390+
externalPostgres.tls.keys.private,
391+
externalPostgres.tls.keys.public,
392+
]}
393+
tlsEnabled={externalPostgres.tls.enabled}
394+
allowSelfSignedCerts={externalPostgres.tls.allowSelfSignedCerts}
395+
username={externalPostgres.username}
396+
password={externalPostgres.password}
397+
serverName={externalPostgres.serverName}
398+
databaseName={externalPostgres.databaseName}
399+
port={externalPostgres.port}
400+
enableClientSideCerts={externalPostgres.tls.enableClientSideCerts}
401+
/>
402+
)}
367403
</Form>
368404
</ErrorHandler>
369405
);

0 commit comments

Comments
 (0)