Created
December 27, 2021 07:45
-
-
Save afro-coder/809384996d03e69917620ad769a123b5 to your computer and use it in GitHub Desktop.
Squid Proxy with Kubernetes k3s Raspberry Pi4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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