diff --git a/containers/proxy-helm/proxy-helm.changes.mbussolotto.squid_conf b/containers/proxy-helm/proxy-helm.changes.mbussolotto.squid_conf new file mode 100644 index 000000000000..30bcf7a9d6ee --- /dev/null +++ b/containers/proxy-helm/proxy-helm.changes.mbussolotto.squid_conf @@ -0,0 +1 @@ +- add apache and squid tuning diff --git a/containers/proxy-helm/templates/config.yaml b/containers/proxy-helm/templates/config.yaml index ca0209e579ec..988f68cefc75 100644 --- a/containers/proxy-helm/templates/config.yaml +++ b/containers/proxy-helm/templates/config.yaml @@ -13,6 +13,12 @@ data: log_level: {{ .Values.log_level | default 1 }} ca_crt: | {{ .Values.ca_crt | indent 6 }} + squid_tuning: | + # Add your Squid tuning configuration here +{{ .Values.squid_tuning | indent 4 }} + apache_tuning: | + # Add your Apache tuning configuration here +{{ .Values.apache_tuning | indent 4 }} --- apiVersion: v1 kind: Secret diff --git a/containers/proxy-helm/templates/deployment.yaml b/containers/proxy-helm/templates/deployment.yaml index d151fe7d1d73..c127f02c2035 100644 --- a/containers/proxy-helm/templates/deployment.yaml +++ b/containers/proxy-helm/templates/deployment.yaml @@ -32,6 +32,10 @@ spec: mountPath: /var/cache/rhn - name: tftp-boot mountPath: /srv/tftpboot + - name: config-volume + mountPath: /etc/apache2/conf.d/apache_tuning.conf + subPath: apache_tuning + readOnly: true ports: - containerPort: 80 - containerPort: 443 @@ -56,6 +60,10 @@ spec: readOnly: true - name: squid-cache mountPath: /var/cache/squid + - name: config-volume + mountPath: /etc/squid/conf.d/squid_tuning.conf + subPath: squid_tuning + readOnly: true ports: - containerPort: 8088 - name: ssh @@ -93,6 +101,10 @@ spec: items: - key: config.yaml path: config.yaml + - key: squid_tuning + path: squid_tuning + - key: apache_tuning + path: apache_tuning - name: httpd-secret-volume secret: secretName: proxy-secret diff --git a/containers/proxy-helm/values.yaml b/containers/proxy-helm/values.yaml index 13823001cd6b..0bb54e938205 100644 --- a/containers/proxy-helm/values.yaml +++ b/containers/proxy-helm/values.yaml @@ -61,3 +61,6 @@ services: nodeport_saltb: 32506 nodeport_ssh: 30020 nodeport_tfpt: 30069 + +squid_tuning: "" +apache_tuning: "" diff --git a/containers/proxy-squid-image/Dockerfile b/containers/proxy-squid-image/Dockerfile index bf4277e82654..17785c0257eb 100644 --- a/containers/proxy-squid-image/Dockerfile +++ b/containers/proxy-squid-image/Dockerfile @@ -30,6 +30,9 @@ COPY squid.conf /etc/squid/squid.conf RUN chown squid:squid /etc/squid/squid.conf RUN mkdir -p /run/squid && chown squid:squid /run/squid +RUN mkdir -p /etc/squid/conf.d +COPY squid_example.conf /etc/squid/conf.d/squid_example.conf + # Ensure the cache is owned by squid user RUN chown squid:squid /var/cache/squid RUN chmod a+x /var/log diff --git a/containers/proxy-squid-image/proxy-squid-image.changes.mbussolotto.squid_conf b/containers/proxy-squid-image/proxy-squid-image.changes.mbussolotto.squid_conf new file mode 100644 index 000000000000..cb5e8c6451b1 --- /dev/null +++ b/containers/proxy-squid-image/proxy-squid-image.changes.mbussolotto.squid_conf @@ -0,0 +1 @@ +- include /etc/squid/conf.d/*.conf diff --git a/containers/proxy-squid-image/squid_example.conf b/containers/proxy-squid-image/squid_example.conf new file mode 100644 index 000000000000..3d77e44afaca --- /dev/null +++ b/containers/proxy-squid-image/squid_example.conf @@ -0,0 +1,7 @@ +# Do not change this file in your environment, since +# it's not persisted and changes would be lost on restart. +# Custom squid configuration file can be added using +# --tuning-squid flag on mgrpxy install or mgrpxy upgrade. +# e.g. +# mgrpxy install [podman/kubernetes] --tuning-squid my_local_squid_configuration.conf config.tar.gz +# mgrpxy upgrade [podman/kubernetes] --tuning-squid my_local_squid_configuration.conf diff --git a/containers/proxy-squid-image/uyuni-configure.py b/containers/proxy-squid-image/uyuni-configure.py index c909b2dbe835..a93d564ed91e 100644 --- a/containers/proxy-squid-image/uyuni-configure.py +++ b/containers/proxy-squid-image/uyuni-configure.py @@ -21,6 +21,7 @@ file_content = re.sub( r"access_log .*", "access_log stdio:/proc/self/fd/1 squid", file_content ) + file_content += "\n" + "include /etc/squid/conf.d/*" + "\n" # writing back the content config_file.seek(0, 0) config_file.write(file_content)