Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

set dynamic values with kubernetes yaml file

#!/bin/bash

# sample value for your variables
MYVARVALUE="nginx:latest"

# read the yml template from a file and substitute the string 
# {{MYVARNAME}} with the value of the MYVARVALUE variable
template=`cat "deploy.yml.template" | sed "s/{{MYVARNAME}}/$MYVARVALUE/g"`

# apply the yml with the substituted value
echo "$template" | kubectl apply -f -
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #dynamic #values #kubernetes #yaml #file
ADD COMMENT
Topic
Name
8+3 =