From e1c8c728af028c8bf7fdd60b7b68f2f9e1e684a6 Mon Sep 17 00:00:00 2001 From: sido Date: Tue, 29 May 2018 10:10:05 +0200 Subject: [PATCH] feat(httpd): added httpd --- {charts/jenkins => httpd}/v1.0.0/.helmignore | 0 httpd/v1.0.0/Chart.yaml | 5 ++ httpd/v1.0.0/templates/NOTES.txt | 19 +++++++ httpd/v1.0.0/templates/_helpers.tpl | 32 ++++++++++++ httpd/v1.0.0/templates/deployment.yaml | 51 +++++++++++++++++++ httpd/v1.0.0/templates/ingress.yaml | 38 ++++++++++++++ httpd/v1.0.0/templates/service.yaml | 19 +++++++ httpd/v1.0.0/values.yaml | 45 ++++++++++++++++ {charts/nexus => jenkins}/v1.0.0/.helmignore | 0 {charts/jenkins => jenkins}/v1.0.0/Chart.yaml | 0 .../v1.0.0/catalogIcon-molgenis-jenkins.svg | 0 .../v1.0.0/templates/NOTES.txt | 0 .../v1.0.0/templates/_helpers.tpl | 0 .../v1.0.0/templates/deployment.yaml | 0 .../v1.0.0/templates/ingress.yaml | 0 .../v1.0.0/templates/service.yaml | 0 .../jenkins => jenkins}/v1.0.0/values.yaml | 2 +- nexus/v1.0.0/.helmignore | 21 ++++++++ {charts/nexus => nexus}/v1.0.0/Chart.yaml | 2 +- .../v1.0.0/catalogIcon-molgenis-nexus.svg | 0 .../v1.0.0/templates/NOTES.txt | 0 .../v1.0.0/templates/_helpers.tpl | 0 .../v1.0.0/templates/deployment.yaml | 0 .../v1.0.0/templates/ingress.yaml | 0 .../v1.0.0/templates/service.yaml | 0 {charts/nexus => nexus}/v1.0.0/values.yaml | 8 +-- 26 files changed, 233 insertions(+), 9 deletions(-) rename {charts/jenkins => httpd}/v1.0.0/.helmignore (100%) create mode 100644 httpd/v1.0.0/Chart.yaml create mode 100644 httpd/v1.0.0/templates/NOTES.txt create mode 100644 httpd/v1.0.0/templates/_helpers.tpl create mode 100644 httpd/v1.0.0/templates/deployment.yaml create mode 100644 httpd/v1.0.0/templates/ingress.yaml create mode 100644 httpd/v1.0.0/templates/service.yaml create mode 100644 httpd/v1.0.0/values.yaml rename {charts/nexus => jenkins}/v1.0.0/.helmignore (100%) rename {charts/jenkins => jenkins}/v1.0.0/Chart.yaml (100%) rename {charts/jenkins => jenkins}/v1.0.0/catalogIcon-molgenis-jenkins.svg (100%) rename {charts/jenkins => jenkins}/v1.0.0/templates/NOTES.txt (100%) rename {charts/jenkins => jenkins}/v1.0.0/templates/_helpers.tpl (100%) rename {charts/jenkins => jenkins}/v1.0.0/templates/deployment.yaml (100%) rename {charts/jenkins => jenkins}/v1.0.0/templates/ingress.yaml (100%) rename {charts/jenkins => jenkins}/v1.0.0/templates/service.yaml (100%) rename {charts/jenkins => jenkins}/v1.0.0/values.yaml (98%) create mode 100644 nexus/v1.0.0/.helmignore rename {charts/nexus => nexus}/v1.0.0/Chart.yaml (79%) rename {charts/nexus => nexus}/v1.0.0/catalogIcon-molgenis-nexus.svg (100%) rename {charts/nexus => nexus}/v1.0.0/templates/NOTES.txt (100%) rename {charts/nexus => nexus}/v1.0.0/templates/_helpers.tpl (100%) rename {charts/nexus => nexus}/v1.0.0/templates/deployment.yaml (100%) rename {charts/nexus => nexus}/v1.0.0/templates/ingress.yaml (100%) rename {charts/nexus => nexus}/v1.0.0/templates/service.yaml (100%) rename {charts/nexus => nexus}/v1.0.0/values.yaml (86%) diff --git a/charts/jenkins/v1.0.0/.helmignore b/httpd/v1.0.0/.helmignore similarity index 100% rename from charts/jenkins/v1.0.0/.helmignore rename to httpd/v1.0.0/.helmignore diff --git a/httpd/v1.0.0/Chart.yaml b/httpd/v1.0.0/Chart.yaml new file mode 100644 index 0000000..6e5cb82 --- /dev/null +++ b/httpd/v1.0.0/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: httpd +version: 0.1.0 diff --git a/httpd/v1.0.0/templates/NOTES.txt b/httpd/v1.0.0/templates/NOTES.txt new file mode 100644 index 0000000..b486fa5 --- /dev/null +++ b/httpd/v1.0.0/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "httpd.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "httpd.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "httpd.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "httpd.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/httpd/v1.0.0/templates/_helpers.tpl b/httpd/v1.0.0/templates/_helpers.tpl new file mode 100644 index 0000000..6968597 --- /dev/null +++ b/httpd/v1.0.0/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "httpd.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). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "httpd.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "httpd.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/httpd/v1.0.0/templates/deployment.yaml b/httpd/v1.0.0/templates/deployment.yaml new file mode 100644 index 0000000..50ab32b --- /dev/null +++ b/httpd/v1.0.0/templates/deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ template "httpd.fullname" . }} + labels: + app: {{ template "httpd.name" . }} + chart: {{ template "httpd.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "httpd.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "httpd.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/httpd/v1.0.0/templates/ingress.yaml b/httpd/v1.0.0/templates/ingress.yaml new file mode 100644 index 0000000..f8c7623 --- /dev/null +++ b/httpd/v1.0.0/templates/ingress.yaml @@ -0,0 +1,38 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "httpd.fullname" . -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "httpd.name" . }} + chart: {{ template "httpd.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/httpd/v1.0.0/templates/service.yaml b/httpd/v1.0.0/templates/service.yaml new file mode 100644 index 0000000..18a3380 --- /dev/null +++ b/httpd/v1.0.0/templates/service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "httpd.fullname" . }} + labels: + app: {{ template "httpd.name" . }} + chart: {{ template "httpd.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app: {{ template "httpd.name" . }} + release: {{ .Release.Name }} diff --git a/httpd/v1.0.0/values.yaml b/httpd/v1.0.0/values.yaml new file mode 100644 index 0000000..1a2b223 --- /dev/null +++ b/httpd/v1.0.0/values.yaml @@ -0,0 +1,45 @@ +# Default values for httpd. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: registry.webhosting.rug.nl/molgenis/httpd + tag: lts + pullPolicy: IfNotPresent + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/charts/nexus/v1.0.0/.helmignore b/jenkins/v1.0.0/.helmignore similarity index 100% rename from charts/nexus/v1.0.0/.helmignore rename to jenkins/v1.0.0/.helmignore diff --git a/charts/jenkins/v1.0.0/Chart.yaml b/jenkins/v1.0.0/Chart.yaml similarity index 100% rename from charts/jenkins/v1.0.0/Chart.yaml rename to jenkins/v1.0.0/Chart.yaml diff --git a/charts/jenkins/v1.0.0/catalogIcon-molgenis-jenkins.svg b/jenkins/v1.0.0/catalogIcon-molgenis-jenkins.svg similarity index 100% rename from charts/jenkins/v1.0.0/catalogIcon-molgenis-jenkins.svg rename to jenkins/v1.0.0/catalogIcon-molgenis-jenkins.svg diff --git a/charts/jenkins/v1.0.0/templates/NOTES.txt b/jenkins/v1.0.0/templates/NOTES.txt similarity index 100% rename from charts/jenkins/v1.0.0/templates/NOTES.txt rename to jenkins/v1.0.0/templates/NOTES.txt diff --git a/charts/jenkins/v1.0.0/templates/_helpers.tpl b/jenkins/v1.0.0/templates/_helpers.tpl similarity index 100% rename from charts/jenkins/v1.0.0/templates/_helpers.tpl rename to jenkins/v1.0.0/templates/_helpers.tpl diff --git a/charts/jenkins/v1.0.0/templates/deployment.yaml b/jenkins/v1.0.0/templates/deployment.yaml similarity index 100% rename from charts/jenkins/v1.0.0/templates/deployment.yaml rename to jenkins/v1.0.0/templates/deployment.yaml diff --git a/charts/jenkins/v1.0.0/templates/ingress.yaml b/jenkins/v1.0.0/templates/ingress.yaml similarity index 100% rename from charts/jenkins/v1.0.0/templates/ingress.yaml rename to jenkins/v1.0.0/templates/ingress.yaml diff --git a/charts/jenkins/v1.0.0/templates/service.yaml b/jenkins/v1.0.0/templates/service.yaml similarity index 100% rename from charts/jenkins/v1.0.0/templates/service.yaml rename to jenkins/v1.0.0/templates/service.yaml diff --git a/charts/jenkins/v1.0.0/values.yaml b/jenkins/v1.0.0/values.yaml similarity index 98% rename from charts/jenkins/v1.0.0/values.yaml rename to jenkins/v1.0.0/values.yaml index fb0eb38..7bc7f43 100644 --- a/charts/jenkins/v1.0.0/values.yaml +++ b/jenkins/v1.0.0/values.yaml @@ -6,7 +6,7 @@ replicaCount: 1 image: repository: registry.molgenis.org/molgenis-ops-releases/jenkins-master:lts - tag: stable + tag: lts pullPolicy: IfNotPresent service: diff --git a/nexus/v1.0.0/.helmignore b/nexus/v1.0.0/.helmignore new file mode 100644 index 0000000..f0c1319 --- /dev/null +++ b/nexus/v1.0.0/.helmignore @@ -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 diff --git a/charts/nexus/v1.0.0/Chart.yaml b/nexus/v1.0.0/Chart.yaml similarity index 79% rename from charts/nexus/v1.0.0/Chart.yaml rename to nexus/v1.0.0/Chart.yaml index 28cf47f..cc2a6d2 100644 --- a/charts/nexus/v1.0.0/Chart.yaml +++ b/nexus/v1.0.0/Chart.yaml @@ -3,4 +3,4 @@ appVersion: "1.0" description: Nexus stack for MOLGENIS name: nexus version: 0.1.0 -icon: https://github.com/sidohaakma/molgenis-docker-helm/blob/master/nexus/catalogIcon-molgenis-nexus.svg +icon: https://github.com/sidohaakma/molgenis-docker-helm/blob/master/nexus/catalogIcon-molgenis-nexus.svg \ No newline at end of file diff --git a/charts/nexus/v1.0.0/catalogIcon-molgenis-nexus.svg b/nexus/v1.0.0/catalogIcon-molgenis-nexus.svg similarity index 100% rename from charts/nexus/v1.0.0/catalogIcon-molgenis-nexus.svg rename to nexus/v1.0.0/catalogIcon-molgenis-nexus.svg diff --git a/charts/nexus/v1.0.0/templates/NOTES.txt b/nexus/v1.0.0/templates/NOTES.txt similarity index 100% rename from charts/nexus/v1.0.0/templates/NOTES.txt rename to nexus/v1.0.0/templates/NOTES.txt diff --git a/charts/nexus/v1.0.0/templates/_helpers.tpl b/nexus/v1.0.0/templates/_helpers.tpl similarity index 100% rename from charts/nexus/v1.0.0/templates/_helpers.tpl rename to nexus/v1.0.0/templates/_helpers.tpl diff --git a/charts/nexus/v1.0.0/templates/deployment.yaml b/nexus/v1.0.0/templates/deployment.yaml similarity index 100% rename from charts/nexus/v1.0.0/templates/deployment.yaml rename to nexus/v1.0.0/templates/deployment.yaml diff --git a/charts/nexus/v1.0.0/templates/ingress.yaml b/nexus/v1.0.0/templates/ingress.yaml similarity index 100% rename from charts/nexus/v1.0.0/templates/ingress.yaml rename to nexus/v1.0.0/templates/ingress.yaml diff --git a/charts/nexus/v1.0.0/templates/service.yaml b/nexus/v1.0.0/templates/service.yaml similarity index 100% rename from charts/nexus/v1.0.0/templates/service.yaml rename to nexus/v1.0.0/templates/service.yaml diff --git a/charts/nexus/v1.0.0/values.yaml b/nexus/v1.0.0/values.yaml similarity index 86% rename from charts/nexus/v1.0.0/values.yaml rename to nexus/v1.0.0/values.yaml index 3f139ac..b548f1d 100644 --- a/charts/nexus/v1.0.0/values.yaml +++ b/nexus/v1.0.0/values.yaml @@ -10,14 +10,8 @@ image: pullPolicy: IfNotPresent service: + name: nexus type: ClusterIP - ports: - - port: 8080 - protocol: TCP - name: {{ .Values.service.name }} - - port: 5000 - protocol: TCP - name: {{ .Values.service.name }} ingress: enabled: false