I have suchlike problem:
spec:
hostname: kafka
containers:
- name: kafka
image: registry/wurstmeister:latest
imagePullPolicy: Always
restartPolicy: Always
env:
- name: HOSTNAME_COMMAND
valueFrom:
fieldRef: {fieldPath: metadata.name}
- name: KAFKA_ADVERTISED_LISTENERS
value: INSIDE://:9092,OUTSIDE://_${HOSTNAME_COMMAND}:9094
First HOSTNAME_COMMAND resolves successfully, so I see the pod's hostname. I need to have the same for the second HOSTNAME_COMMAND, so I need to see something like this:
value: INSIDE://:9092,OUTSIDE://_kafka-6b97669c5c-lhfp7:9094
Thank you.
您可以在其他配置中使用$(ENV_NAME)
格式,详细信息在这里, 在配置中使用环境变量。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.