quiet-wolf-18467
dockerconfigjson
with Pulumi. I'm running into problems:
export const imagePullSecret = new k8s.core.v1.Secret(
"docker-hub",
{
type: "<http://kubernetes.io/dockerconfigjson|kubernetes.io/dockerconfigjson>",
metadata: {
namespace: "community"
},
data: {
".dockerconfigjson": config
.requireSecret("docker-hub-token")
.apply(value => {
Buffer.from(
JSON.stringify({
auths: {
"<https://index.docker.io/v1/>": {
auth: value
}
}
})
).toString("base64");
})
}
},
{
provider: kubernetesProvider
}
);
Diagnostics:
kubernetes:core:Secret (docker-hub):
error: check failed because malformed resource inputs: malformed RPC secret: missing value
Any advice, @creamy-potato-29402?gorgeous-egg-16927
10/28/2019, 3:44 PMexport const imagePullSecret = new k8s.core.v1.Secret(
"docker-hub",
{
type: "<http://kubernetes.io/dockerconfigjson|kubernetes.io/dockerconfigjson>",
metadata: {
namespace: "community"
},
stringData: {
".dockerconfigjson": config
.requireSecret("docker-hub-token")
.apply(value => {
return JSON.stringify({
auths: {
"<https://index.docker.io/v1/>": {
auth: value
}
}
})
})
},
},
{
provider: kubernetesProvider
}
);
stringData
field avoids having to base64 encode the string yourself.
2. You weren’t returning a value inside of the apply
, so the value of .dockerconfigjson
was null
.quiet-wolf-18467
gorgeous-egg-16927
10/28/2019, 3:52 PMquiet-wolf-18467
gorgeous-egg-16927
10/28/2019, 4:00 PMget
APIs to grab info on resources created out of band from Pulumi (e.g., by k8s). Something like this might do the trick:
const token = k8s.core.v1.ServiceAccount.get("token", "namespace/token-id");
quiet-wolf-18467
limited-rainbow-51650
01/28/2020, 9:35 AMgorgeous-egg-16927
01/28/2020, 2:22 PMlimited-rainbow-51650
01/28/2020, 2:29 PM