Coredns: the format of corefile in configmap

Created on 29 May 2019  路  3Comments  路  Source: coredns/coredns

Hi,there

I want to edit the options in corefile which belongs to a coredns configmap,
using client.core_v1_api.read_namespaced_config_map('coredns', 'kube-system').get('data').get('Corefile').get('.:53') , i can get the corefile of ".:53".

but how can i edit the option in this core file, for example,changing "cache 30" to "cache 50"?
it seems that the core file i get was treated as string type in the program.
Is there any convenient ways to do this?

Any reply would be appreciated.

kubernetes question

Most helpful comment

it seems that the core file i get was treated as string

Yes, Configmap values are strings, the Corefile is a single Configmap value.

Editing the Configmap via API would require string manipulation.

You could look at this package I recently wrote to facilitate editing Corefiles. Specifically New() and Corefile.ToString()

All 3 comments

it seems that the core file i get was treated as string

Yes, Configmap values are strings, the Corefile is a single Configmap value.

Editing the Configmap via API would require string manipulation.

You could look at this package I recently wrote to facilitate editing Corefiles. Specifically New() and Corefile.ToString()

it seems that the core file i get was treated as string

Yes, Configmap values are strings, the Corefile is a single Configmap value.

Editing the Configmap via API would require string manipulation.

You could look at this package I recently wrote to facilitate editing Corefiles. Specifically New() and Corefile.ToString()

@chrisohaver Thanks a lot

/label: question
/close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

msschl picture msschl  路  6Comments

JaroVojtek picture JaroVojtek  路  6Comments

SivaKesava1 picture SivaKesava1  路  4Comments

stp-ip picture stp-ip  路  4Comments

miekg picture miekg  路  4Comments