Add squid cache and a test job for it.

This commit is contained in:
James Pace 2022-11-02 20:56:37 -04:00
parent 0961693646
commit 37b668b727
2 changed files with 63 additions and 0 deletions

42
deployments/squid.yaml Normal file
View File

@ -0,0 +1,42 @@
---
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:
containers:
- name: squid
image: 192.168.1.128:8443/squid:0.3
volumeMounts:
- mountPath: /var/spool/squid
name: squid-volume
ports:
- containerPort: 3128
name: squid-port
volumes:
- name: squid-volume
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: squid-service
spec:
selector:
app: squid
ports:
- protocol: TCP
targetPort: 3128
port: 3128
name: squid-port

21
jobs/cache-check.yaml Normal file
View File

@ -0,0 +1,21 @@
apiVersion: batch/v1
kind: Job
metadata:
name: cache-check
spec:
template:
spec:
containers:
- name: cache-check
image: docker.io/debian:bullseye-slim
env:
- name: http_proxy
value: http://squid-service:3128
command: ["bash"]
args:
- "-c"
- >-
apt update -y &&
apt upgrade -y
restartPolicy: Never
backoffLimit: 1