0

How do I get a specific value for a parameter ? For example - How do I search for the below:

1) password: ${dpt_password}

2) bootstrap-servers: xl-kb01.inpod.com:19093,xl-kb02.inpod.com:19093

3) springframework: INFO

kubectl get cm inpod -o jsonpath={.data}


map[application.yaml:ds:
  hosts: '-'
  keyspaces: '-'
  password: ${dpt_password}
  port: '9042'
  username: ${dpt_username}
externalresources:
  pluser:
    url: https://inpod.com/v1
jdbc:
  url: jdbc:oracle:thin:@//pxd.ord.com:1521/pxd
kafka:
  bootstrap-servers: xl-kb01.inpod.com:19093,xl-kb02.inpod.com:19093
  consumer:
    group: inpod
  schema-registry:
    endpoint: https://pxd-dev.inpod.com:8443
  security:
    protocol: SSL
  ssl:
    client-auth: need
logging:
  level:
    com:
      ab: INFO
      ba: DEBUG
    org:
      hibernate: INFO
      springframework: INFO
server:
  ssl:
    client-auth: need
    enabled: 'true'
  tomcat:
    enabled: 'true'
    file-date-format: .yyyy-MM-dd
    prefix: access_log
    rename-on-rotate: 'false'
    rotate: 'true'
    suffix: .log
endpoints_test:
  url: http://localhost:8280/inpod/rest
]
A_Suh
  • 3,727
  • 6
  • 22

1 Answers1

0

If you are asking about how to push variables into configmap, you can do it by creating cm from file. Here is a simple example within shell script:

#!/bin/bash
echo "Enter username: "
read usr
echo "Enter password: "
read pass
echo -e "{password: " $pass", username: " $usr" }" > env.json
kubectl create configmap env-cm --from-file=env.json
kubectl get cm env-cm -o jsonpath={.data}

You can populate your source file with any kind of variable and use it for cm creation.

Take a look at this post

A_Suh
  • 3,727
  • 6
  • 22
  • I dont want to add configuration. I want to retrieve specific configuration. – user6400807 Apr 17 '19 at 16:27
  • @user6400807 it's not really clear what you are asking about. Please elaborate what do you mean by **"How do I search for the below"** Otherwise it looks like you are asking about grep across configmap – A_Suh May 13 '19 at 14:03