diff --git a/kubernetes/apps/homepage-dashboard/config-map.yaml b/kubernetes/apps/homepage-dashboard/config-map.yaml index 7967aaa2..410f7b07 100644 --- a/kubernetes/apps/homepage-dashboard/config-map.yaml +++ b/kubernetes/apps/homepage-dashboard/config-map.yaml @@ -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 diff --git a/kubernetes/apps/redis-db/config-map.yaml b/kubernetes/apps/redis-db/config-map.yaml new file mode 100644 index 00000000..8d159a7a --- /dev/null +++ b/kubernetes/apps/redis-db/config-map.yaml @@ -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 diff --git a/kubernetes/apps/redis-db/deployment.yaml b/kubernetes/apps/redis-db/deployment.yaml index eeb85a4e..dc661f43 100644 --- a/kubernetes/apps/redis-db/deployment.yaml +++ b/kubernetes/apps/redis-db/deployment.yaml @@ -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 diff --git a/kubernetes/apps/redis-db/network-policy.yaml b/kubernetes/apps/redis-db/network-policy.yaml deleted file mode 100644 index b3e44e53..00000000 --- a/kubernetes/apps/redis-db/network-policy.yaml +++ /dev/null @@ -1,24 +0,0 @@ -kind: NetworkPolicy -apiVersion: networking.k8s.io/v1 -metadata: - name: argocd-redis-network-policy -spec: - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-redis - policyTypes: - - Ingress - ingress: - - from: - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-repo-server - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - ports: - - protocol: TCP - port: 6379 diff --git a/kubernetes/apps/redis-db/persistant-vol-claim.yaml b/kubernetes/apps/redis-db/persistant-vol-claim.yaml new file mode 100644 index 00000000..337d015e --- /dev/null +++ b/kubernetes/apps/redis-db/persistant-vol-claim.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-pvc + namespace: redis-db +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/kubernetes/apps/redis-db/persistant-vol.yaml b/kubernetes/apps/redis-db/persistant-vol.yaml new file mode 100644 index 00000000..9775a3c5 --- /dev/null +++ b/kubernetes/apps/redis-db/persistant-vol.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: redis-pv +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + hostPath: + path: /mnt/storage/redis diff --git a/kubernetes/apps/redis-db/redis-insight/ingress.yaml b/kubernetes/apps/redis-db/redis-insight/ingress.yaml new file mode 100644 index 00000000..06c21b0f --- /dev/null +++ b/kubernetes/apps/redis-db/redis-insight/ingress.yaml @@ -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 diff --git a/kubernetes/apps/redis-db/role-binding.yaml b/kubernetes/apps/redis-db/role-binding.yaml deleted file mode 100644 index 87b902a1..00000000 --- a/kubernetes/apps/redis-db/role-binding.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-redis -subjects: - - kind: ServiceAccount - name: argocd-redis diff --git a/kubernetes/apps/redis-db/role.yaml b/kubernetes/apps/redis-db/role.yaml deleted file mode 100644 index bba553ca..00000000 --- a/kubernetes/apps/redis-db/role.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -rules: - - apiGroups: - - "" - resources: - - secrets - resourceNames: - - argocd-redis - verbs: - - get - - apiGroups: - - "" - resources: - - secrets - verbs: - - create diff --git a/kubernetes/apps/redis-db/service-account.yaml b/kubernetes/apps/redis-db/service-account.yaml deleted file mode 100644 index 5b2e34ce..00000000 --- a/kubernetes/apps/redis-db/service-account.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis diff --git a/kubernetes/apps/redis-db/service.yaml b/kubernetes/apps/redis-db/service.yaml index 043021f7..02d093d4 100644 --- a/kubernetes/apps/redis-db/service.yaml +++ b/kubernetes/apps/redis-db/service.yaml @@ -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 diff --git a/kubernetes/workflows/health-dashboard.yaml b/kubernetes/workflows/health-dashboard.yaml new file mode 100644 index 00000000..2676956f --- /dev/null +++ b/kubernetes/workflows/health-dashboard.yaml @@ -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 diff --git a/kubernetes/workflows/users-etl.yaml b/kubernetes/workflows/users-etl.yaml new file mode 100644 index 00000000..0f94e0b0 --- /dev/null +++ b/kubernetes/workflows/users-etl.yaml @@ -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