Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add redis app #32

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions argocd-deploys/argo-redis/argo-redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argo-redis
namespace: argocd
spec:
project: default
source:
repoURL: [email protected]:natan-dias/my-devops-repo.git
targetRevision: feature-new-app
path: infra/redis
destination:
server: 'https://kubernetes.default.svc'
namespace: redis
syncPolicy:
syncOptions:
- CreateNamespace=true
- PruneLast=true
automated:
selfHeal: true
prune: true
20 changes: 20 additions & 0 deletions infra/redis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Redis local implementation

I have implemented this small redis instance locally just for some tests. Tried to implement using ingress, but it did not work, so I am using, for now, a nodeport deployment.

For that I have added toleration just to keep the deployment on the same node.

- Taint

> k taint node ${KIND-WORKER-NAME} node=infra:NoSchedule

- Toleration

```
spec:
tolerations:
- key: node
operator: Equal
value: infra
effect: NoSchedule
```
8 changes: 8 additions & 0 deletions infra/redis/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: redis
resources:
- redis-storage.yaml
- redis-service.yaml
- redis-deployment.yaml
32 changes: 32 additions & 0 deletions infra/redis/redis-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-deployment
namespace: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
tolerations:
- key: node
operator: Equal
value: infra
effect: NoSchedule
containers:
- name: redis
image: redis:6.2.5
ports:
- containerPort: 6379
volumeMounts:
- name: redis-data
mountPath: /data
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: redis-pvc
14 changes: 14 additions & 0 deletions infra/redis/redis-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: redis-service
namespace: redis
spec:
selector:
app: redis
ports:
- name: redis
port: 6379
targetPort: 6379
nodePort: 30010
type: NodePort
26 changes: 26 additions & 0 deletions infra/redis/redis-storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: redis-pv
spec:
capacity:
storage: 200Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /data/redis
storageClassName: data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: redis-pvc
namespace: redis
spec:
storageClassName: "data"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
Loading