-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Description This reverts commit 9e74e73. Reverting this commit as it is breaking long running tests. Needs to be investigated and checked in again with a fix. ``` Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 47m (x10 over 76m) default-scheduler 0/5 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/5 nodes are available: 5 Preemption is not helpful for scheduling.. Warning FailedScheduling 7m17s (x8 over 42m) default-scheduler 0/4 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.. Normal NotTriggerScaleUp 3m39s (x840 over 144m) cluster-autoscaler pod didn't trigger scale-up: 2 pod has unbound immediate PersistentVolumeClaims ``` ``` % kubectl get pvc -n radius-system NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE database-database-0 Pending standard 3d11h ``` No matching persistent volume to bind the pvc to - ``` % kubectl get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE pvc-3bc9bae6-18a1-41ed-b78e-01c347df6f68 1Gi RWO Delete Bound dapr-system/dapr-scheduler-data-dir-dapr-scheduler-server-0 default 116d ``` More details can be found here: #8238. Signed-off-by: Karishma Chawla <kachawla@microsoft.com>
- Loading branch information
Showing
8 changed files
with
316 additions
and
103 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
118 changes: 118 additions & 0 deletions
118
test/functional-portable/datastoresrp/noncloud/resources/sql_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
Copyright 2023 The Radius Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package resource_test | ||
|
||
import ( | ||
"runtime" | ||
"testing" | ||
|
||
"github.com/radius-project/radius/test/rp" | ||
"github.com/radius-project/radius/test/step" | ||
"github.com/radius-project/radius/test/testutil" | ||
"github.com/radius-project/radius/test/validation" | ||
) | ||
|
||
func Test_SQLDatabase_Manual(t *testing.T) { | ||
// https://github.com/microsoft/mssql-docker/issues/668 | ||
if runtime.GOARCH == "arm64" { | ||
t.Skip("skipping Test_SQL, unsupported architecture") | ||
} | ||
template := "testdata/datastoresrp-resources-sqldb-manual.bicep" | ||
name := "dsrp-resources-sql" | ||
appNamespace := "default-dsrp-resources-sql" | ||
|
||
test := rp.NewRPTest(t, name, []rp.TestStep{ | ||
{ | ||
Executor: step.NewDeployExecutor(template, testutil.GetMagpieImage()), | ||
RPResources: &validation.RPResourceSet{ | ||
Resources: []validation.RPResource{ | ||
{ | ||
Name: name, | ||
Type: validation.ApplicationsResource, | ||
}, | ||
{ | ||
Name: "sql-app-ctnr", | ||
Type: validation.ContainersResource, | ||
App: name, | ||
}, | ||
{ | ||
Name: "sql-db", | ||
Type: validation.SQLDatabasesResource, | ||
App: name, | ||
}, | ||
{ | ||
Name: "sql-ctnr", | ||
Type: validation.ContainersResource, | ||
App: name, | ||
}, | ||
}, | ||
}, | ||
K8sObjects: &validation.K8sObjectSet{ | ||
Namespaces: map[string][]validation.K8sObject{ | ||
appNamespace: { | ||
validation.NewK8sPodForResource(name, "sql-app-ctnr"), | ||
validation.NewK8sPodForResource(name, "sql-ctnr"), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
test.Test(t) | ||
} | ||
|
||
// Test_SQLDatabase_Recipe validates: | ||
// the creation of a sql database from recipe | ||
// container using the sqlDatabases portable resource to connect to the sql database resource | ||
func Test_SQLDatabase_Recipe(t *testing.T) { | ||
template := "testdata/datastoresrp-resources-sqldb-recipe.bicep" | ||
name := "dsrp-resources-sqldb-recipe" | ||
appNamespace := "dsrp-resources-sqldb-recipe-app" | ||
test := rp.NewRPTest(t, name, []rp.TestStep{ | ||
{ | ||
Executor: step.NewDeployExecutor(template, testutil.GetMagpieImage(), testutil.GetBicepRecipeRegistry(), testutil.GetBicepRecipeVersion()), | ||
RPResources: &validation.RPResourceSet{ | ||
Resources: []validation.RPResource{ | ||
{ | ||
Name: "dsrp-resources-env-sql-recipe-env", | ||
Type: validation.EnvironmentsResource, | ||
}, | ||
{ | ||
Name: "dsrp-resources-sqldb-recipe", | ||
Type: validation.ApplicationsResource, | ||
App: name, | ||
}, | ||
{ | ||
Name: "sql-recipe-app-ctnr", | ||
Type: validation.ContainersResource, | ||
App: name, | ||
}, | ||
}, | ||
}, | ||
K8sObjects: &validation.K8sObjectSet{ | ||
Namespaces: map[string][]validation.K8sObject{ | ||
appNamespace: { | ||
validation.NewK8sPodForResource(name, "sql-recipe-app-ctnr").ValidateLabels(false), | ||
validation.NewK8sPodForResource(name, "sql-recipe-resource").ValidateLabels(false), | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
test.Test(t) | ||
} |
104 changes: 104 additions & 0 deletions
104
...rtable/datastoresrp/noncloud/resources/testdata/datastoresrp-resources-sqldb-manual.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
extension radius | ||
|
||
@description('Specifies the location for resources.') | ||
param location string = 'global' | ||
|
||
@description('Specifies the image for the container resource.') | ||
param magpieImage string | ||
|
||
@description('Specifies the port for the container resource.') | ||
param magpiePort int = 3000 | ||
|
||
@description('Specifies the environment for resources.') | ||
param environment string = 'test' | ||
|
||
@description('Specifies the image for the sql container resource.') | ||
param sqlImage string = 'mcr.microsoft.com/mssql/server:2019-latest' | ||
|
||
@description('Specifies the port for the container resource.') | ||
param sqlPort int = 1433 | ||
|
||
@description('Specifies the SQL username.') | ||
param username string = 'sa' | ||
|
||
@description('Specifies the SQL password.') | ||
@secure() | ||
param password string = newGuid() | ||
|
||
resource app 'Applications.Core/applications@2023-10-01-preview' = { | ||
name: 'dsrp-resources-sql' | ||
location: location | ||
properties: { | ||
environment: environment | ||
} | ||
} | ||
|
||
resource webapp 'Applications.Core/containers@2023-10-01-preview' = { | ||
name: 'sql-app-ctnr' | ||
location: location | ||
properties: { | ||
application: app.id | ||
connections: { | ||
sql: { | ||
source: db.id | ||
} | ||
} | ||
container: { | ||
image: magpieImage | ||
env: { | ||
CONNECTION_SQL_CONNECTIONSTRING: { | ||
value: db.listSecrets().connectionString | ||
} | ||
} | ||
readinessProbe: { | ||
kind: 'httpGet' | ||
containerPort: magpiePort | ||
path: '/healthz' | ||
} | ||
} | ||
} | ||
} | ||
|
||
resource db 'Applications.Datastores/sqlDatabases@2023-10-01-preview' = { | ||
name: 'sql-db' | ||
location: location | ||
properties: { | ||
application: app.id | ||
environment: environment | ||
server: 'sql-ctnr' | ||
database: 'master' | ||
resourceProvisioning: 'manual' | ||
port: sqlPort | ||
username: username | ||
secrets: { | ||
password: password | ||
} | ||
} | ||
} | ||
|
||
resource sqlContainer 'Applications.Core/containers@2023-10-01-preview' = { | ||
name: 'sql-ctnr' | ||
location: location | ||
properties: { | ||
application: app.id | ||
container: { | ||
image: sqlImage | ||
env: { | ||
ACCEPT_EULA: { | ||
value: 'Y' | ||
} | ||
MSSQL_PID: { | ||
value: 'Developer' | ||
} | ||
MSSQL_SA_PASSWORD: { | ||
value: password | ||
} | ||
} | ||
ports: { | ||
sql: { | ||
containerPort: sqlPort | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.