Skip to content

Instantly share code, notes, and snippets.

@afro-coder
Created December 27, 2021 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afro-coder/809384996d03e69917620ad769a123b5 to your computer and use it in GitHub Desktop.
Save afro-coder/809384996d03e69917620ad769a123b5 to your computer and use it in GitHub Desktop.
Squid Proxy with Kubernetes k3s Raspberry Pi4
FROM alpine
RUN apk update && apk add squid
COPY ./squid.conf /etc/squid.conf
RUN squid -z && squid -k check
CMD ["squid","--foreground","-f","/etc/squid.conf"]
apiVersion: apps/v1
kind: Deployment
metadata:
name: squid-deployment
labels:
app: squid
spec:
replicas: 1
selector:
matchLabels:
app: squid
template:
metadata:
labels:
app: squid
spec:
volumes:
- name: log-dir
emptyDir: {}
containers:
- name: squid
image: localhost:5000/squid-proxy:v2
#imagePullPolicy: Never
ports:
- containerPort: 3128
volumeMounts:
- name: log-dir
mountPath: "/var/log/squid"
- name: tailer
image: busybox
command:
- "/bin/sh"
- "-c"
args:
- tail -F /var/log/squid/access.log
volumeMounts:
- name: log-dir
mountPath: "/var/log/squid"
---
apiVersion: v1
kind: Service
metadata:
name: squid-service
spec:
type: LoadBalancer
selector:
app: squid
ports:
- protocol: TCP
port: 3128
targetPort: 3128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment