我有一个knative服务,我想为Cloud sql proxy创建一个sidecar容器,但是如果我运行kubectl,请应用以下错误:
发生内部错误:准入webhook“ webhook.serving.knative.dev”拒绝了该请求:变异失败:缺少字段:spec.template.spec.containers [0] .image
原生版本0.7
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: my-app-svc
namespace: test
spec:
template:
spec:
containers:
# pgsql https://cloud.google.com/sql/docs/mysql/connect-kubernetes-engine
- image: gcr.io/cloudsql-docker/gce-proxy:1.14
env:
- name: CONNECTION_NAME
valueFrom:
secretKeyRef:
name: db-cloud-instance
key: CONNECTION_NAME
command: [
"/cloud_sql_proxy",
"-instances=$(CONNECTION_NAME)=tcp:5432",
"-credential_file=/secrets/cloudsql/service-account-creds.json"
]
volumeMounts:
- name: service-account-creds
mountPath: /secrets/cloudsql
readOnly: true
- image: us.gcr.io/my-app/app:latest
ports:
- containerPort: 3000
env:
- name: TARGET
value: "my-app app"
volumes:
- name: service-account-creds
secret:
secretName: service-account-creds