-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* -init created template file * -added kubernetes template for deploy and expose a service. * -instead of using "test" as tag, using the version defined in config.yml as tag. In future we may need to remove the version from the image name. * -added following to the kubernetes deploy template: resource requests/limits liveness/readiness checks label for environment
- Loading branch information
1 parent
94827bd
commit 0d8dd75
Showing
2 changed files
with
62 additions
and
13 deletions.
There are no files selected for viewing
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
58 changes: 58 additions & 0 deletions
58
light-rest-4j/src/main/resources/templates/rest/kubernetes.rocker.raw
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
@args (String org, String serviceId, String artifact, String expose, String version) | ||
#change the image tag before you deploy, if using minikube, please use any tag other than "latest" | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: @artifact-deployment | ||
labels: | ||
app: @artifact | ||
environment: dev | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: @artifact | ||
template: | ||
metadata: | ||
labels: | ||
app: @artifact | ||
spec: | ||
containers: | ||
- name: @artifact | ||
image: @org/@serviceId:@version | ||
ports: | ||
- containerPort: @expose | ||
resources: | ||
requests: | ||
memory: "64Mi" | ||
#0.25 cpu | ||
cpu: "250m" | ||
limits: | ||
#0.5 cpu | ||
memory: "128Mi" | ||
cpu: "500m" | ||
#cannot use httpcheck due to the server can be https | ||
readinessProbe: | ||
tcpSocket: | ||
port: @expose | ||
initialDelaySeconds: 3 | ||
periodSeconds: 3 | ||
livenessProbe: | ||
tcpSocket: | ||
port: @expose | ||
initialDelaySeconds: 5 | ||
periodSeconds: 20 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: @artifact-service | ||
labels: | ||
app: @artifact | ||
spec: | ||
selector: | ||
app: @artifact | ||
type: NodePort | ||
ports: | ||
- protocol: TCP | ||
port: @expose |