Skip to content

Instantly share code, notes, and snippets.

@simbo1905
Created September 2, 2019 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simbo1905/14621fcee57701258bc49cba666396ce to your computer and use it in GitHub Desktop.
Save simbo1905/14621fcee57701258bc49cba666396ce to your computer and use it in GitHub Desktop.
use an initContainer to write configuration into an empty ephemeral folder
#!/bin/bash
cat | oc create -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
name: my-app
spec:
containers:
- name: realworld
image: docker.io/simonmassey/react-redux-realworld:v0.0.2
env:
- name: API_ROOT
value: https://conduit.productionready.io/api
volumeMounts:
- mountPath: /data
name: config-data
initContainers:
- name: config-data
image: busybox
command: ["sh", "-c", "echo {'address':'10.0.1.192:2379/db'} > /data/config"]
volumeMounts:
- mountPath: /data
name: config-data
volumes:
- name: config-data
emptyDir:
{}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment