Skip to content

Commit

Permalink
chore: set GOMEMLIMIT and increase graceshutdownperiod (numaproj#319)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Wang <[email protected]>
  • Loading branch information
whynowy authored Nov 5, 2022
1 parent bfc1eb6 commit a37327a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/apis/numaflow/v1alpha1/jetstream_buffer_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (j JetStreamBufferService) GetStatefulSetSpec(req GetJetStreamStatefulSetSp
ServiceAccountName: j.ServiceAccountName,
Affinity: j.Affinity,
ShareProcessNamespace: pointer.Bool(true),
TerminationGracePeriodSeconds: pointer.Int64(60),
TerminationGracePeriodSeconds: pointer.Int64(120),
Volumes: []corev1.Volume{
{Name: "pid", VolumeSource: corev1.VolumeSource{EmptyDir: &corev1.EmptyDirVolumeSource{}}},
{
Expand Down Expand Up @@ -229,6 +229,7 @@ func (j JetStreamBufferService) GetStatefulSetSpec(req GetJetStreamStatefulSetSp
{Name: "SERVER_NAME", Value: "$(POD_NAME)"},
{Name: "POD_NAMESPACE", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}}},
{Name: "CLUSTER_ADVERTISE", Value: "$(POD_NAME)." + req.ServiceName + ".$(POD_NAMESPACE).svc.cluster.local"},
{Name: "GOMEMLIMIT", ValueFrom: &corev1.EnvVarSource{ResourceFieldRef: &corev1.ResourceFieldSelector{ContainerName: "main", Resource: "limits.memory"}}},
{Name: "JS_KEY", ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: req.ServerEncryptionSecretName}, Key: JetStreamServerSecretEncryptionKey}}},
},
VolumeMounts: []corev1.VolumeMount{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestJetStreamGetStatefulSetSpec(t *testing.T) {
for _, e := range spec.Template.Spec.Containers[0].Env {
envNames = append(envNames, e.Name)
}
for _, e := range []string{"POD_NAME", "SERVER_NAME", "POD_NAMESPACE", "CLUSTER_ADVERTISE", "JS_KEY"} {
for _, e := range []string{"POD_NAME", "SERVER_NAME", "POD_NAMESPACE", "CLUSTER_ADVERTISE", "GOMEMLIMIT", "JS_KEY"} {
assert.Contains(t, envNames, e)
}
})
Expand Down

0 comments on commit a37327a

Please sign in to comment.