Skip to content

Commit 0bd27d7

Browse files
Copilotphrocker
andcommitted
Fix Alluxio env variable syntax for worker hostname
- Removed invalid ${env.POD_NAME} syntax from alluxio-site.properties - Alluxio doesn't support ${env.VAR} environment variable substitution in properties - Changed approach to dynamically append hostname config at runtime - Worker startup script now appends alluxio.worker.hostname to config file - Uses POD_NAME, POD_NAMESPACE env vars to construct FQDN at container startup - Removed alluxio.user.hostname from core-site.xml (not needed for Accumulo clients) This fixes "Invalid property key env.POD_NAME" error from Alluxio workers. Co-authored-by: phrocker <[email protected]>
1 parent d8209d7 commit 0bd27d7

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

charts/accumulo/templates/alluxio-worker-daemonset.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ spec:
6161
sleep 5
6262
done
6363
64+
# Set worker hostname to FQDN for Kubernetes DNS resolution
65+
WORKER_FQDN="${POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${POD_NAMESPACE}.svc.cluster.local"
66+
echo "Setting Alluxio worker hostname to: ${WORKER_FQDN}"
67+
68+
# Export as environment variables for Alluxio to pick up
69+
export ALLUXIO_WORKER_HOSTNAME="${WORKER_FQDN}"
70+
export ALLUXIO_JOB_WORKER_HOSTNAME="${WORKER_FQDN}"
71+
72+
# Add to alluxio-site.properties dynamically
73+
cat >> /opt/alluxio/conf/alluxio-site.properties <<EOF
74+
alluxio.worker.hostname=${WORKER_FQDN}
75+
alluxio.job.worker.hostname=${WORKER_FQDN}
76+
EOF
6477

6578
# Create directories
6679
mkdir -p /opt/ramdisk
@@ -119,10 +132,6 @@ spec:
119132
valueFrom:
120133
fieldRef:
121134
fieldPath: metadata.namespace
122-
- name: ALLUXIO_WORKER_HOSTNAME
123-
value: "$(POD_NAME).{{ include "accumulo.fullname" . }}-alluxio-worker.$(POD_NAMESPACE).svc.cluster.local"
124-
- name: ALLUXIO_JOB_WORKER_HOSTNAME
125-
value: "$(POD_NAME).{{ include "accumulo.fullname" . }}-alluxio-worker.$(POD_NAMESPACE).svc.cluster.local"
126135
- name: ALLUXIO_MASTER_HOSTNAME
127136
value: {{include "accumulo.fullname" .}}-alluxio-master
128137
{{- if eq .Values.storage.provider "s3" }}

charts/accumulo/templates/configmap.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ data:
289289
alluxio.master.hostname={{ include "accumulo.fullname" . }}-alluxio-master
290290
alluxio.master.rpc.port=19998
291291
alluxio.master.web.port=19999
292-
# Worker hostname set via ALLUXIO_WORKER_HOSTNAME environment variable
292+
# Worker hostname will be set via ALLUXIO_WORKER_HOSTNAME environment variable in deployment
293293
alluxio.worker.bind.host=0.0.0.0
294294
alluxio.worker.port=29999
295295
alluxio.worker.web.port=30000
@@ -298,19 +298,15 @@ data:
298298
alluxio.worker.rpc.bind.host=0.0.0.0
299299
alluxio.worker.data.bind.host=0.0.0.0
300300
alluxio.worker.web.bind.host=0.0.0.0
301-
# Use FQDN for worker hostname resolution in Kubernetes
302-
alluxio.worker.hostname=${env.POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${env.POD_NAMESPACE}.svc.cluster.local
303301
304302
## Job worker configuration
305303
alluxio.job.master.hostname={{ include "accumulo.fullname" . }}-alluxio-master
306304
alluxio.job.master.rpc.port=20001
307-
# Job worker hostname set via ALLUXIO_JOB_WORKER_HOSTNAME environment variable
305+
# Job worker hostname will be set via ALLUXIO_JOB_WORKER_HOSTNAME environment variable in deployment
308306
alluxio.job.worker.bind.host=0.0.0.0
309307
alluxio.job.worker.rpc.port=30002
310308
alluxio.job.worker.data.port=30003
311309
alluxio.job.worker.web.port=30004
312-
# Use FQDN for job worker hostname resolution in Kubernetes
313-
alluxio.job.worker.hostname=${env.POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${env.POD_NAMESPACE}.svc.cluster.local
314310
315311
## Memory and storage configuration
316312
alluxio.worker.memory.size={{ .Values.alluxio.properties.alluxio.worker.memory.size }}
@@ -383,11 +379,16 @@ data:
383379
<name>fs.AbstractFileSystem.alluxio.impl</name>
384380
<value>alluxio.hadoop.AlluxioFileSystem</value>
385381
</property>
386-
<!-- Alluxio client configuration for Kubernetes DNS resolution -->
382+
<!-- Alluxio client configuration -->
387383
<property>
388-
<name>alluxio.user.hostname</name>
389-
<value>${env.POD_NAME}.{{ include "accumulo.fullname" . }}-alluxio-worker.${env.POD_NAMESPACE}.svc.cluster.local</value>
390-
<description>Client hostname for Alluxio operations</description>
384+
<name>alluxio.master.hostname</name>
385+
<value>{{ include "accumulo.fullname" . }}-alluxio-master</value>
386+
<description>Alluxio master hostname</description>
387+
</property>
388+
<property>
389+
<name>alluxio.master.rpc.port</name>
390+
<value>19998</value>
391+
<description>Alluxio master RPC port</description>
391392
</property>
392393
<property>
393394
<name>alluxio.user.network.netty.channel</name>

0 commit comments

Comments
 (0)