Skip to content

Instantly share code, notes, and snippets.

@cagdas1
Created March 9, 2020 22:42
Show Gist options
  • Save cagdas1/abca6a9221d33e16b7305f317f7cd1a2 to your computer and use it in GitHub Desktop.
Save cagdas1/abca6a9221d33e16b7305f317f7cd1a2 to your computer and use it in GitHub Desktop.
Serveress EKS Helper
export function getKubernetesTemplates(
repo: any,
name: string,
containerPort: number,
replicaNumber: number
) {
return [
{
apiVersion: "apps/v1",
kind: "Deployment",
metadata: { name },
spec: {
replicas: replicaNumber,
selector: { matchLabels: { app: name } },
template: {
metadata: {
labels: { app: name }
},
spec: {
containers: [
{
name: name,
image: repo.imageUri,
ports: [{ containerPort }]
}
]
}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment