我似乎无法执行任何参数替换。
oc new-app -f template.yaml -p MEMORY_REQUEST=2G
oc new-app -f template.yaml -p MEMORY_REQUEST="2G"
oc new-app -f template.yaml --param=MEMORY_REQUEST=2G
oc new-app -f template.yaml --param=MEMORY_REQUEST="2G"
oc new-app -f template.yaml --param-file=myapp.properties (contains MEMORY_REQUEST=2G)
所有结果
error: unexpected parameter name "MEMORY_REQUEST".
yaml模板如下:
apiVersion: v1
kind: Template
metadata:
name: template
objects:
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
app: myapp
name: myapp
spec:
replicas: 1
selector:
app: myapp
deploymentconfig: myapp
template:
metadata:
labels:
app: myapp
deploymentconfig: myapp
spec:
containers:
- image: myapp:1.1.1
imagePullPolicy: IfNotPresent
name: myapp
ports:
- containerPort: 8888
resources:
requests:
memory: ${MEMORY_REQUEST}
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
答案 0 :(得分:1)
您没有在模板中定义参数部分,因此它将拒绝您尝试提供的任何参数。
最好在以下位置查看有关模板和参数的文档: