mirror of
https://github.com/bvanroll/example-node-project.git
synced 2025-08-29 03:42:42 +00:00
Draft create
This commit is contained in:
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
draft.toml
|
||||||
|
charts/
|
||||||
|
NOTICE
|
||||||
|
LICENSE
|
||||||
|
README.md
|
27
.helmignore
Normal file
27
.helmignore
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
*.png
|
||||||
|
|
||||||
|
# known compile time folders
|
||||||
|
target/
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FROM node:9-slim
|
||||||
|
ENV PORT 8080
|
||||||
|
EXPOSE 8080
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY . .
|
||||||
|
CMD ["npm", "start"]
|
4
OWNERS
Normal file
4
OWNERS
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
approvers:
|
||||||
|
- beppevanrolleghem
|
||||||
|
reviewers:
|
||||||
|
- beppevanrolleghem
|
6
OWNERS_ALIASES
Normal file
6
OWNERS_ALIASES
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
aliases:
|
||||||
|
- beppevanrolleghem
|
||||||
|
best-approvers:
|
||||||
|
- beppevanrolleghem
|
||||||
|
best-reviewers:
|
||||||
|
- beppevanrolleghem
|
21
charts/frontend-node/.helmignore
Executable file
21
charts/frontend-node/.helmignore
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
5
charts/frontend-node/Chart.yaml
Normal file
5
charts/frontend-node/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
description: A Helm chart for Kubernetes
|
||||||
|
icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/d273e09/images/nodejs.png
|
||||||
|
name: frontend-node
|
||||||
|
version: 0.1.0-SNAPSHOT
|
48
charts/frontend-node/Makefile
Executable file
48
charts/frontend-node/Makefile
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
CHART_REPO := http://jenkins-x-chartmuseum:8080
|
||||||
|
CURRENT=$(pwd)
|
||||||
|
NAME := frontend-node
|
||||||
|
OS := $(shell uname)
|
||||||
|
RELEASE_VERSION := $(shell cat ../../VERSION)
|
||||||
|
|
||||||
|
build: clean
|
||||||
|
rm -rf requirements.lock
|
||||||
|
helm dependency build
|
||||||
|
helm lint
|
||||||
|
|
||||||
|
install: clean build
|
||||||
|
helm install . --name ${NAME}
|
||||||
|
|
||||||
|
upgrade: clean build
|
||||||
|
helm upgrade ${NAME} .
|
||||||
|
|
||||||
|
delete:
|
||||||
|
helm delete --purge ${NAME}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf charts
|
||||||
|
rm -rf ${NAME}*.tgz
|
||||||
|
|
||||||
|
release: clean
|
||||||
|
helm dependency build
|
||||||
|
helm lint
|
||||||
|
helm init --client-only
|
||||||
|
helm package .
|
||||||
|
curl --fail -u $(CHARTMUSEUM_CREDS_USR):$(CHARTMUSEUM_CREDS_PSW) --data-binary "@$(NAME)-$(shell sed -n 's/^version: //p' Chart.yaml).tgz" $(CHART_REPO)/api/charts
|
||||||
|
rm -rf ${NAME}*.tgz%
|
||||||
|
|
||||||
|
tag:
|
||||||
|
ifeq ($(OS),Darwin)
|
||||||
|
sed -i "" -e "s/version:.*/version: $(RELEASE_VERSION)/" Chart.yaml
|
||||||
|
sed -i "" -e "s/tag:.*/tag: $(RELEASE_VERSION)/" values.yaml
|
||||||
|
else ifeq ($(OS),Linux)
|
||||||
|
sed -i -e "s/version:.*/version: $(RELEASE_VERSION)/" Chart.yaml
|
||||||
|
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/flowfactor\/frontend-node|" values.yaml
|
||||||
|
sed -i -e "s/tag:.*/tag: $(RELEASE_VERSION)/" values.yaml
|
||||||
|
else
|
||||||
|
echo "platfrom $(OS) not supported to release from"
|
||||||
|
exit -1
|
||||||
|
endif
|
||||||
|
git add --all
|
||||||
|
git commit -m "release $(RELEASE_VERSION)" --allow-empty # if first release then no verion update is performed
|
||||||
|
git tag -fa v$(RELEASE_VERSION) -m "Release version $(RELEASE_VERSION)"
|
||||||
|
git push origin v$(RELEASE_VERSION)
|
1
charts/frontend-node/README.md
Executable file
1
charts/frontend-node/README.md
Executable file
@@ -0,0 +1 @@
|
|||||||
|
# Javascript application
|
4
charts/frontend-node/templates/NOTES.txt
Executable file
4
charts/frontend-node/templates/NOTES.txt
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
Get the application URL by running these commands:
|
||||||
|
|
||||||
|
kubectl get ingress {{ template "fullname" . }}
|
16
charts/frontend-node/templates/_helpers.tpl
Executable file
16
charts/frontend-node/templates/_helpers.tpl
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
{{/* vim: set filetype=mustache: */}}
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
*/}}
|
||||||
|
{{- define "fullname" -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
85
charts/frontend-node/templates/canary.yaml
Executable file
85
charts/frontend-node/templates/canary.yaml
Executable file
@@ -0,0 +1,85 @@
|
|||||||
|
{{- if .Values.canary.enabled }}
|
||||||
|
apiVersion: flagger.app/v1beta1
|
||||||
|
kind: Canary
|
||||||
|
metadata:
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
labels:
|
||||||
|
draft: {{ default "draft-app" .Values.draft }}
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
spec:
|
||||||
|
provider: istio
|
||||||
|
targetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
progressDeadlineSeconds: {{ .Values.canary.progressDeadlineSeconds }}
|
||||||
|
{{- if .Values.hpa.enabled }}
|
||||||
|
autoscalerRef:
|
||||||
|
apiVersion: autoscaling/v2beta1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
service:
|
||||||
|
port: {{ .Values.service.externalPort }}
|
||||||
|
targetPort: {{ .Values.service.internalPort }}
|
||||||
|
gateways:
|
||||||
|
- {{ template "fullname" . }}
|
||||||
|
hosts:
|
||||||
|
- {{ .Values.canary.host }}
|
||||||
|
analysis:
|
||||||
|
interval: {{ .Values.canary.canaryAnalysis.interval }}
|
||||||
|
threshold: {{ .Values.canary.canaryAnalysis.threshold }}
|
||||||
|
maxWeight: {{ .Values.canary.canaryAnalysis.maxWeight }}
|
||||||
|
stepWeight: {{ .Values.canary.canaryAnalysis.stepWeight }}
|
||||||
|
metrics:
|
||||||
|
- name: request-success-rate
|
||||||
|
threshold: {{ .Values.canary.canaryAnalysis.metrics.requestSuccessRate.threshold }}
|
||||||
|
interval: {{ .Values.canary.canaryAnalysis.metrics.requestSuccessRate.interval }}
|
||||||
|
- name: latency
|
||||||
|
templateRef:
|
||||||
|
name: latency
|
||||||
|
thresholdRange:
|
||||||
|
max: {{ .Values.canary.canaryAnalysis.metrics.requestDuration.threshold }}
|
||||||
|
interval: {{ .Values.canary.canaryAnalysis.metrics.requestDuration.interval }}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: flagger.app/v1beta1
|
||||||
|
kind: MetricTemplate
|
||||||
|
metadata:
|
||||||
|
name: latency
|
||||||
|
spec:
|
||||||
|
provider:
|
||||||
|
type: prometheus
|
||||||
|
address: http://prometheus.istio-system:9090
|
||||||
|
query: |
|
||||||
|
histogram_quantile(
|
||||||
|
0.99,
|
||||||
|
sum(
|
||||||
|
rate(
|
||||||
|
istio_request_duration_milliseconds_bucket{
|
||||||
|
reporter="destination",
|
||||||
|
destination_workload_namespace="{{ "{{" }} namespace {{ "}}" }}",
|
||||||
|
destination_workload=~"{{ "{{" }} target {{ "}}" }}"
|
||||||
|
}[{{ "{{" }} interval {{ "}}" }}]
|
||||||
|
)
|
||||||
|
) by (le)
|
||||||
|
)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: networking.istio.io/v1alpha3
|
||||||
|
kind: Gateway
|
||||||
|
metadata:
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
istio: ingressgateway
|
||||||
|
servers:
|
||||||
|
- port:
|
||||||
|
number: {{ .Values.service.externalPort }}
|
||||||
|
name: http
|
||||||
|
protocol: HTTP
|
||||||
|
hosts:
|
||||||
|
- {{ .Values.canary.host }}
|
||||||
|
{{- end }}
|
59
charts/frontend-node/templates/deployment.yaml
Executable file
59
charts/frontend-node/templates/deployment.yaml
Executable file
@@ -0,0 +1,59 @@
|
|||||||
|
{{- if .Values.knativeDeploy }}
|
||||||
|
{{- else }}
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
labels:
|
||||||
|
draft: {{ default "draft-app" .Values.draft }}
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ template "fullname" . }}
|
||||||
|
{{- if .Values.hpa.enabled }}
|
||||||
|
{{- else }}
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
{{- end }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
draft: {{ default "draft-app" .Values.draft }}
|
||||||
|
app: {{ template "fullname" . }}
|
||||||
|
{{- if .Values.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.podAnnotations | indent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
env:
|
||||||
|
{{- range $pkey, $pval := .Values.env }}
|
||||||
|
- name: {{ $pkey }}
|
||||||
|
value: {{ quote $pval }}
|
||||||
|
{{- end }}
|
||||||
|
envFrom:
|
||||||
|
{{ toYaml .Values.envFrom | indent 10 }}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ .Values.service.internalPort }}
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: {{ .Values.probePath }}
|
||||||
|
port: {{ .Values.service.internalPort }}
|
||||||
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||||
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||||
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||||
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: {{ .Values.probePath }}
|
||||||
|
port: {{ .Values.service.internalPort }}
|
||||||
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||||
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||||
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||||
|
resources:
|
||||||
|
{{ toYaml .Values.resources | indent 12 }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
|
||||||
|
{{- end }}
|
25
charts/frontend-node/templates/hpa.yaml
Executable file
25
charts/frontend-node/templates/hpa.yaml
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
{{- if .Values.hpa.enabled }}
|
||||||
|
apiVersion: autoscaling/v2beta1
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
labels:
|
||||||
|
draft: {{ default "draft-app" .Values.draft }}
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
minReplicas: {{ .Values.hpa.minReplicas }}
|
||||||
|
maxReplicas: {{ .Values.hpa.maxReplicas }}
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
targetAverageUtilization: {{ .Values.hpa.cpuTargetAverageUtilization }}
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: memory
|
||||||
|
targetAverageUtilization: {{ .Values.hpa.memoryTargetAverageUtilization }}
|
||||||
|
{{- end }}
|
32
charts/frontend-node/templates/ingress.yaml
Executable file
32
charts/frontend-node/templates/ingress.yaml
Executable file
@@ -0,0 +1,32 @@
|
|||||||
|
{{- if and (.Values.jxRequirements.ingress.domain) (not .Values.knativeDeploy) }}
|
||||||
|
apiVersion: {{ .Values.jxRequirements.ingress.apiVersion }}
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
kubernetes.io/ingress.class: nginx
|
||||||
|
{{- if .Values.ingress.annotations }}
|
||||||
|
{{ toYaml .Values.ingress.annotations | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.jxRequirements.ingress.annotations }}
|
||||||
|
{{ toYaml .Values.jxRequirements.ingress.annotations | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
name: {{ .Values.service.name }}
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- backend:
|
||||||
|
serviceName: {{ .Values.service.name }}
|
||||||
|
servicePort: 80
|
||||||
|
{{- if .Values.jxRequirements.ingress.tls.enabled }}
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.service.name }}{{ .Values.jxRequirements.ingress.namespaceSubDomain }}{{ .Values.jxRequirements.ingress.domain }}
|
||||||
|
{{- if .Values.jxRequirements.ingress.tls.production }}
|
||||||
|
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-p"
|
||||||
|
{{- else }}
|
||||||
|
secretName: "tls-{{ .Values.jxRequirements.ingress.domain | replace "." "-" }}-s"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
41
charts/frontend-node/templates/ksvc.yaml
Executable file
41
charts/frontend-node/templates/ksvc.yaml
Executable file
@@ -0,0 +1,41 @@
|
|||||||
|
{{- if .Values.knativeDeploy }}
|
||||||
|
apiVersion: serving.knative.dev/v1alpha1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
{{- if .Values.service.name }}
|
||||||
|
name: {{ .Values.service.name }}
|
||||||
|
{{- else }}
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
spec:
|
||||||
|
runLatest:
|
||||||
|
configuration:
|
||||||
|
revisionTemplate:
|
||||||
|
spec:
|
||||||
|
container:
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
env:
|
||||||
|
{{- range $pkey, $pval := .Values.env }}
|
||||||
|
- name: {{ $pkey }}
|
||||||
|
value: {{ quote $pval }}
|
||||||
|
{{- end }}
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: {{ .Values.probePath }}
|
||||||
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||||
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||||
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||||
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||||
|
httpGet:
|
||||||
|
path: {{ .Values.probePath }}
|
||||||
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||||
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||||
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||||
|
resources:
|
||||||
|
{{ toYaml .Values.resources | indent 14 }}
|
||||||
|
{{- end }}
|
26
charts/frontend-node/templates/service.yaml
Executable file
26
charts/frontend-node/templates/service.yaml
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
{{- if or .Values.knativeDeploy .Values.canary.enabled }}
|
||||||
|
{{- else }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
{{- if .Values.service.name }}
|
||||||
|
name: {{ .Values.service.name }}
|
||||||
|
{{- else }}
|
||||||
|
name: {{ template "fullname" . }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
|
||||||
|
{{- if .Values.service.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.service.annotations | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.service.externalPort }}
|
||||||
|
targetPort: {{ .Values.service.internalPort }}
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
app: {{ template "fullname" . }}
|
||||||
|
{{- end }}
|
95
charts/frontend-node/values.yaml
Executable file
95
charts/frontend-node/values.yaml
Executable file
@@ -0,0 +1,95 @@
|
|||||||
|
# Default values for node projects.
|
||||||
|
# This is a YAML-formatted file.
|
||||||
|
# Declare variables to be passed into your templates.
|
||||||
|
replicaCount: 1
|
||||||
|
image:
|
||||||
|
repository: draft
|
||||||
|
tag: dev
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
# define environment variables here as a map of key: value
|
||||||
|
env:
|
||||||
|
|
||||||
|
# enable this flag to use knative serve to deploy the app
|
||||||
|
knativeDeploy: false
|
||||||
|
|
||||||
|
# HorizontalPodAutoscaler
|
||||||
|
hpa:
|
||||||
|
enabled: false
|
||||||
|
minReplicas: 2
|
||||||
|
maxReplicas: 6
|
||||||
|
cpuTargetAverageUtilization: 80
|
||||||
|
memoryTargetAverageUtilization: 80
|
||||||
|
|
||||||
|
# Canary deployments
|
||||||
|
# If enabled, Istio v1.5+ and Flagger need to be installed in the cluster
|
||||||
|
canary:
|
||||||
|
enabled: false
|
||||||
|
progressDeadlineSeconds: 60
|
||||||
|
canaryAnalysis:
|
||||||
|
interval: "1m"
|
||||||
|
threshold: 5
|
||||||
|
maxWeight: 60
|
||||||
|
stepWeight: 20
|
||||||
|
# WARNING: Canary deployments will fail and rollback if there is no traffic that will generate the below specified metrics.
|
||||||
|
metrics:
|
||||||
|
requestSuccessRate:
|
||||||
|
threshold: 99
|
||||||
|
interval: "1m"
|
||||||
|
requestDuration:
|
||||||
|
threshold: 1000
|
||||||
|
interval: "1m"
|
||||||
|
# The host is using Istio Gateway and is currently not auto-generated
|
||||||
|
# Please overwrite the `canary.host` in `values.yaml` in each environment repository (e.g., staging, production)
|
||||||
|
host: acme.com
|
||||||
|
|
||||||
|
service:
|
||||||
|
name: frontend-node
|
||||||
|
type: ClusterIP
|
||||||
|
externalPort: 80
|
||||||
|
internalPort: 8080
|
||||||
|
annotations:
|
||||||
|
fabric8.io/expose: "true"
|
||||||
|
fabric8.io/ingress.annotations: "kubernetes.io/ingress.class: nginx"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 400m
|
||||||
|
memory: 256Mi
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 128Mi
|
||||||
|
probePath: /
|
||||||
|
livenessProbe:
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 1
|
||||||
|
readinessProbe:
|
||||||
|
failureThreshold: 1
|
||||||
|
periodSeconds: 10
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 1
|
||||||
|
|
||||||
|
|
||||||
|
# custom ingress annotations on this service
|
||||||
|
ingress:
|
||||||
|
annotations:
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
|
||||||
|
# values we use from the `jx-requirements.yml` file if we are using helmfile and helm 3
|
||||||
|
jxRequirements:
|
||||||
|
ingress:
|
||||||
|
domain: ""
|
||||||
|
externalDNS: false
|
||||||
|
namespaceSubDomain: -jx.
|
||||||
|
tls:
|
||||||
|
email: ""
|
||||||
|
enabled: false
|
||||||
|
production: false
|
||||||
|
|
||||||
|
# For Kubernetes v1.14+, use 'networking.k8s.io/v1beta1'
|
||||||
|
apiVersion: "extensions/v1beta1"
|
||||||
|
|
||||||
|
# shared ingress annotations on all services
|
||||||
|
annotations:
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
5
charts/preview/Chart.yaml
Normal file
5
charts/preview/Chart.yaml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
description: A Helm chart for Kubernetes
|
||||||
|
icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-platform/master/images/java.png
|
||||||
|
name: preview
|
||||||
|
version: 0.1.0-SNAPSHOT
|
18
charts/preview/Makefile
Executable file
18
charts/preview/Makefile
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
OS := $(shell uname)
|
||||||
|
|
||||||
|
preview:
|
||||||
|
ifeq ($(OS),Darwin)
|
||||||
|
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml
|
||||||
|
sed -i "" -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml
|
||||||
|
sed -i "" -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml
|
||||||
|
else ifeq ($(OS),Linux)
|
||||||
|
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" Chart.yaml
|
||||||
|
sed -i -e "s/version:.*/version: $(PREVIEW_VERSION)/" ../*/Chart.yaml
|
||||||
|
sed -i -e "s|repository:.*|repository: $(DOCKER_REGISTRY)\/flowfactor\/frontend-node|" values.yaml
|
||||||
|
sed -i -e "s/tag:.*/tag: $(PREVIEW_VERSION)/" values.yaml
|
||||||
|
else
|
||||||
|
echo "platfrom $(OS) not supported to release from"
|
||||||
|
exit -1
|
||||||
|
endif
|
||||||
|
echo " version: $(PREVIEW_VERSION)" >> requirements.yaml
|
||||||
|
jx step helm build
|
16
charts/preview/requirements.yaml
Executable file
16
charts/preview/requirements.yaml
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
# !! File must end with empty line !!
|
||||||
|
dependencies:
|
||||||
|
- alias: expose
|
||||||
|
name: exposecontroller
|
||||||
|
repository: http://chartmuseum.jenkins-x.io
|
||||||
|
version: 2.3.92
|
||||||
|
- alias: cleanup
|
||||||
|
name: exposecontroller
|
||||||
|
repository: http://chartmuseum.jenkins-x.io
|
||||||
|
version: 2.3.92
|
||||||
|
|
||||||
|
# !! "alias: preview" must be last entry in dependencies array !!
|
||||||
|
# !! Place custom dependencies above !!
|
||||||
|
- alias: preview
|
||||||
|
name: frontend-node
|
||||||
|
repository: file://../frontend-node
|
22
charts/preview/values.yaml
Executable file
22
charts/preview/values.yaml
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
expose:
|
||||||
|
Annotations:
|
||||||
|
helm.sh/hook: post-install,post-upgrade
|
||||||
|
helm.sh/hook-delete-policy: hook-succeeded
|
||||||
|
config:
|
||||||
|
exposer: Ingress
|
||||||
|
http: true
|
||||||
|
tlsacme: false
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
Args:
|
||||||
|
- --cleanup
|
||||||
|
Annotations:
|
||||||
|
helm.sh/hook: pre-delete
|
||||||
|
helm.sh/hook-delete-policy: hook-succeeded
|
||||||
|
|
||||||
|
preview:
|
||||||
|
image:
|
||||||
|
repository:
|
||||||
|
tag:
|
||||||
|
pullPolicy: IfNotPresent
|
1
jenkins-x.yml
Executable file
1
jenkins-x.yml
Executable file
@@ -0,0 +1 @@
|
|||||||
|
buildPack: javascript
|
28
skaffold.yaml
Normal file
28
skaffold.yaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
apiVersion: skaffold/v1beta2
|
||||||
|
kind: Config
|
||||||
|
build:
|
||||||
|
artifacts:
|
||||||
|
- image: flowfactor/frontend-node
|
||||||
|
context: .
|
||||||
|
docker: {}
|
||||||
|
tagPolicy:
|
||||||
|
envTemplate:
|
||||||
|
template: '{{.DOCKER_REGISTRY}}/{{.IMAGE_NAME}}:{{.VERSION}}'
|
||||||
|
local: {}
|
||||||
|
deploy:
|
||||||
|
kubectl: {}
|
||||||
|
profiles:
|
||||||
|
- name: dev
|
||||||
|
build:
|
||||||
|
tagPolicy:
|
||||||
|
envTemplate:
|
||||||
|
template: '{{.DOCKER_REGISTRY}}/{{.IMAGE_NAME}}:{{.DIGEST_HEX}}'
|
||||||
|
local: {}
|
||||||
|
deploy:
|
||||||
|
helm:
|
||||||
|
releases:
|
||||||
|
- name: frontend-node
|
||||||
|
chartPath: charts/frontend-node
|
||||||
|
setValueTemplates:
|
||||||
|
image.repository: '{{.DOCKER_REGISTRY}}/{{.IMAGE_NAME}}'
|
||||||
|
image.tag: '{{.DIGEST_HEX}}'
|
Reference in New Issue
Block a user