sparse-intern-71089
11/05/2018, 10:43 PMcreamy-potato-29402
11/05/2018, 10:44 PMcreamy-potato-29402
11/05/2018, 10:45 PMcreamy-potato-29402
11/05/2018, 10:45 PMcold-train-5848
11/05/2018, 11:48 PMconst imagePullSecret = new k8s.core.v1.Secret("regcred", {
type: "<http://kubernetes.io/dockerconfigjson|kubernetes.io/dockerconfigjson>",
metadata: { name: "regcred" },
data: {
".dockerconfigjson": Buffer.from(
JSON.stringify({
auths: {
"127.0.0.1:5000": {
username: config.require("dockerUsername"),
password: config.require("dockerPassword"),
auth: Buffer.from(
`${config.require("dockerUsername")}:${config.require(
"dockerPassword"
)}`
).toString("base64")
}
}
})
).toString("base64")
}
});
const appLabels = { app: appName };
const myaPpDeployment = new k8s.apps.v1beta1.Deployment(appName, {
spec: {
selector: { matchLabels: appLabels },
replicas: 1,
template: {
metadata: { labels: appLabels },
spec: {
imagePullSecrets: [{ name: "regcred" }],
// Use the app container at the specific SHA pushed.
containers: [
{
name: appName,
image: myaPpDocker.imageName
}
]
}
}
}
});
creamy-potato-29402
11/05/2018, 11:50 PMcreamy-potato-29402
11/05/2018, 11:50 PM