k8s:创建secret时报错
原创
©著作权归作者所有:来自51CTO博客作者wx62e0d796b5814的原创作品,请联系作者获取转载授权,否则将追究法律责任
Error from server (BadRequest): error when creating "secrets.yaml": Secret in version "v1" cannot be handled as a Secret: v1.Secret.Data: decode base64: illegal base64 data at input byte 0, error found in #10 byte of ...|ord":"pwd","username|..., bigger context ...|{"apiVersion":"v1","data":{"password":"pwd","username":"usernametest"},"kind":"Secret","metad|...
可能为secret中data字段中的值不是正确的BASE64.可用如下java代码检测看看是否报错:
String str= new String(Base64.getDecoder().decode("dmFsdWUtMg0K"));
System.out.println(str);