Skip to content

Commit

Permalink
fixing vlues string, secret unique, remove gvc management (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorchyts authored Nov 7, 2024
1 parent 4e22181 commit 87dc761
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The [Helm CLI](https://helm.sh/docs/intro/install/#through-package-managers) and
2. Run the command below from this directory.

```bash
cpln helm install redis-cluster
cpln helm install redis-cluster --gvc mygvc
```
Note: Typically, it takes 5 minutes for all replicas of the workload to become ready and for the cluster to be created.

Expand Down
4 changes: 2 additions & 2 deletions examples/redis/templates/redis-cluster-default-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind: secret
name: {{ .Values.redis.name }}-default-config
description: {{ .Values.redis.name }} default config
name: {{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-default-config
description: {{ .Values.redis.name }}-{{ .Values.cpln.gvc }} default config
type: opaque
data:
encoding: plain
Expand Down
29 changes: 10 additions & 19 deletions examples/redis/templates/redis-cluster.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
kind: gvc
name: {{ .Values.redis.gvc }}
description: {{ .Values.redis.name }}
tags: {}
spec:
staticPlacement:
locationLinks:
- //location/{{ .Values.redis.location }}
---
kind: identity
name: {{ .Values.redis.name }}-identity
gvc: {{ .Values.redis.gvc }}
gvc: {{ .Values.cpln.gvc }}
description: {{ .Values.redis.name }}
---
kind: policy
name: {{ .Values.redis.name }}
name: {{ .Values.redis.name }}-{{ .Values.cpln.gvc }}
tags: {}
origin: default
bindings:
- permissions:
- reveal
principalLinks:
- //gvc/{{ .Values.redis.gvc }}/identity/{{ .Values.redis.name }}-identity
- //gvc/{{ .Values.cpln.gvc }}/identity/{{ .Values.redis.name }}-identity
targetKind: secret
targetLinks:
- //secret/{{ .Values.redis.name }}-default-config
- //secret/{{ .Values.redis.name }}-start
- //secret/{{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-default-config
- //secret/{{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-start
---
kind: volumeset
name: {{ .Values.redis.name }}
gvc: {{ .Values.redis.gvc }}
gvc: {{ .Values.cpln.gvc }}
description: {{ .Values.redis.name }}
spec:
fileSystemType: ext4
Expand All @@ -37,7 +28,7 @@ spec:
---
kind: workload
name: {{ .Values.redis.name }}
gvc: {{ .Values.redis.gvc }}
gvc: {{ .Values.cpln.gvc }}
description: {{ .Values.redis.name }}
spec:
type: stateful
Expand All @@ -47,7 +38,7 @@ spec:
- '-c'
- /scripts/redis-start.sh
command: /bin/sh
cpu: {{ .Values.redis.cpu }}
cpu: '{{ .Values.redis.cpu }}'
env:
- name: NUM_SHARDS
value: '3'
Expand Down Expand Up @@ -91,10 +82,10 @@ spec:
uri: 'cpln://volumeset/{{ .Values.redis.name }}'
- path: /scripts/redis-start.sh
recoveryPolicy: retain
uri: 'cpln://secret/{{ .Values.redis.name }}-start'
uri: 'cpln://secret/{{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-start'
- path: /usr/local/etc/redis/redis-default.conf
recoveryPolicy: retain
uri: 'cpln://secret/{{ .Values.redis.name }}-default-config'
uri: 'cpln://secret/{{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-default-config'
defaultOptions:
autoscaling:
maxConcurrency: 0
Expand Down
4 changes: 2 additions & 2 deletions examples/redis/templates/redis-start.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind: secret
name: {{ .Values.redis.name }}-start
description: {{ .Values.redis.name }} start script
name: {{ .Values.redis.name }}-{{ .Values.cpln.gvc }}-start
description: {{ .Values.redis.name }}-{{ .Values.cpln.gvc }} start script
tags: {}
type: opaque
data:
Expand Down
2 changes: 0 additions & 2 deletions examples/redis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ image:

redis:
name: redis-cluster
gvc: redis-cluster-example
replicas: 6
port: 6379
location: aws-us-east-2
diskCapacity: 20 # In Gigabytes
memory: 250Mi # EX. 3000Mi = 3Gi
cpu: 200m # vCPU or milicores with; EX. 1.5 = 1500m
Expand Down

0 comments on commit 87dc761

Please sign in to comment.