-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from natron-io/quotas
Quotas redef.
- Loading branch information
Showing
7 changed files
with
93 additions
and
103 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ResourceQuota | ||
metadata: | ||
name: netrics | ||
spec: | ||
hard: | ||
cpu: "10" | ||
memory: 20Gi | ||
longhorn.storageclass.storage.k8s.io/requests.storage: 0Gi | ||
longhorn-hdd-backup.storageclass.storage.k8s.io/requests.storage: 0Gi | ||
longhorn-hdd-backup-long.storageclass.storage.k8s.io/requests.storage: 0Gi | ||
longhorn-ssd-backup.storageclass.storage.k8s.io/requests.storage: 0Gi | ||
longhorn-ssd-backup-long.storageclass.storage.k8s.io/requests.storage: 50Gi | ||
standard.storageclass.storage.k8s.io/requests.storage: 50Gi |
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 |
---|---|---|
@@ -1,8 +1,21 @@ | ||
package util | ||
|
||
var ( | ||
QUOTA_NAMESPACE_SUFFIX string | ||
QUOTA_CPU_LABEL string | ||
QUOTA_MEMORY_LABEL string | ||
QUOTA_STORAGE_LABEL map[string]string | ||
import ( | ||
"context" | ||
|
||
v1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// GetRessourceQuota returns the resource quota for the given tenant and label set in the config namespace | ||
func GetRessourceQuota(tenant string) (v1.ResourceQuota, error) { | ||
// get resource quota in namespace "test-tenant-config" | ||
|
||
// get resource quota from namespace | ||
quota, err := Clientset.CoreV1().ResourceQuotas(tenant).Get(context.TODO(), tenant, metav1.GetOptions{}) | ||
if err != nil { | ||
return v1.ResourceQuota{}, err | ||
} | ||
|
||
return *quota, nil | ||
} |