0

Below is the configmap sample from kubernetes.

Is there anyway to update the configmap data part from powershell?

apiVersion: v1
kind: ConfigMap
metadata:
  name: database-configmap
data:
  config: |
    dbport=5432
    dcname=
    dbssl=false
    locktime=3
Sara June
  • 155
  • 2
  • 7

1 Answers1

0

There is powershell-yaml but you probably want to call yq from Powershell instead because yq can keep the config value a literal block scalar while using powershell-yaml will probably convert it to a double-quoted scalar. See this question for some background on that.

If you want to change the content of the config value, mind that from a YAML perspective, it is a single scalar. The key/value separation with = is not something YAML recognizes. yq provides regex replacement in scalars which may or may not be sufficient for your use-case.

flyx
  • 35,506
  • 7
  • 89
  • 126