-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
86 additions
and
8 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -94,6 +94,7 @@ kind: Sandbox | |
metadata: | ||
name: foo | ||
spec: | ||
size: small | ||
owners: | ||
- [email protected] | ||
``` | ||
|
@@ -137,9 +138,33 @@ One `RoleBinding` per name in the `owners` field | |
|
||
### ResourceQuota (sandbox-foo-resourcequota) | ||
|
||
The `ResourceQuota` that is applied to the `Namespace` depends on the `size` of the `Sandbox` that was created. | ||
|
||
#### Small | ||
|
||
|Resource Name|Quantity| | ||
|---|---| | ||
|ResourceRequestsMemory|1Gi| | ||
|ResourceRequestsCPU|0.25| | ||
|ResourceLimitsCPU|0.5| | ||
|ResourceRequestsMemory|250Mi| | ||
|ResourceLimitsMemory|500Mi| | ||
|ResourceRequestsStorage|10Gi| | ||
|ResourcePersistentVolumeClaims|2| | ||
|
||
#### Large | ||
|
||
|Resource Name|Quantity| | ||
|---|---| | ||
|ResourceRequestsCPU|1| | ||
|ResourceLimitsCPU|2| | ||
|ResourceRequestsMemory|2Gi| | ||
|ResourceLimitsMemory|8Gi| | ||
|ResourceRequestsStorage|40Gi| | ||
|ResourcePersistentVolumeClaims|8| | ||
|
||
```text | ||
NOTE: If no size is given, small is the default. | ||
``` | ||
|
||
## Managing Owners of a Sandbox | ||
|
||
|
@@ -153,6 +178,7 @@ kind: Sandbox | |
metadata: | ||
name: foo | ||
spec: | ||
size: small | ||
owners: | ||
- [email protected] | ||
- [email protected] | ||
|
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
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
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 |
---|---|---|
|
@@ -37,6 +37,7 @@ func TestSandboxControllerIntegration(t *testing.T) { | |
Name: "test", | ||
}, | ||
Spec: operatorsv1alpha1.SandboxSpec{ | ||
Size: "small", | ||
Owners: []string{"[email protected]"}, | ||
}, | ||
} | ||
|
@@ -78,6 +79,21 @@ func TestSandboxControllerIntegration(t *testing.T) { | |
t.Errorf("role not found: %v", err) | ||
} | ||
|
||
resourceQuota := getResourceQuota(sandbox) | ||
err = wait.PollImmediate(intervalTime, waitTime, func() (bool, error) { | ||
geterr := client.Get(ctx, types.NamespacedName{Namespace: resourceQuota.Namespace, Name: resourceQuota.Name}, &corev1.ResourceQuota{}) | ||
if geterr == nil { | ||
return true, nil | ||
} else if errors.IsNotFound(geterr) { | ||
return false, nil | ||
} else { | ||
return false, fmt.Errorf("get resourcequota: %w", geterr) | ||
} | ||
}) | ||
if err != nil { | ||
t.Errorf("resourcequota not found: %v", err) | ||
} | ||
|
||
if err := client.Delete(ctx, &sandbox); err != nil { | ||
t.Fatalf("delete sandbox: %v", err) | ||
} | ||
|
@@ -89,7 +105,7 @@ func TestSandboxControllerIntegration(t *testing.T) { | |
} else if err == nil { | ||
return false, nil | ||
} else { | ||
return false, fmt.Errorf("get sandbox: %v", err) | ||
return false, fmt.Errorf("get namespace: %v", err) | ||
} | ||
}) | ||
if err != nil { | ||
|
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 |
---|---|---|
|
@@ -3,5 +3,6 @@ kind: Sandbox | |
metadata: | ||
name: test | ||
spec: | ||
size: small | ||
owners: | ||
- [email protected] |
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
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