Created
January 15, 2020 19:36
-
-
Save sh0rez/a78de9f807eef5e9e29faa302489dc45 to your computer and use it in GitHub Desktop.
Creating ConfigMaps with Grafana Tanka
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
(import "ksonnet-util/kausal.libsonnet") + { | |
local configMap = $.core.v1.configMap, | |
local deploy = $.apps.v1.deployment, | |
local container = $.core.v1.container, | |
// the data for the configMap | |
myConfigData:: { | |
"foo.yml": std.manifestYamlDoc({ | |
foo: "bar", | |
list: [1,2,3], | |
object: { | |
"my key": "contains a space!", | |
} | |
}), | |
}, | |
// create a new configMap using the above data | |
configMap: configMap.new("my-cool-config") + | |
configMap.withData($.myConfigData), | |
// create a deployment that mounts the configMap | |
deployment: deploy.new( | |
name="myapp", | |
replicas=1, | |
containers=[container.new("app", "alpine:edge")], | |
) + $.util.configMapVolumeMount($.configMap, "/path/to/mountpoint"), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment