Created
March 9, 2018 09:47
-
-
Save Gutek/e9133cb41a41c7897c23428c3f947125 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: samples | |
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: sample-api-cm | |
namespace: samples | |
data: | |
SAMPLE__ENV1: val1 | |
SAMPLE__ENV2: val2 | |
SECTION__ONE: k8s | |
--- | |
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: sample-api-dep | |
namespace: samples | |
labels: | |
app: sample-api-app | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: sample-api-app | |
# wait 3 seconds before starting new instance/replica | |
minReadySeconds: 3 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxSurge: 30% | |
maxUnavailable: 30% | |
template: | |
metadata: | |
annotations: | |
kubernetes.io/change-cause: "First Deployment" | |
labels: | |
app: sample-api-app | |
spec: | |
containers: | |
- name: sample-api-container | |
image: gIMAGES | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 80 | |
# works | |
env: | |
- name: SAMPLE__ENV1 | |
valueFrom: | |
configMapKeyRef: | |
name: sample-api-cm | |
key: SAMPLE__ENV1 | |
- name: SAMPLE__ENV2 | |
valueFrom: | |
configMapKeyRef: | |
name: sample-api-cm | |
key: SAMPLE__ENV2 | |
# does not. comment out above etc | |
envFrom: | |
- configMapRef: | |
name: sample-api-cm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a fix: