Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we use url of datasource in kubernetes while creating configmap

How can we use url of datasource in kubernetes while creating configmap like ex. kubectl create configmap config-from-file --from-file=https://url-to-file-location

like image 635
Paramanand Dhuri Avatar asked Oct 25 '25 03:10

Paramanand Dhuri


2 Answers

No, currently it is not possible to directly use URL as source for a configMap property.

But this will do the trick:

kubectl create configmap config-from-url --from-literal=propkey="$(curl -k https://url-to-file-location)"

You can specify the namespace where to create the configMap with -n or --namespace - see kubectl options.

The -k option for curl allows connections to sites with untrusted (e.g. self-signed) certs.

Using wget instead of curl can be another option.

like image 169
apisim Avatar answered Oct 26 '25 19:10

apisim


kubectl doesn't support creating configmaps using urls https://github.com/kubernetes/website/pull/9903

like image 43
Ijaz Ahmad Avatar answered Oct 26 '25 18:10

Ijaz Ahmad