@@ -551,6 +551,57 @@ var _ = Describe("Operator smoke test", func() {
551
551
}
552
552
})
553
553
554
+ It ("using grpcs for storage connection" , func () {
555
+ By ("create secret..." )
556
+ cert := testobjects .DefaultCertificate (
557
+ filepath .Join ("." , "data" , "tls.crt" ),
558
+ filepath .Join ("." , "data" , "tls.key" ),
559
+ filepath .Join ("." , "data" , "ca.crt" ),
560
+ )
561
+ Expect (k8sClient .Create (ctx , cert )).Should (Succeed ())
562
+ defer func () {
563
+ Expect (k8sClient .Delete (ctx , cert )).Should (Succeed ())
564
+ }()
565
+
566
+ By ("create storage..." )
567
+ storageSample = testobjects .DefaultStorage (filepath .Join ("." , "data" , "storage-block-4-2-config-tls.yaml" ))
568
+ storageSample .Spec .Service .GRPC .TLSConfiguration .Enabled = true
569
+ storageSample .Spec .Service .GRPC .TLSConfiguration .Certificate = corev1.SecretKeySelector {
570
+ LocalObjectReference : corev1.LocalObjectReference {Name : testobjects .CertificateSecretName },
571
+ Key : "tls.crt" ,
572
+ }
573
+ storageSample .Spec .Service .GRPC .TLSConfiguration .Key = corev1.SecretKeySelector {
574
+ LocalObjectReference : corev1.LocalObjectReference {Name : testobjects .CertificateSecretName },
575
+ Key : "tls.key" ,
576
+ }
577
+ storageSample .Spec .Service .GRPC .TLSConfiguration .CertificateAuthority = corev1.SecretKeySelector {
578
+ LocalObjectReference : corev1.LocalObjectReference {Name : testobjects .CertificateSecretName },
579
+ Key : "ca.crt" ,
580
+ }
581
+
582
+ Expect (k8sClient .Create (ctx , storageSample )).Should (Succeed ())
583
+ defer func () {
584
+ Expect (k8sClient .Delete (ctx , storageSample )).Should (Succeed ())
585
+ }()
586
+ By ("create database..." )
587
+ Expect (k8sClient .Create (ctx , databaseSample )).Should (Succeed ())
588
+ defer func () {
589
+ Expect (k8sClient .Delete (ctx , databaseSample )).Should (Succeed ())
590
+ }()
591
+
592
+ By ("waiting until Storage is ready..." )
593
+ waitUntilStorageReady (ctx , storageSample .Name , testobjects .YdbNamespace )
594
+
595
+ By ("checking that all the storage pods are running and ready..." )
596
+ checkPodsRunningAndReady (ctx , "ydb-cluster" , "kind-storage" , storageSample .Spec .Nodes )
597
+
598
+ By ("waiting until database is ready..." )
599
+ waitUntilDatabaseReady (ctx , databaseSample .Name , testobjects .YdbNamespace )
600
+
601
+ By ("checking that all the database pods are running and ready..." )
602
+ checkPodsRunningAndReady (ctx , "ydb-cluster" , "kind-database" , databaseSample .Spec .Nodes )
603
+ })
604
+
554
605
AfterEach (func () {
555
606
Expect (uninstallOperatorWithHelm (testobjects .YdbNamespace )).Should (BeTrue ())
556
607
Expect (k8sClient .Delete (ctx , & namespace )).Should (Succeed ())
0 commit comments