Maurice Amar
Maurice Amar

Reputation: 139

copy PODIP in configmap during kubernetes deployment

I need to pass "PODIP" env value to configmap for configuration during k8s deployment

deploy.yaml

- env:
  - name: PODIP
    valueFrom:
      fieldRef:
        fieldPath: status.podIP

how to do this? 10x

Upvotes: 0

Views: 903

Answers (1)

Nick
Nick

Reputation: 1948

I did small research on topic and it come out that a configmap was intentionally made ReadOnly some time ago.

If you really need interacting with files from a configmap then you could instead put the files in a writeable volume and mount the volume. Or you could to use the centralized configuration like consul.

Addtionally, you can try storing values in a database. Another option to store configuration information could be a distributed cache such as redis or hazelcast, etc.

That is Pull request which made ConfigMaps ReadOnly.

Hope that helps. Let me know if that was the info you've been looking for :)

Upvotes: 1

Related Questions