Skip to content

Commit

Permalink
helm integration
Browse files Browse the repository at this point in the history
  • Loading branch information
peterschubert committed Oct 18, 2017
1 parent cf93351 commit 8e01558
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 0 deletions.
8 changes: 8 additions & 0 deletions helm/splunk-event-reader-secret-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: splunk-event-reader
type: Opaque
data:
splunk.rest-api.user: {{splunk.rest-api.user}}
splunk.rest-api.password: {{splunk.rest-api.password}}
21 changes: 21 additions & 0 deletions helm/splunk-event-reader/.helmignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions helm/splunk-event-reader/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: splunk-event-reader Helm chart for Kubernetes
name: splunk-event-reader
version: 0.0.0 # this entry can be left untouched as it is automatically handled by Jenkins pipeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Values used for the deployed application.
replicaCount: 2
service:
name: splunk-event-reader
16 changes: 16 additions & 0 deletions helm/splunk-event-reader/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 24 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 24 | trimSuffix "-" -}}
{{- end -}}
58 changes: 58 additions & 0 deletions helm/splunk-event-reader/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Values.service.name }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
visualize: "true"
app: {{ .Values.service.name }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Values.service.name }}
template:
metadata:
labels:
app: {{ .Values.service.name }}
visualize: "true"
spec:
containers:
- name: {{ .Values.service.name }}
image: "{{ .Values.image.repository }}:{{ .Chart.Version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: APP_PORT
value: "{{ .Values.env.APP_PORT }}"
- name: ENVIRONMENT
valueFrom:
configMapKeyRef:
name: global-config
key: environment
- name: SPLUNK_USER
valueFrom:
secretKeyRef:
name: splunk-event-reader
key: splunk.rest-api.user
- name: SPLUNK_PASSWORD
valueFrom:
secretKeyRef:
name: splunk-event-reader
key: splunk.rest-api.password
- name: SPLUNK_URL
value: "{{ .Values.env.SPLUNK_URL }}"
ports:
- containerPort: 8080
livenessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 10
readinessProbe:
httpGet:
path: "/__gtg"
port: 8080
initialDelaySeconds: 15
periodSeconds: 30
resources:
{{ toYaml .Values.resources | indent 12 }}

15 changes: 15 additions & 0 deletions helm/splunk-event-reader/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: Service
apiVersion: v1
metadata:
name: {{.Values.service.name}}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
app: {{.Values.service.name}}
visualize: "true"
hasHealthcheck: "{{ .Values.service.hasHealthcheck }}"
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: {{ .Values.service.name }}
14 changes: 14 additions & 0 deletions helm/splunk-event-reader/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Default values for splunk-event-reader.
# This is a YAML-formatted file.
service:
name: "" # The name of the service, should be defined in the specific app-configs folder.
hasHealthcheck: "true"
replicaCount: 2
image:
repository: coco/splunk-event-reader
pullPolicy: IfNotPresent
env:
APP_PORT: "8080"
SPLUNK_URL: "https://financialtimes.splunkcloud.com:8089"


0 comments on commit 8e01558

Please sign in to comment.