Created
September 2, 2019 14:55
-
-
Save simbo1905/14621fcee57701258bc49cba666396ce to your computer and use it in GitHub Desktop.
use an initContainer to write configuration into an empty ephemeral folder
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
#!/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