Skip to content

Commit b9ba509

Browse files
authored
Merge pull request sclorg#138 from jim-minter/helmchart
add basic helm chart
2 parents 44abae3 + d6a27c2 commit b9ba509

File tree

8 files changed

+147
-0
lines changed

8 files changed

+147
-0
lines changed

helm/nodejs/Chart.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: nodejs
2+
version: 0.1
3+
description: An example Node.js application with no database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md.
4+
keywords:
5+
- quickstart
6+
- nodejs
7+
home: https://access.redhat.com
8+
sources:
9+
- https://github.com/openshift/nodejs-ex

helm/nodejs/templates/NOTES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The following service(s) have been created in your project: {{ .Values.name }}.
2+
3+
For more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
kind: BuildConfig
2+
apiVersion: build.openshift.io/v1
3+
metadata:
4+
name: {{ .Values.name | quote }}
5+
annotations:
6+
description: Defines how to build the application
7+
spec:
8+
source:
9+
type: Git
10+
git:
11+
uri: {{ .Values.source_repository_url | quote }}
12+
ref: {{ .Values.source_repository_ref | quote }}
13+
contextDir: {{ .Values.context_dir | quote }}
14+
strategy:
15+
type: Source
16+
sourceStrategy:
17+
from:
18+
kind: ImageStreamTag
19+
namespace: {{ .Values.namespace | quote }}
20+
name: nodejs:6
21+
env:
22+
- name: NPM_MIRROR
23+
value: {{ .Values.npm_mirror | quote }}
24+
output:
25+
to:
26+
kind: ImageStreamTag
27+
name: {{ print .Values.name ":latest" | quote }}
28+
triggers:
29+
- type: ImageChange
30+
- type: ConfigChange
31+
- type: GitHub
32+
github:
33+
secret: {{ .Values.github_webhook_secret | default (randAlphaNum 40) | quote }}
34+
- type: Generic
35+
generic:
36+
secret: {{ .Values.generic_webhook_secret | default (randAlphaNum 40) | quote }}
37+
postCommit:
38+
script: npm test
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
kind: DeploymentConfig
2+
apiVersion: apps.openshift.io/v1
3+
metadata:
4+
name: {{ .Values.name | quote }}
5+
annotations:
6+
description: Defines how to deploy the application server
7+
template.alpha.openshift.io/wait-for-ready: 'true'
8+
spec:
9+
strategy:
10+
type: Rolling
11+
triggers:
12+
- type: ImageChange
13+
imageChangeParams:
14+
automatic: true
15+
containerNames:
16+
- nodejs-example
17+
from:
18+
kind: ImageStreamTag
19+
name: {{ print .Values.name ":latest" | quote }}
20+
- type: ConfigChange
21+
replicas: 1
22+
selector:
23+
name: {{ .Values.name | quote }}
24+
template:
25+
metadata:
26+
name: {{ .Values.name | quote }}
27+
labels:
28+
name: {{ .Values.name | quote }}
29+
spec:
30+
containers:
31+
- name: nodejs-example
32+
image: " "
33+
ports:
34+
- containerPort: 8080
35+
readinessProbe:
36+
timeoutSeconds: 3
37+
initialDelaySeconds: 3
38+
httpGet:
39+
path: "/"
40+
port: 8080
41+
livenessProbe:
42+
timeoutSeconds: 3
43+
initialDelaySeconds: 30
44+
httpGet:
45+
path: "/"
46+
port: 8080
47+
resources:
48+
limits:
49+
memory: {{ .Values.memory_limit | quote }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: ImageStream
2+
apiVersion: image.openshift.io/v1
3+
metadata:
4+
name: {{ .Values.name | quote }}
5+
annotations:
6+
description: Keeps track of changes in the application image

helm/nodejs/templates/route.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
kind: Route
2+
apiVersion: route.openshift.io/v1
3+
metadata:
4+
name: {{ .Values.name | quote }}
5+
spec:
6+
host: {{ .Values.application_domain | quote }}
7+
to:
8+
kind: Service
9+
name: {{ .Values.name | quote }}

helm/nodejs/templates/service.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: {{ .Values.name | quote }}
5+
annotations:
6+
description: Exposes and load balances the application pods
7+
spec:
8+
ports:
9+
- name: web
10+
port: 8080
11+
targetPort: 8080
12+
selector:
13+
name: {{ .Values.name | quote }}

helm/nodejs/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Name: The name assigned to all of the frontend objects defined in this template.
2+
name: nodejs-example
3+
# Namespace: The OpenShift Namespace where the ImageStream resides.
4+
namespace: openshift
5+
# Memory Limit: Maximum amount of memory the container can use.
6+
memory_limit: 512Mi
7+
# Git Repository URL: The URL of the repository with your application source code.
8+
source_repository_url: https://github.com/openshift/nodejs-ex.git
9+
# Git Reference: Set this to a branch name, tag or other ref of your repository if you are not using the default branch.
10+
source_repository_ref:
11+
# Context Directory: Set this to the relative path to your project if it is not in the root of your repository.
12+
context_dir:
13+
# Application Hostname: The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted.
14+
application_domain:
15+
# GitHub Webhook Secret: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted.
16+
github_webhook_secret:
17+
# Generic Webhook Secret: A secret string used to configure the Generic webhook.
18+
generic_webhook_secret:
19+
# Custom NPM Mirror URL: The custom NPM mirror URL
20+
npm_mirror:

0 commit comments

Comments
 (0)