Skip to content

Commit 02bc1a6

Browse files
authored
fix(deploy): bump Envoy sidecar past stale-image gate, expose pod annotations (#357)
Signed-off-by: Tomas Pilar <thomas7pilar@gmail.com>
1 parent 3333f6d commit 02bc1a6

5 files changed

Lines changed: 28 additions & 9 deletions

File tree

deploy/helm/humr/templates/controller/deployment.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ spec:
6767
- name: AGENT_STORAGE_CLASS
6868
value: {{ . | quote }}
6969
{{- end }}
70+
{{- with .Values.controller.agentPodAnnotations }}
71+
- name: AGENT_POD_ANNOTATIONS
72+
value: {{ toJson . | quote }}
73+
{{- end }}
7074
- name: HUMR_API_SERVER_HOST
7175
value: "{{ include "humr.fullname" . }}-apiserver.{{ .Release.Namespace }}.svc.cluster.local"
7276
- name: HUMR_HARNESS_SERVER_URL
@@ -78,7 +82,7 @@ spec:
7882
- name: HUMR_TERMINATION_GRACE_PERIOD
7983
value: {{ .Values.controller.terminationGracePeriod | default 5 | quote }}
8084
- name: ENVOY_IMAGE
81-
value: {{ .Values.controller.envoyImage | default "envoyproxy/envoy-distroless:v1.32.0" | quote }}
85+
value: {{ .Values.controller.envoyImage | default "envoyproxy/envoy:distroless-v1.37.2" | quote }}
8286
- name: ENVOY_PORT
8387
value: {{ .Values.controller.envoyPort | default 10000 | quote }}
8488
- name: POD_NAME

deploy/helm/humr/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,18 @@ controller:
262262
# impersonation). Empty = cluster default (which must itself support RWX).
263263
# Set to "humr-rwx" to use the bundled in-cluster NFS provisioner below.
264264
agentStorageClass: ""
265+
# -- Extra annotations stamped on every agent pod. Useful for admission-webhook
266+
# break-glass annotations (e.g. `admission.stackrox.io/break-glass: ticket-1234`)
267+
# or for cluster-specific scheduling/observability hints.
268+
agentPodAnnotations: {}
265269
replicas: 1
266270
# -- Idle timeout before auto-hibernating running instances (Go duration, 0 = disabled)
267271
idleTimeout: "1h"
268272
# -- Termination grace period in seconds for agent pods
269273
terminationGracePeriod: 5
270274
# -- Image for the experimental Envoy credential-injector sidecar (ADR-033). Renders
271275
# only on instances with `experimentalCredentialInjector: true`.
272-
envoyImage: envoyproxy/envoy-distroless:v1.32.0
276+
envoyImage: envoyproxy/envoy:distroless-v1.37.2
273277
# -- Port the Envoy sidecar listens on inside the agent pod (proxy on 127.0.0.1).
274278
envoyPort: 10000
275279
# -- TLS interception support for the experimental credential injector. When enabled,

packages/controller/pkg/config/config.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package config
22

33
import (
4+
"encoding/json"
45
"fmt"
56
"os"
67
"strconv"
@@ -22,8 +23,9 @@ type Config struct {
2223
KeycloakClientSecret string // Confidential client secret
2324
LeaseName string // Leader election lease name
2425
PodName string // This pod's name (from downward API)
25-
AgentImagePullPolicy string // ImagePullPolicy for agent pods (default: IfNotPresent)
26-
AgentImagePullSecrets []string // Pull secret names for agent pods (comma-separated via env)
26+
AgentImagePullPolicy string // ImagePullPolicy for agent pods (default: IfNotPresent)
27+
AgentImagePullSecrets []string // Pull secret names for agent pods (comma-separated via env)
28+
AgentPodAnnotations map[string]string // Extra annotations stamped on every agent pod (e.g. admission webhook break-glass)
2729
AgentStorageClass string
2830
IdleTimeout time.Duration // Idle timeout before auto-hibernation (0 = disabled, default: 1h)
2931
TerminationGracePeriod int64 // Termination grace period in seconds for agent pods (default: 5)
@@ -79,10 +81,17 @@ func LoadFromEnv() (*Config, error) {
7981
}
8082
}
8183
}
84+
if v := os.Getenv("AGENT_POD_ANNOTATIONS"); v != "" {
85+
ann := map[string]string{}
86+
if err := json.Unmarshal([]byte(v), &ann); err != nil {
87+
return nil, fmt.Errorf("AGENT_POD_ANNOTATIONS: invalid JSON: %w", err)
88+
}
89+
cfg.AgentPodAnnotations = ann
90+
}
8291
cfg.AgentStorageClass = os.Getenv("AGENT_STORAGE_CLASS")
8392
cfg.IdleTimeout = envOrDefaultDuration("HUMR_IDLE_TIMEOUT", 1*time.Hour)
8493
cfg.TerminationGracePeriod = int64(envOrDefaultInt("HUMR_TERMINATION_GRACE_PERIOD", 5))
85-
cfg.EnvoyImage = envOrDefault("ENVOY_IMAGE", "envoyproxy/envoy-distroless:v1.32.0")
94+
cfg.EnvoyImage = envOrDefault("ENVOY_IMAGE", "envoyproxy/envoy:distroless-v1.37.2")
8695
cfg.EnvoyPort = envOrDefaultInt("ENVOY_PORT", 10000)
8796
cfg.EnvoyMitmCAIssuer = envOrDefault("ENVOY_MITM_CA_ISSUER", "humr-mitm-ca-issuer")
8897
cfg.EnvoyMitmLeafDuration = envOrDefaultDuration("ENVOY_MITM_LEAF_DURATION", 0)

packages/controller/pkg/reconciler/resources.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,11 @@ func BuildStatefulSet(name string, instance *types.InstanceSpec, agentSpec *type
249249
}}
250250
var automountSAToken *bool
251251
var shareProcessNS *bool
252-
var podAnnotations map[string]string
252+
podAnnotations := map[string]string{}
253+
for k, v := range cfg.AgentPodAnnotations {
254+
podAnnotations[k] = v
255+
}
253256
if instance.ExperimentalCredentialInjector {
254-
podAnnotations = map[string]string{}
255257
// Sidecar only — the agent container never sees credential mounts.
256258
volumes = append(volumes, envoySidecarVolumes(name, credentialSecrets)...)
257259
containers = append(containers, envoySidecarContainer(cfg, credentialSecrets))

packages/controller/pkg/reconciler/resources_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func envToMap(envs []corev1.EnvVar) map[string]string {
285285

286286
var testEnvoyConfig = func() *config.Config {
287287
cfg := *testConfig
288-
cfg.EnvoyImage = "envoyproxy/envoy-distroless:v1.32.0"
288+
cfg.EnvoyImage = "envoyproxy/envoy:distroless-v1.37.2"
289289
cfg.EnvoyPort = 10000
290290
return &cfg
291291
}()
@@ -314,7 +314,7 @@ func TestBuildStatefulSet_FlagOn_AddsEnvoySidecar(t *testing.T) {
314314
envoy := ss.Spec.Template.Spec.Containers[1]
315315
assert.Equal(t, "agent", agent.Name)
316316
assert.Equal(t, "envoy", envoy.Name)
317-
assert.Equal(t, "envoyproxy/envoy-distroless:v1.32.0", envoy.Image)
317+
assert.Equal(t, "envoyproxy/envoy:distroless-v1.37.2", envoy.Image)
318318

319319
envMap := envToMap(agent.Env)
320320
assert.Equal(t, "http://127.0.0.1:10000", envMap["HTTP_PROXY"])

0 commit comments

Comments
 (0)