diff --git a/helm/nodejs/Chart.yaml b/helm/nodejs/Chart.yaml new file mode 100755 index 0000000..18c8d40 --- /dev/null +++ b/helm/nodejs/Chart.yaml @@ -0,0 +1,9 @@ +name: nodejs +version: 0.1 +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. +keywords: +- quickstart +- nodejs +home: https://access.redhat.com +sources: +- https://github.com/openshift/nodejs-ex diff --git a/helm/nodejs/templates/NOTES.txt b/helm/nodejs/templates/NOTES.txt new file mode 100644 index 0000000..94c70dd --- /dev/null +++ b/helm/nodejs/templates/NOTES.txt @@ -0,0 +1,3 @@ +The following service(s) have been created in your project: {{ .Values.name }}. + +For more information about using this template, including OpenShift considerations, see https://github.com/openshift/nodejs-ex/blob/master/README.md. diff --git a/helm/nodejs/templates/buildconfig.yaml b/helm/nodejs/templates/buildconfig.yaml new file mode 100755 index 0000000..2153999 --- /dev/null +++ b/helm/nodejs/templates/buildconfig.yaml @@ -0,0 +1,38 @@ +kind: BuildConfig +apiVersion: build.openshift.io/v1 +metadata: + name: {{ .Values.name | quote }} + annotations: + description: Defines how to build the application +spec: + source: + type: Git + git: + uri: {{ .Values.source_repository_url | quote }} + ref: {{ .Values.source_repository_ref | quote }} + contextDir: {{ .Values.context_dir | quote }} + strategy: + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + namespace: {{ .Values.namespace | quote }} + name: nodejs:6 + env: + - name: NPM_MIRROR + value: {{ .Values.npm_mirror | quote }} + output: + to: + kind: ImageStreamTag + name: {{ print .Values.name ":latest" | quote }} + triggers: + - type: ImageChange + - type: ConfigChange + - type: GitHub + github: + secret: {{ .Values.github_webhook_secret | default (randAlphaNum 40) | quote }} + - type: Generic + generic: + secret: {{ .Values.generic_webhook_secret | default (randAlphaNum 40) | quote }} + postCommit: + script: npm test diff --git a/helm/nodejs/templates/deploymentconfig.yaml b/helm/nodejs/templates/deploymentconfig.yaml new file mode 100755 index 0000000..6380bff --- /dev/null +++ b/helm/nodejs/templates/deploymentconfig.yaml @@ -0,0 +1,49 @@ +kind: DeploymentConfig +apiVersion: apps.openshift.io/v1 +metadata: + name: {{ .Values.name | quote }} + annotations: + description: Defines how to deploy the application server + template.alpha.openshift.io/wait-for-ready: 'true' +spec: + strategy: + type: Rolling + triggers: + - type: ImageChange + imageChangeParams: + automatic: true + containerNames: + - nodejs-example + from: + kind: ImageStreamTag + name: {{ print .Values.name ":latest" | quote }} + - type: ConfigChange + replicas: 1 + selector: + name: {{ .Values.name | quote }} + template: + metadata: + name: {{ .Values.name | quote }} + labels: + name: {{ .Values.name | quote }} + spec: + containers: + - name: nodejs-example + image: " " + ports: + - containerPort: 8080 + readinessProbe: + timeoutSeconds: 3 + initialDelaySeconds: 3 + httpGet: + path: "/" + port: 8080 + livenessProbe: + timeoutSeconds: 3 + initialDelaySeconds: 30 + httpGet: + path: "/" + port: 8080 + resources: + limits: + memory: {{ .Values.memory_limit | quote }} diff --git a/helm/nodejs/templates/imagestream.yaml b/helm/nodejs/templates/imagestream.yaml new file mode 100755 index 0000000..2252dc5 --- /dev/null +++ b/helm/nodejs/templates/imagestream.yaml @@ -0,0 +1,6 @@ +kind: ImageStream +apiVersion: image.openshift.io/v1 +metadata: + name: {{ .Values.name | quote }} + annotations: + description: Keeps track of changes in the application image diff --git a/helm/nodejs/templates/route.yaml b/helm/nodejs/templates/route.yaml new file mode 100644 index 0000000..eeb16ca --- /dev/null +++ b/helm/nodejs/templates/route.yaml @@ -0,0 +1,9 @@ +kind: Route +apiVersion: route.openshift.io/v1 +metadata: + name: {{ .Values.name | quote }} +spec: + host: {{ .Values.application_domain | quote }} + to: + kind: Service + name: {{ .Values.name | quote }} diff --git a/helm/nodejs/templates/service.yaml b/helm/nodejs/templates/service.yaml new file mode 100755 index 0000000..cfcc8ca --- /dev/null +++ b/helm/nodejs/templates/service.yaml @@ -0,0 +1,13 @@ +kind: Service +apiVersion: v1 +metadata: + name: {{ .Values.name | quote }} + annotations: + description: Exposes and load balances the application pods +spec: + ports: + - name: web + port: 8080 + targetPort: 8080 + selector: + name: {{ .Values.name | quote }} diff --git a/helm/nodejs/values.yaml b/helm/nodejs/values.yaml new file mode 100644 index 0000000..2a2509c --- /dev/null +++ b/helm/nodejs/values.yaml @@ -0,0 +1,20 @@ +# Name: The name assigned to all of the frontend objects defined in this template. +name: nodejs-example +# Namespace: The OpenShift Namespace where the ImageStream resides. +namespace: openshift +# Memory Limit: Maximum amount of memory the container can use. +memory_limit: 512Mi +# Git Repository URL: The URL of the repository with your application source code. +source_repository_url: https://github.com/openshift/nodejs-ex.git +# Git Reference: Set this to a branch name, tag or other ref of your repository if you are not using the default branch. +source_repository_ref: +# Context Directory: Set this to the relative path to your project if it is not in the root of your repository. +context_dir: +# Application Hostname: The exposed hostname that will route to the Node.js service, if left blank a value will be defaulted. +application_domain: +# GitHub Webhook Secret: Github trigger secret. A difficult to guess string encoded as part of the webhook URL. Not encrypted. +github_webhook_secret: +# Generic Webhook Secret: A secret string used to configure the Generic webhook. +generic_webhook_secret: +# Custom NPM Mirror URL: The custom NPM mirror URL +npm_mirror: