Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Normalizing squid config against OSG upstream - issue #435
Browse files Browse the repository at this point in the history
  • Loading branch information
muali14 committed Feb 23, 2021
1 parent 275f888 commit fb08dcd
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion stable/osg-frontier-squid/osg-frontier-squid/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ appVersion: 4.13-1.1
description: A Helm chart for configuration and deployment of the Open Science Grid's Frontier Squid application.
name: osg-frontier-squid
# Chart version
version: 1.4.7
version: 1.5.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ metadata:
release: {{ .Release.Name }}
instance: {{ .Values.Instance | quote }}
data:
60-customization.awk: |
setoption("acl HOST_MONITOR src", "{{ .Values.SquidConf.MonitoringIPRange }}")
{{ if .Values.SquidConf.Cpu_Affinity_Map }}setoption("cpu_affinity_map", "{{ .Values.SquidConf.Cpu_Affinity_Map }}"){{ end }}
{{ if .Values.SquidConf.Logfile_Rotate }}setoption("logfile_rotate", "{{ .Values.SquidConf.Logfile_Rotate }}"){{ end }}
{{- if .Values.SquidConf.Workers -}}
setoption("workers", {{ .Values.SquidConf.Workers }} )
setoption("cache_dir", "ufs /var/cache/squid/squid${process_number} {{ .Values.SquidConf.CacheSize }} 16 256")
setoptionparameter("logformat awstats", 3, "kid${process_number}")
setoption("visible_hostname", "'`uname -n`'/${process_number}")
{{- else }} # single worker case
setoption("cache_dir", "ufs /var/cache/squid/squid {{ .Values.SquidConf.CacheSize }} 16 256")
{{ end }}
# The below 60-image-post-init.sh script is not mounted and the above new script takes care of the customization needed
# 2-3 setttings are done vai env vars as per the OSG docs
60-image-post-init.sh: |+
echo "Generating squid.conf..."
grep -v cache_dir /etc/squid/squid.conf.frontierdefault > /etc/squid/squid.conf
Expand Down Expand Up @@ -64,4 +78,4 @@ data:
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
{{ end }}
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,25 @@ spec:
containers:
# Container for the primary application, OSG Frontier Squid
- name: osg-frontier-squid
image: opensciencegrid/frontier-squid:stable
image: opensciencegrid/frontier-squid:fresh
imagePullPolicy: Always
env:
- name: SQUID_IPRANGE
value: {{ .Values.SquidConf.IPRange }}
- name: SQUID_CACHE_MEM
value: '{{ .Values.SquidConf.CacheMem }} MB'
ports:
- containerPort: 3128
name: squid
- containerPort: 3401
name: monitoring
protocol: UDP
volumeMounts:
- name: osg-frontier-squid-{{ .Values.Instance }}-conf
mountPath: /etc/osg/image-config.d/60-image-post-init.sh
subPath: 60-image-post-init.sh
# Commetned out and will probably not be needed. We're using the default 60-image-post-init.sh script
# that comes with upstream image. Our custom config has been moved to the .awk file added through configmap
# - name: osg-frontier-squid-{{ .Values.Instance }}-conf
# mountPath: /etc/osg/image-config.d/60-image-post-init.sh
# subPath: 60-image-post-init.sh
{{ if .Values.SquidConf.LogToStdout }}
- name: osg-frontier-squid-{{ .Values.Instance }}-conf
mountPath: /etc/supervisord.d/50-squid-log-dump.conf
Expand All @@ -58,7 +65,17 @@ spec:
- mountPath: /var/cache/squid/osg-frontier-squid-{{ .Values.Instance }}-cache
subPath: osg-frontier-squid-{{ .Values.Instance }}-cache
name: osg-frontier-squid-{{ .Values.Instance }}-data
- mountPath: /etc/squid/customize.d/60-customization.awk
subPath: 60-customization.awk
name: osg-frontier-squid-{{ .Values.Instance }}-awk
volumes:
- name: osg-frontier-squid-{{ .Values.Instance }}-awk
configMap:
name: {{ template "osg-frontier-squid.fullname" . }}
items:
- key: 60-customization.awk
path: 60-customization.awk
mode: 420
- name: osg-frontier-squid-{{ .Values.Instance }}-conf
configMap:
name: {{ template "osg-frontier-squid.fullname" . }}
Expand Down

0 comments on commit fb08dcd

Please sign in to comment.