Skip to content

Commit

Permalink
Merge pull request #2 from picodata/resource-prefix
Browse files Browse the repository at this point in the history
This PR introduce an ability to set storage class with which volumes will be created
  • Loading branch information
Kasen authored Apr 27, 2023
2 parents 0373701 + e6a4fc3 commit 2d35b8f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 188 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/destroy-deployment.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/pull-translation.yml

This file was deleted.

57 changes: 0 additions & 57 deletions .github/workflows/push-translation.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
helm install -n ${{ env.APP_NAMESPACE }} --create-namespace \
-f test/helpers/ci/cluster_values.yaml \
cartridge-app \
crtg \
helm-charts/tarantool-cartridge
- name: Waiting for routers Pods availability
Expand All @@ -115,10 +115,10 @@ jobs:
- name: Сhecking the number of ready router replicas
run : |
desired_routers_num=1
ready_routers_num=$(kubectl get statefulsets/router-0 -o=jsonpath="{.status.readyReplicas}")
ready_routers_num=$(kubectl get statefulsets/crtg-router-0 -o=jsonpath="{.status.readyReplicas}")
if [[ $ready_routers_num -ne $desired_routers_num ]]; then
kubectl describe statefulsets/router-0
kubectl describe statefulsets/crtg-router-0
kubectl describe pod -l tarantool.io/role=router
echo 'ERROR: invalid number of ready routers...' >&2; exit 1
fi
Expand All @@ -129,10 +129,10 @@ jobs:
- name: Сhecking the number of ready storage replicas
run: |
desired_storage_num=1
ready_storage_num=$(kubectl get statefulsets/storage-0 -o=jsonpath="{.status.readyReplicas}")
ready_storage_num=$(kubectl get statefulsets/crtg-storage-0 -o=jsonpath="{.status.readyReplicas}")
if [[ $ready_storage_num -ne $desired_storage_num ]]; then
kubectl describe statefulsets/storage-0
kubectl describe statefulsets/crtg-storage-0
kubectl describe pod -l tarantool.io/role=storage
echo 'ERROR: invalid number of ready storages...' >&2; exit 1
fi
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/upload-translations.yml

This file was deleted.

25 changes: 14 additions & 11 deletions helm-charts/tarantool-cartridge/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
apiVersion: tarantool.io/v1alpha1
kind: Role
metadata:
name: {{ .RoleName | replace "_" "" }}
name: "{{ $.Release.Name }}-{{ .RoleName | replace "_" "" }}"
labels:
tarantool.io/cluster-id: {{ $.Values.ClusterName }}
tarantool.io/role: {{ .RoleName }}
Expand All @@ -21,16 +21,16 @@ metadata:
spec:
selector:
matchLabels:
tarantool.io/replicaset-template: "{{ .RoleName }}-template"
tarantool.io/replicaset-template: "{{ $.Release.Name }}-{{ .RoleName }}-template"
numReplicasets: {{ .ReplicaSetCount }}
---
apiVersion: tarantool.io/v1alpha1
kind: ReplicasetTemplate
metadata:
name: "{{ .RoleName | replace "_" "" }}-template"
name: "{{ $.Release.Name }}-{{ .RoleName | replace "_" "" }}-template"
labels:
tarantool.io/cluster-id: {{ $.Values.ClusterName }}
tarantool.io/replicaset-template: "{{ .RoleName }}-template"
tarantool.io/replicaset-template: "{{ $.Release.Name }}-{{ .RoleName }}-template"
tarantool.io/role: {{ .RoleName }}
{{ if .VshardGroup }}
tarantool.io/useVshardGroups: "1"
Expand All @@ -42,15 +42,18 @@ metadata:
tarantool.io/rolesToAssign: {{ $r }}
spec:
replicas: {{ .ReplicaCount }}
serviceName: {{ .RoleName }}
serviceName: "{{ $.Release.Name }}-{{ .RoleName }}"
selector:
matchLabels:
tarantool.io/pod-template: "{{ .RoleName }}-pod-template"
tarantool.io/pod-template: "{{ $.Release.Name }}-{{ .RoleName }}-pod-template"
volumeClaimTemplates:
- metadata:
name: www
name: {{ $.Release.Name }}
spec:
accessModes: ["ReadWriteOnce"]
{{ if $.Values.StorageClassName }}
storageClassName: {{ $.Values.StorageClassName }}
{{ end }}
resources:
requests:
storage: {{ .DiskSize }}
Expand All @@ -59,7 +62,7 @@ spec:
labels:
tarantool.io/cluster-id: "{{ $.Values.ClusterName }}"
tarantool.io/cluster-domain-name: "{{ $.Values.ClusterDomainName }}"
tarantool.io/pod-template: "{{ .RoleName }}-pod-template"
tarantool.io/pod-template: "{{ $.Release.Name }}-{{ .RoleName }}-pod-template"
{{ if .VshardGroup }}
tarantool.io/useVshardGroups: "1"
tarantool.io/vshardGroupName: {{ .VshardGroup }}
Expand All @@ -80,10 +83,10 @@ spec:
securityContext:
fsGroup: {{ $.Values.securityContext.fsGroup }}
containers:
- name: pim-storage
- name: "{{ $.Release.Name }}-container"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
volumeMounts:
- name: www
- name: {{ $.Release.Name }}
mountPath: "{{ $.Values.TarantoolWorkDir }}"
resources:
requests:
Expand Down Expand Up @@ -142,7 +145,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: {{ .RoleName }}
name: "{{ $.Release.Name }}-{{ .RoleName }}"
labels:
tarantool.io/role: {{ .RoleName }}
spec:
Expand Down

0 comments on commit 2d35b8f

Please sign in to comment.