Skip to content

Instantly share code, notes, and snippets.

@harsimranmaan
Created July 24, 2020 18:16
Show Gist options
  • Save harsimranmaan/81821943dde73ba9570c2f793d7d1760 to your computer and use it in GitHub Desktop.
Save harsimranmaan/81821943dde73ba9570c2f793d7d1760 to your computer and use it in GitHub Desktop.
The deployment and config maps objects for my-app
local p = import '../params.libsonnet';
local params = p.components.hello;
[
{
apiVersion: 'v1',
kind: 'ConfigMap',
metadata: {
name: 'demo-config',
},
data: {
'index.html': params.indexData,
},
},
{
apiVersion: 'apps/v1',
kind: 'Deployment',
metadata: {
name: 'demo-deploy',
labels: {
app: 'demo-deploy',
},
},
spec: {
replicas: params.replicas,
selector: {
matchLabels: {
app: 'demo-deploy',
},
},
template: {
metadata: {
labels: {
app: 'demo-deploy',
},
},
spec: {
containers: [
{
name: 'main',
image: 'nginx:stable',
imagePullPolicy: 'Always',
volumeMounts: [
{
name: 'web',
mountPath: '/usr/share/nginx/html',
},
],
},
],
volumes: [
{
name: 'web',
configMap: {
name: 'demo-config',
},
},
],
},
},
},
},
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment