Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/cluster/resourcequota.go
2501 views
1
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package cluster
6
7
import (
8
"github.com/gitpod-io/gitpod/installer/pkg/common"
9
corev1 "k8s.io/api/core/v1"
10
"k8s.io/apimachinery/pkg/api/resource"
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
12
"k8s.io/apimachinery/pkg/runtime"
13
)
14
15
func resourcequota(ctx *common.RenderContext) ([]runtime.Object, error) {
16
return []runtime.Object{&corev1.ResourceQuota{
17
TypeMeta: common.TypeMetaResourceQuota,
18
ObjectMeta: metav1.ObjectMeta{
19
Name: "gitpod-resource-quota",
20
Namespace: ctx.Namespace,
21
},
22
Spec: corev1.ResourceQuotaSpec{
23
Hard: map[corev1.ResourceName]resource.Quantity{
24
"pods": resource.MustParse("10k"),
25
},
26
ScopeSelector: &corev1.ScopeSelector{
27
MatchExpressions: []corev1.ScopedResourceSelectorRequirement{
28
{
29
Operator: corev1.ScopeSelectorOpIn,
30
ScopeName: corev1.ResourceQuotaScopePriorityClass,
31
Values: []string{common.SystemNodeCritical},
32
},
33
},
34
},
35
},
36
}}, nil
37
}
38
39