@@ -419,6 +419,23 @@ func (p *NginxProvisioner) buildNginxConfigMaps(
419419 bootstrapCM .Data ["mgmt.conf" ] = string (helpers .MustExecuteTemplate (mgmtTemplate , mgmtFields ))
420420 }
421421
422+ // Create events ConfigMap with worker_connections using template
423+ eventsFields := map [string ]interface {}{
424+ "WorkerConnections" : workerConnections ,
425+ }
426+
427+ eventsCM := & corev1.ConfigMap {
428+ ObjectMeta : metav1.ObjectMeta {
429+ Name : p .cfg .GatewayPodConfig .Name + "-events" ,
430+ Namespace : objectMeta .Namespace ,
431+ Labels : objectMeta .Labels ,
432+ Annotations : objectMeta .Annotations ,
433+ },
434+ Data : map [string ]string {
435+ "events.conf" : string (helpers .MustExecuteTemplate (eventsTemplate , eventsFields )),
436+ },
437+ }
438+
422439 metricsPort := config .DefaultNginxMetricsPort
423440 port , enableMetrics := graph .MetricsEnabledForNginxProxy (nProxyCfg )
424441 if port != nil {
@@ -457,7 +474,7 @@ func (p *NginxProvisioner) buildNginxConfigMaps(
457474 },
458475 }
459476
460- return []client.Object {bootstrapCM , agentCM }
477+ return []client.Object {bootstrapCM , agentCM , eventsCM }
461478}
462479
463480func (p * NginxProvisioner ) buildOpenshiftObjects (objectMeta metav1.ObjectMeta ) []client.Object {
@@ -826,6 +843,7 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
826843 {MountPath : "/etc/nginx/conf.d" , Name : "nginx-conf" },
827844 {MountPath : "/etc/nginx/stream-conf.d" , Name : "nginx-stream-conf" },
828845 {MountPath : "/etc/nginx/main-includes" , Name : "nginx-main-includes" },
846+ {MountPath : "/etc/nginx/events-includes" , Name : "nginx-events-includes" },
829847 {MountPath : "/etc/nginx/secrets" , Name : "nginx-secrets" },
830848 {MountPath : "/var/run/nginx" , Name : "nginx-run" },
831849 {MountPath : "/var/cache/nginx" , Name : "nginx-cache" },
@@ -845,6 +863,8 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
845863 "--destination" , "/etc/nginx-agent" ,
846864 "--source" , "/includes/main.conf" ,
847865 "--destination" , "/etc/nginx/main-includes" ,
866+ "--source" , "/events/events.conf" ,
867+ "--destination" , "/etc/nginx/events-includes" ,
848868 },
849869 Env : []corev1.EnvVar {
850870 {
@@ -860,7 +880,9 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
860880 {MountPath : "/agent" , Name : "nginx-agent-config" },
861881 {MountPath : "/etc/nginx-agent" , Name : "nginx-agent" },
862882 {MountPath : "/includes" , Name : "nginx-includes-bootstrap" },
883+ {MountPath : "/events" , Name : "nginx-events-bootstrap" },
863884 {MountPath : "/etc/nginx/main-includes" , Name : "nginx-main-includes" },
885+ {MountPath : "/etc/nginx/events-includes" , Name : "nginx-events-includes" },
864886 },
865887 SecurityContext : & corev1.SecurityContext {
866888 Capabilities : & corev1.Capabilities {
@@ -927,6 +949,7 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
927949 {Name : "nginx-conf" , VolumeSource : emptyDirVolumeSource },
928950 {Name : "nginx-stream-conf" , VolumeSource : emptyDirVolumeSource },
929951 {Name : "nginx-main-includes" , VolumeSource : emptyDirVolumeSource },
952+ {Name : "nginx-events-includes" , VolumeSource : emptyDirVolumeSource },
930953 {Name : "nginx-secrets" , VolumeSource : emptyDirVolumeSource },
931954 {Name : "nginx-run" , VolumeSource : emptyDirVolumeSource },
932955 {Name : "nginx-cache" , VolumeSource : emptyDirVolumeSource },
@@ -941,6 +964,16 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec(
941964 },
942965 },
943966 },
967+ {
968+ Name : "nginx-events-bootstrap" ,
969+ VolumeSource : corev1.VolumeSource {
970+ ConfigMap : & corev1.ConfigMapVolumeSource {
971+ LocalObjectReference : corev1.LocalObjectReference {
972+ Name : p .cfg .GatewayPodConfig .Name + "-events" ,
973+ },
974+ },
975+ },
976+ },
944977 },
945978 },
946979 }
0 commit comments