Created
March 9, 2020 22:42
-
-
Save cagdas1/abca6a9221d33e16b7305f317f7cd1a2 to your computer and use it in GitHub Desktop.
Serveress EKS Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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