Created
February 28, 2021 09:49
-
-
Save making/c0b140647e04a8ccb91154fc9ecf789f to your computer and use it in GitHub Desktop.
参照するConfigMapのmd5値をannotationに追加したい
This file contains hidden or 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: ConfigMap | |
metadata: | |
name: app-config | |
data: | |
SPECIAL_LEVEL: very | |
SPECIAL_TYPE: charm |
This file contains hidden or 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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: demo | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: demo | |
template: | |
metadata: | |
labels: | |
app: demo | |
spec: | |
containers: | |
- image: ghcr.io/making/hello-tanzu | |
name: hello-tanzu | |
envFrom: | |
- configMapRef: | |
name: app-config |
This file contains hidden or 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
#@ load("@ytt:overlay", "overlay") | |
#@ load("@ytt:data", "data") | |
#@ load("@ytt:md5", "md5") | |
#@overlay/match by=overlay.subset({"kind":"Deployment","metadata":{"name":"demo"}}) | |
--- | |
spec: | |
template: | |
metadata: | |
#@overlay/match missing_ok=True | |
#@overlay/match-child-defaults missing_ok=True | |
annotations: | |
app-config-md5: #@ md5.sum(data.read("app-config.yml")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment