# Deployment configuration parameter from file or Environment

**URL:** <https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435>\
**Category:** General Discussions\
**Tags:** development\
**Created:** [September 15, 2021, 9:55am UTC](https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435 "2021-09-15T09:55:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![guerai](https://avatars.discourse-cdn.com/v4/letter/g/ecb155/32.png) [@guerai](https://discuss.kubernetes.io/u/guerai)\
**Post date:** [September 15, 2021, 9:55am UTC](https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435/1 "2021-09-15T09:55:31Z")

</div>

Dear all,  
I’m new in Kubernetes, there is a possibility to read deployment or service parameters from file or environment or ConfigMap?

As example

apiVersion: apps/v1  
kind: Deployment  
metadata:  
name: nginx-yaml  
labels:  
[app.kubernetes.io/name:](http://app.kubernetes.io/name:) nginx-yaml-service  
[app.kubernetes.io/instance:](http://app.kubernetes.io/instance:) nginx-yaml-service-06092021  
environment: aks-test  
spec:  
replicas: **$ReplicasNumber**  
selector:  
matchLabels:  
app: nginx-yaml  
minReadySeconds: **$minReadySeconds or configMap.minreadySec**  
strategy:  
rollingUpdate:  
maxSurge: **$maxSurge or configMap.maxSurge**  
maxUnavailable: 0  
type: RollingUpdate  
template:  
metadata:  
labels:  
app: nginx-yaml  
…

thanks

---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [September 15, 2021, 12:16pm UTC](https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435/2 "2021-09-15T12:16:11Z")

</div>

I can’t say that I’ve seen anything around that enables that kind of functionality. What are you trying to achieve, generic templating/modification or something else? If the former you’d want to look at things like helm, kustomize or kpt.

---

<div class="post-metadata">

**Author:** ![guerai](https://avatars.discourse-cdn.com/v4/letter/g/ecb155/32.png) [@guerai](https://discuss.kubernetes.io/u/guerai)\
**Post date:** [October 29, 2021, 8:22am UTC](https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435/3 "2021-10-29T08:22:57Z")

</div>

Thanks for your response,

I’m trying to made a solution like:

```auto
ports:
- name: liveness-port
  containerPort: 8080
  hostPort: 8080

livenessProbe:
  httpGet:
    path: /healthz
    port: liveness-port
  failureThreshold: 1
  periodSeconds: 10

startupProbe:
  httpGet:
    path: /healthz
    port: liveness-port
  failureThreshold: 30
  periodSeconds: 10

```

in this case liveness-port is “as a parameter/variable”. It is possible to define as example also “path” as parameter?

```auto
paths:
- name: hc-path
  path: /healthz

ports:
- name: liveness-port
  containerPort: 8080
  hostPort: 8080

livenessProbe:
  httpGet:
    path: hc-path
    port: liveness-port
  failureThreshold: 1
  periodSeconds: 10

startupProbe:
  httpGet:
    path: hc-path
    port: liveness-port
  failureThreshold: 30
  periodSeconds: 10

```

Thanks for your time

---

<div class="post-metadata">

**Author:** ![macintoshprime](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/macintoshprime/32/7121_2.png) [@macintoshprime](https://discuss.kubernetes.io/u/macintoshprime)\
**Post date:** [October 29, 2021, 12:45pm UTC](https://discuss.kubernetes.io/t/deployment-configuration-parameter-from-file-or-environment/17435/4 "2021-10-29T12:45:38Z")

</div>

I think the closest you’ll be able to get to that functionality is using [https://kustomize.io/](https://kustomize.io/) and it’s [patches/overlays](https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/patches/) feature .
