@@ -8,13 +8,14 @@ import (
88 "text/template"
99
1010 "github.com/cofide/spiffe-enable/internal/helper"
11+ "github.com/cofide/spiffe-enable/internal/workload"
1112 corev1 "k8s.io/api/core/v1"
1213 "k8s.io/utils/ptr"
1314)
1415
1516// Envoy-specific constants
1617var (
17- EnvoyImage = "envoyproxy/envoy:v1.33-latest "
18+ IstioImage = "docker.io/istio/proxyv2:1.26.4 "
1819)
1920
2021const (
@@ -25,7 +26,7 @@ const (
2526 EnvoyConfigContentEnvVar = "ENVOY_CONFIG_CONTENT"
2627 EnvoyConfigInitContainerName = "inject-envoy-config"
2728 EnvoyPort = 10000
28- EnvoyUID = 101
29+ EnvoyUID = 1337
2930 DNSProxyPort = 15053
3031)
3132
@@ -241,15 +242,21 @@ func (e *Envoy) GetSidecarContainer() corev1.Container {
241242
242243 return corev1.Container {
243244 Name : EnvoySidecarContainerName ,
244- Image : EnvoyImage ,
245+ Image : IstioImage ,
245246 ImagePullPolicy : corev1 .PullIfNotPresent ,
246247 Command : []string {"envoy" },
247248 Args : []string {"-c" , configFilePath },
248- VolumeMounts : []corev1.VolumeMount {{Name : EnvoyConfigVolumeName , MountPath : EnvoyConfigMountPath }},
249+ VolumeMounts : []corev1.VolumeMount {
250+ {Name : EnvoyConfigVolumeName , MountPath : EnvoyConfigMountPath },
251+ workload .GetSPIFFEVolumeMount (),
252+ },
249253 SecurityContext : & corev1.SecurityContext {
250- RunAsUser : ptr .To (int64 (101 )), // # Run as non-root user
251- RunAsGroup : ptr .To (int64 (101 )), // # Run as non-root group
252- RunAsNonRoot : ptr .To (true ),
254+ AllowPrivilegeEscalation : ptr .To (false ),
255+ RunAsUser : ptr .To (int64 (EnvoyUID )), // # Run as non-root user
256+ RunAsGroup : ptr .To (int64 (EnvoyUID )), // # Run as non-root group
257+ RunAsNonRoot : ptr .To (true ),
258+ Privileged : ptr .To (false ),
259+ Capabilities : & corev1.Capabilities {Drop : []corev1.Capability {"all" }},
253260 },
254261 Ports : []corev1.ContainerPort {
255262 {
0 commit comments