Skip to content

Commit

Permalink
redis and some workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpbennett committed Jul 15, 2024
1 parent e482179 commit bd90e7f
Show file tree
Hide file tree
Showing 13 changed files with 118 additions and 144 deletions.
2 changes: 1 addition & 1 deletion kubernetes/apps/homepage-dashboard/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ data:
- Redis:
icon: redis.svg
href: http://192.168.7.70:8001
href: http://redis-insight.pnfb.home
description: World’s fastest data platform
target: _blank
Expand Down
11 changes: 11 additions & 0 deletions kubernetes/apps/redis-db/config-map.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
namespace: redis-db
data:
redis.conf: |
bind 0.0.0.0
protected-mode no
port 6379
# Add other Redis configurations as needed
85 changes: 20 additions & 65 deletions kubernetes/apps/redis-db/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,79 +1,34 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: argocd-redis
app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: redis
name: argocd-redis
name: redis
namespace: redis-db
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: argocd-redis
app: redis
template:
metadata:
labels:
app.kubernetes.io/name: argocd-redis
app: redis
spec:
initContainers:
- command:
- argocd
- admin
- redis-initial-password
image: quay.io/argoproj/argocd:latest
imagePullPolicy: IfNotPresent
name: secret-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
securityContext:
runAsNonRoot: true
runAsUser: 999
seccompProfile:
type: RuntimeDefault
serviceAccountName: argocd-redis
containers:
- name: redis
image: redis:7.0.15-alpine
imagePullPolicy: Always
args:
- "--save"
- ""
- "--appendonly"
- "no"
- --requirepass $(REDIS_PASSWORD)
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
key: auth
name: argocd-redis
image: redis:6.2
ports:
- containerPort: 6379
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: argocd-redis
topologyKey: kubernetes.io/hostname
- weight: 5
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/part-of: argocd
topologyKey: kubernetes.io/hostname
volumeMounts:
- name: redis-data
mountPath: /data
- name: redis-config
mountPath: /usr/local/etc/redis/redis.conf
subPath: redis.conf
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: redis-pvc
- name: redis-config
configMap:
name: redis-config
24 changes: 0 additions & 24 deletions kubernetes/apps/redis-db/network-policy.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions kubernetes/apps/redis-db/persistant-vol-claim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-pvc
namespace: redis-db
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
11 changes: 11 additions & 0 deletions kubernetes/apps/redis-db/persistant-vol.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/storage/redis
19 changes: 19 additions & 0 deletions kubernetes/apps/redis-db/redis-insight/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: redis-ingress
namespace: redis-db
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: redis-insight.pnfb.home
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: redisinsight-svc
port:
number: 80
15 changes: 0 additions & 15 deletions kubernetes/apps/redis-db/role-binding.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions kubernetes/apps/redis-db/role.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions kubernetes/apps/redis-db/service-account.yaml

This file was deleted.

13 changes: 5 additions & 8 deletions kubernetes/apps/redis-db/service.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: argocd-redis
app.kubernetes.io/part-of: argocd
app.kubernetes.io/component: redis
name: argocd-redis
name: redis
namespace: redis-db
spec:
type: LoadBalancer
ports:
- name: tcp-redis
port: 6379
- port: 6379
targetPort: 6379
selector:
app.kubernetes.io/name: argocd-redis
app: redis
20 changes: 20 additions & 0 deletions kubernetes/workflows/health-dashboard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: &app health-dashboard
namespace: cron-jobs
spec:
schedule: "* * * * *"
timezone: "Europe/London" # Default to local machine timezone
startingDeadlineSeconds: 0
concurrencyPolicy: "Replace" # Default to "Allow"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 4 # Default 1
suspend: false # Set to "true" to suspend scheduling
workflowSpec:
entrypoint: *app
templates:
- name: *app
container:
image: 192.168.7.210:5000/health-dashboard:0.0.7
imagePullPolicy: Always
20 changes: 20 additions & 0 deletions kubernetes/workflows/users-etl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
name: &app user-etl
namespace: cron-jobs
spec:
schedule: "* * * * *"
timezone: "Europe/London" # Default to local machine timezone
startingDeadlineSeconds: 0
concurrencyPolicy: "Replace" # Default to "Allow"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 4 # Default 1
suspend: false # Set to "true" to suspend scheduling
workflowSpec:
entrypoint: *app
templates:
- name: *app
container:
image: 192.168.7.210:5000/user-etl:0.0.1
imagePullPolicy: Always

0 comments on commit bd90e7f

Please sign in to comment.