Skip to content

Commit 89c9cb7

Browse files
CatalogSource: add configurations for gRPC server memory footprint (openshift#288)
Signed-off-by: Steve Kuznetsov <[email protected]> Upstream-repository: api Upstream-commit: 704ae942c4a9a33a3326a7da9364bc59f20ae532 Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 8fba31d commit 89c9cb7

File tree

10 files changed

+67
-4
lines changed

10 files changed

+67
-4
lines changed

manifests/0000_50_olm_00-catalogsources.crd.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,13 @@ spec:
534534
topologyKey:
535535
description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
536536
type: string
537+
memoryTarget:
538+
description: "MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server, which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod will have the following modifications made to the container running the server: - the $GOMEMLIMIT environment variable will be set to this value in bytes - the memory request will be set to this value - the memory limit will be set to 200% of this value \n This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if a catalog being served is very large and needs more than the default allocation. If your index image has a file- system cache, determine a good approximation for this value by doubling the size of the package cache at /tmp/cache/cache/packages.json in the index image. \n This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set."
539+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
540+
anyOf:
541+
- type: integer
542+
- type: string
543+
x-kubernetes-int-or-string: true
537544
nodeSelector:
538545
description: NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node.
539546
type: object

pkg/manifests/csv.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: packageserver
66
namespace: openshift-operator-lifecycle-manager
77
labels:
8-
olm.version: 0.0.0-6e63ad61683d27bae6a357eb473fb3067a4c73e6
8+
olm.version: 0.0.0-ee4bc498873f18daef46f5b1e443f5abdb9732c9
99
olm.clusteroperator.name: operator-lifecycle-manager-packageserver
1010
annotations:
1111
include.release.openshift.io/self-managed-high-availability: "true"
@@ -159,7 +159,7 @@ spec:
159159
- packageserver
160160
topologyKey: "kubernetes.io/hostname"
161161
maturity: alpha
162-
version: 0.0.0-6e63ad61683d27bae6a357eb473fb3067a4c73e6
162+
version: 0.0.0-ee4bc498873f18daef46f5b1e443f5abdb9732c9
163163
apiservicedefinitions:
164164
owned:
165165
- group: packages.operators.coreos.com

staging/api/crds/operators.coreos.com_catalogsources.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,13 @@ spec:
532532
topologyKey:
533533
description: This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.
534534
type: string
535+
memoryTarget:
536+
description: "MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server, which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod will have the following modifications made to the container running the server: - the $GOMEMLIMIT environment variable will be set to this value in bytes - the memory request will be set to this value - the memory limit will be set to 200% of this value \n This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if a catalog being served is very large and needs more than the default allocation. If your index image has a file- system cache, determine a good approximation for this value by doubling the size of the package cache at /tmp/cache/cache/packages.json in the index image. \n This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set."
537+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
538+
anyOf:
539+
- type: integer
540+
- type: string
541+
x-kubernetes-int-or-string: true
535542
nodeSelector:
536543
description: NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node.
537544
type: object

staging/api/crds/zz_defs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/api/pkg/operators/v1alpha1/catalogsource_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/sirupsen/logrus"
99
corev1 "k8s.io/api/core/v1"
10+
"k8s.io/apimachinery/pkg/api/resource"
1011
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1112
"k8s.io/apimachinery/pkg/types"
1213
)
@@ -145,6 +146,21 @@ type GrpcPodConfig struct {
145146
// +kubebuilder:validation:Enum=legacy;restricted
146147
// +kubebuilder:default:=legacy
147148
SecurityContextConfig SecurityConfig `json:"securityContextConfig,omitempty"`
149+
150+
// MemoryTarget configures the $GOMEMLIMIT value for the gRPC catalog Pod. This is a soft memory limit for the server,
151+
// which the runtime will attempt to meet but makes no guarantees that it will do so. If this value is set, the Pod
152+
// will have the following modifications made to the container running the server:
153+
// - the $GOMEMLIMIT environment variable will be set to this value in bytes
154+
// - the memory request will be set to this value
155+
// - the memory limit will be set to 200% of this value
156+
//
157+
// This field should be set if it's desired to reduce the footprint of a catalog server as much as possible, or if
158+
// a catalog being served is very large and needs more than the default allocation. If your index image has a file-
159+
// system cache, determine a good approximation for this value by doubling the size of the package cache at
160+
// /tmp/cache/cache/packages.json in the index image.
161+
//
162+
// This field is best-effort; if unset, no default will be used and no Pod memory limit or $GOMEMLIMIT value will be set.
163+
MemoryTarget *resource.Quantity `json:"memoryTarget,omitempty"`
148164
}
149165

150166
// UpdateStrategy holds all the different types of catalog source update strategies

staging/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/crds/operators.coreos.com_catalogsources.yaml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/crds/zz_defs.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/catalogsource_types.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/operator-framework/api/pkg/operators/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)