如何解决Gitlab部署标签Yaml错误traefik-metadata.labels:无效值
我正在尝试部署我的应用程序,但是我正在添加的traefik标签出现以下yaml错误,以便Traefik可以检测到该应用程序。
$ kubectl apply -f example-app.yml
The ReplicationController "example-app" is invalid:
* metadata.labels: Invalid value: "Host(`mydomain.com`)": a valid label must be an empty string or consist of alphanumeric characters,'-','_' or '.',and must start and end with an alphanumeric character (e.g. 'MyValue',or 'my_value',or '12345',regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')
我的示例-app.yml:
apiVersion: v1
kind: ReplicationController
metadata:
namespace: example
name: example-app
labels:
example-component: "example-app"
traefik.enable: "true"
traefik.http.routers.example-app.rule: "Host(`mydomain.com`)"
traefik.http.routers.example-app.entrypoints: "web"
我也尝试过:
- "example-component=example-app"
- "traefik.http.routers.example-app.rule=Host(mydomain.com)"
- "traefik.http.routers.example-app.entrypoints=web"
- "traefik.enable=true"
但得到:
invalid type for io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta.labels: got "array",expected "map"];
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。