Flag fs_data_dirs doesn't applied to master

Hi.

Trying to set data directories on persistent volume. But fs_data_dirs affects only tserver, not master.

Command:

bin/yugabyted start --master_flags=fs_data_dirs=/home/yb/data --tserver_flags=fs_data_dirs=/home/yb/data --background=false

/home/yb/data contains only yb-data/tserver subfolder.

master folder always located at /root/var/data/yb-data/master

Deploying with Helm:

---
apiVersion: v1
kind: Service
metadata:
  name: yugabyte
  labels:
    app: yugabyte
spec:
  ports:
    - name: ysql-api-port
      port: 5433
      targetPort: 5433
    - name: master-ui-port
      port: 7000
      targetPort: 7000
    - name: tserver-ui-port
      port: 9000
      targetPort: 9000
    - name: ycql-api-port
      port: 9042
      targetPort: 9042
    - name: yb-ui-port
      port: 15433
      targetPort: 15433
  selector:
    app: yugabyte
  type: ClusterIP

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: yugabyte
  labels:
    app: yugabyte
spec:
  replicas: 1
  selector:
    matchLabels:
      app: yugabyte
  template:
    metadata:
      labels:
        app: yugabyte
    spec:
      containers:
        - name: yugabyte
          image: yugabytedb/yugabyte:2025.1.0.1-b3
          imagePullPolicy: IfNotPresent
          command: ["bin/yugabyted", "start", "--master_flags=fs_data_dirs=/home/yb/data", "--tserver_flags=fs_data_dirs=/home/yb/data", "--background=false"]
          ports:
            - name: ysql-api-port
              containerPort: 5433
              protocol: TCP
            - name: master-ui-port
              containerPort: 7000
              protocol: TCP
            - name: tserver-ui-port
              containerPort: 9000
              protocol: TCP
            - name: ycql-api-port
              containerPort: 9042
              protocol: TCP
            - name: yb-ui-port
              containerPort: 15433
              protocol: TCP
          volumeMounts:
            - name: yugabyte-data
              mountPath: /home/yb/data
              subPath: yugabyte
      volumes:
        - name: yugabyte-data
          persistentVolumeClaim:
            claimName: {{ .Values.persistentVolumeClaim }}
      imagePullSecrets:
        - name: {{ .Values.imagePullSecret }}

Versions: 2024.2.5.0-b59, 2025.1.0.1-b3, 2.25.2.0-b359

What am I doing wrong?

Hi @rommander

Can you use –base_dir yugabyted reference | YugabyteDB Docs ?

I switched to fs_data_dirs from base_dir to avoid problem with new pod IP on each restart ). To store only data, not configuration.

But now I found other solution:

          env:
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
          command:
            - "/bin/sh"
            - "-c"
            - |
              echo "$(POD_IP) yb.local" >> /etc/hosts
              bin/yugabyted start \
                --base_dir=/home/yb/data \
                --advertise_address=yb.local \
                --background=false

No errors after helm reinstall and all ports accessible outside container.