Skip to content

Commit

Permalink
fix storageClassName
Browse files Browse the repository at this point in the history
add ingress.yaml
  • Loading branch information
Виталий Шунков authored and Kasen committed Jan 12, 2024
1 parent 2d35b8f commit 9f205c2
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 63 deletions.
128 changes: 66 additions & 62 deletions helm-charts/tarantool-cartridge/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
tarantool.io/cluster-id: {{ .Values.ClusterName }}
---
{{- range .Values.RoleConfig }}
{{- $r := .RolesToAssign | toJson | quote }}
{{- $r := .RolesToAssign | toJson | quote }}
apiVersion: tarantool.io/v1alpha1
kind: Role
metadata:
Expand Down Expand Up @@ -51,9 +51,9 @@ spec:
name: {{ $.Release.Name }}
spec:
accessModes: ["ReadWriteOnce"]
{{ if $.Values.StorageClassName }}
storageClassName: {{ $.Values.StorageClassName }}
{{ end }}
{{- if $.Values.persistence.storageClassName }}
storageClassName: {{ $.Values.persistence.storageClassName }}
{{- end }}
resources:
requests:
storage: {{ .DiskSize }}
Expand Down Expand Up @@ -82,65 +82,69 @@ spec:
value: "1"
securityContext:
fsGroup: {{ $.Values.securityContext.fsGroup }}
{{- if $.Values.affinity }}
affinity:
{{ toYaml $.Values.affinity | indent 8 }}
{{- end }}
containers:
- name: "{{ $.Release.Name }}-container"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
volumeMounts:
- name: {{ $.Release.Name }}
mountPath: "{{ $.Values.TarantoolWorkDir }}"
resources:
requests:
cpu: "{{ .CPUallocation }}"
memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M"
limits:
cpu: "{{ .CPUallocation }}"
memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M"
ports:
- containerPort: 3301
protocol: TCP
name: app
- containerPort: 3301
protocol: UDP
name: app-udp
- containerPort: 8081
protocol: TCP
name: http
env:
- name: ENVIRONMENT
value: "{{ $.Values.ClusterEnv }}"
- name: TARANTOOL_INSTANCE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: TARANTOOL_ALIAS
value: "$(TARANTOOL_INSTANCE_NAME)"
- name: TARANTOOL_MEMTX_MEMORY
value: "{{ mul .MemtxMemoryMB 1048576 }}"
- name: TARANTOOL_BUCKET_COUNT
value: {{ $.Values.VshardBucketCount | default "30000" | quote }}
- name: TARANTOOL_WORKDIR
value: "{{ $.Values.TarantoolWorkDir }}"
- name: TARANTOOL_ADVERTISE_TMP
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: TARANTOOL_ADVERTISE_HOST
value: "$(TARANTOOL_ADVERTISE_TMP).{{ $.Values.ClusterName }}.{{ $.Release.Namespace }}.svc.{{ $.Values.ClusterDomainName }}"
- name: TARANTOOL_ADVERTISE_URI
value: "$(TARANTOOL_ADVERTISE_HOST):3301"
- name: TARANTOOL_PROBE_URI_TIMEOUT
value: "60"
- name: TARANTOOL_HTTP_PORT
value: "8081"
{{- range $param, $value := .BoxParameters }}
- name: "TARANTOOL_{{ $param | upper }}"
value: "{{ $value }}"
{{- end }}
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 15
periodSeconds: 10
- name: "{{ $.Release.Name }}-container"
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag }}"
volumeMounts:
- name: {{ $.Release.Name }}
mountPath: "{{ $.Values.TarantoolWorkDir }}"
resources:
requests:
cpu: "{{ .CPUallocation }}"
memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M"
limits:
cpu: "{{ .CPUallocation }}"
memory: "{{ add .MemtxMemoryMB $.Values.LuaMemoryReserveMB }}M"
ports:
- containerPort: 3301
protocol: TCP
name: app
- containerPort: 3301
protocol: UDP
name: app-udp
- containerPort: 8081
protocol: TCP
name: http
env:
- name: ENVIRONMENT
value: "{{ $.Values.ClusterEnv }}"
- name: TARANTOOL_INSTANCE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: TARANTOOL_ALIAS
value: "$(TARANTOOL_INSTANCE_NAME)"
- name: TARANTOOL_MEMTX_MEMORY
value: "{{ mul .MemtxMemoryMB 1048576 }}"
- name: TARANTOOL_BUCKET_COUNT
value: {{ $.Values.VshardBucketCount | default "30000" | quote }}
- name: TARANTOOL_WORKDIR
value: "{{ $.Values.TarantoolWorkDir }}"
- name: TARANTOOL_ADVERTISE_TMP
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: TARANTOOL_ADVERTISE_HOST
value: "$(TARANTOOL_ADVERTISE_TMP).{{ $.Values.ClusterName }}.{{ $.Release.Namespace }}.svc.{{ $.Values.ClusterDomainName }}"
- name: TARANTOOL_ADVERTISE_URI
value: "$(TARANTOOL_ADVERTISE_HOST):3301"
- name: TARANTOOL_PROBE_URI_TIMEOUT
value: "60"
- name: TARANTOOL_HTTP_PORT
value: "8081"
{{- range $param, $value := .BoxParameters }}
- name: "TARANTOOL_{{ $param | upper }}"
value: "{{ $value }}"
{{- end }}
readinessProbe:
tcpSocket:
port: http
initialDelaySeconds: 15
periodSeconds: 10
---
apiVersion: v1
kind: Service
Expand Down
23 changes: 23 additions & 0 deletions helm-charts/tarantool-cartridge/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if $.Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: "{{ $.Release.Name }}"
spec:
{{- with .Values.ingress.tls }}
tls:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
ingressClassName: "nginx"
rules:
- host: kirovets.test.picodata.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: "{{ $.Release.Name }}-routers"
port:
number: {{ $.Values.service.port }}
{{- end }}
11 changes: 10 additions & 1 deletion helm-charts/tarantool-cartridge/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ ClusterEnv: dev
ClusterName: tarantool-cluster
ClusterDomainName: cluster.local
TarantoolWorkDir: /var/lib/tarantool
LuaMemoryReserveMB: 2048
LuaMemoryReserveMB: 4096

persistence:
storageClassName: local-path

image:
repository: tarantool/tarantool-operator-examples-kv
Expand Down Expand Up @@ -40,3 +43,9 @@ RoleConfig:
MemtxMemoryMB: 256
RolesToAssign:
- app.roles.storage

ingress:
enabled: true
tls: []

affinity: {}

0 comments on commit 9f205c2

Please sign in to comment.