我似乎无法执行任何参数替换。
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