motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.77k stars 319 forks source link

allow option to add valuesFrom env vars #424

Closed ashleyschuett closed 4 years ago

ashleyschuett commented 4 years ago

What does this PR do?

Add the option to have valuesFrom env vars in the Janus deployment.

Example output:

# Source: janus/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: imprecise-robin-janus
  labels:
    app.kubernetes.io/name: janus
    helm.sh/chart: janus-0.1.0
    app.kubernetes.io/instance: imprecise-robin
    app.kubernetes.io/version: "1.0"
    app.kubernetes.io/managed-by: Tiller
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: janus
      app.kubernetes.io/instance: imprecise-robin
  template:
    metadata:
      labels:
        app.kubernetes.io/name: janus
        app.kubernetes.io/instance: imprecise-robin
    spec:
      containers:
        - name: janus
          image: "quay.io/hellofresh/janus:latest"
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
            - containerPort: 8081
              name: http-private
              protocol: TCP
          env:
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: "DATABASE_DSN"
              value: "mongodb://janus-database:27017/janus"
vgarvardt commented 4 years ago

👍

Approved with Zappr Approved with Zappr Approved with Zappr

codecov[bot] commented 4 years ago

Codecov Report

Merging #424 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #424   +/-   ##
=======================================
  Coverage   40.46%   40.46%           
=======================================
  Files          76       76           
  Lines        2659     2659           
=======================================
  Hits         1076     1076           
  Misses       1520     1520           
  Partials       63       63

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 680e0cb...f394527. Read the comment docs.

aleksandrzhiliaev commented 4 years ago

+1

Approved with Zappr Approved with Zappr Approved with Zappr Approved with Zappr