153 lines
4.7 KiB
YAML
153 lines
4.7 KiB
YAML
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: quobyte-reg
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: quobyte-reg # has to match .spec.template.metadata.labels
|
|
serviceName: "quobyte"
|
|
replicas: {{ .Values.quobyte.replicas }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: quobyte-reg # has to match .spec.selector.matchLabels
|
|
annotations:
|
|
timestamp: "{{ now }}"
|
|
spec:
|
|
subdomain: "quobyte"
|
|
terminationGracePeriodSeconds: 10
|
|
hostNetwork: true
|
|
dnsPolicy: ClusterFirstWithHostNet
|
|
initContainers:
|
|
- name: quobyte-reg-pre
|
|
image: {{ .Values.quobyte.image }}
|
|
env:
|
|
- name: NODENAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: MY_POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: QUOBYTE_DATA_PORT
|
|
value: "7863"
|
|
- name: QUOBYTE_META_PORT
|
|
value: "7862"
|
|
- name: QUOBYTE_REG_PORT
|
|
value: "7861"
|
|
- name: QUOBYTE_API_PORT
|
|
value: "7860"
|
|
- name: QUOBYTE_S3_PORT
|
|
value: "8484"
|
|
- name: QUOBYTE_SERVICE
|
|
value: registry
|
|
- name: CLOUD_INSTALL
|
|
value: "1"
|
|
- name: CLUSTER_NS
|
|
value: {{ .Release.Namespace }}
|
|
- name: LIMIT_OPEN_FILES
|
|
value: "{{ .Values.quobyte.maxopenfiles }}"
|
|
- name: LIMIT_MAX_PROCESSES
|
|
value: "{{ .Values.quobyte.maxprocs }}"
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /etc/quobyte
|
|
- name: registry
|
|
mountPath: /var/lib/quobyte/devices/registry
|
|
command:
|
|
- /bin/bash
|
|
- -xc
|
|
- |
|
|
touch /etc/quobyte/$QUOBYTE_SERVICE.cfg
|
|
echo test.device_dir=/var/lib/quobyte/devices >> /etc/quobyte/registry.cfg
|
|
echo rpc.bind.address=${MY_POD_IP} >> /etc/quobyte/registry.cfg
|
|
echo hostname=${HOSTNAME} >> /etc/quobyte/registry.cfg
|
|
NODENUM=$(echo "$NODENAME" | tr -dc "0-9")
|
|
if [ ! -e /var/lib/quobyte/devices/registry/QUOBYTE_DEV_SETUP ]; then
|
|
if [[ $NODENUM == 0 ]]; then
|
|
/usr/bin/qbootstrap -y -d /var/lib/quobyte/devices/registry
|
|
else
|
|
/usr/bin/qmkdev -d -t REGISTRY /var/lib/quobyte/devices/registry
|
|
fi
|
|
fi
|
|
containers:
|
|
- name: quobyte-reg
|
|
image: {{ .Values.quobyte.image }}
|
|
imagePullPolicy: Always
|
|
env:
|
|
- name: NODENAME
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: MY_POD_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: HOST_IP
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: status.podIP
|
|
- name: QUOBYTE_DATA_PORT
|
|
value: "7863"
|
|
- name: QUOBYTE_META_PORT
|
|
value: "7862"
|
|
- name: QUOBYTE_REG_PORT
|
|
value: "7861"
|
|
- name: QUOBYTE_API_PORT
|
|
value: "7860"
|
|
- name: QUOBYTE_S3_PORT
|
|
value: "8484"
|
|
- name: QUOBYTE_SERVICE
|
|
value: registry
|
|
- name: CLOUD_INSTALL
|
|
value: "1"
|
|
- name: CLUSTER_NS
|
|
value: {{ .Release.Namespace }}
|
|
- name: QUOBYTE_REGISTRY
|
|
value: _quobyte._tcp.quobyte.{{ .Release.Namespace }}.svc.cluster.local
|
|
- name: LIMIT_OPEN_FILES
|
|
value: "{{ .Values.quobyte.maxopenfiles }}"
|
|
- name: LIMIT_MAX_PROCESSES
|
|
value: "{{ .Values.quobyte.maxprocs }}"
|
|
ports:
|
|
- containerPort: 7861
|
|
name: quobyte-reg
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /etc/quobyte
|
|
- name: registry
|
|
mountPath: /var/lib/quobyte/devices/registry
|
|
{{- if .Values.nodepoolname }}
|
|
nodeSelector:
|
|
storage-node-pool: {{ .Values.nodepoolname }}
|
|
{{- end }}
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- labelSelector:
|
|
matchExpressions:
|
|
- key: app
|
|
operator: In
|
|
values:
|
|
- quobyte-reg
|
|
topologyKey: "kubernetes.io/hostname"
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: config
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
- metadata:
|
|
name: registry
|
|
spec:
|
|
accessModes: [ "ReadWriteOnce" ]
|
|
resources:
|
|
requests:
|
|
storage: 25Gi
|
|
|