Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm chart to deploy to all nodes as DaemonSet (privileged container) #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.3
MAINTAINER Hortonworks
FROM alpine:3.11
MAINTAINER webmaster@highskillz.com

RUN apk add --no-cache haveged
RUN apk add --update --no-cache haveged=1.9.8-r0
ENTRYPOINT ["haveged"]
CMD ["-F"]
22 changes: 22 additions & 0 deletions helm-chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# 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
14 changes: 14 additions & 0 deletions helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
name: haveged
home: http://issihosts.com/haveged/
version: 1.2.1
appVersion: "1.9.8-r0"
description: Deploy havegd to all nodes via DaemonSet to prevent low-entropy situations
keywords:
- haveged
- entropy
sources:
- https://github.com/hsz-devops/docker-haveged
maintainers:
- name: joaocc
url: http://github.com/hsz-devops/docker-haveged
13 changes: 13 additions & 0 deletions helm-chart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This chart deploys hortonworks/haveged as privileged container to all nodes via DaemonSet

Deploys to kube-system namespace

To deploy, use
helm install --name haveged . --kube-context CLUSTER_CTXT

Changelog:
1.2.1 2020-02-11 github/joaocc
1.0.0 2018-03-04 github/joaocc

helm del --purge haveged --kube-context zzzzz
helm upgrade --install --debug haveged . --kube-context zzzzz
32 changes: 32 additions & 0 deletions helm-chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "haveged.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 "haveged.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 "haveged.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
35 changes: 35 additions & 0 deletions helm-chart/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "haveged.fullname" . }}
namespace: kube-system
labels:
app: {{ template "haveged.name" . }}
# chart: {{ template "haveged.chart" . }}
# release: {{ .Release.Name }}
# # heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
daemonset: {{ template "haveged.name" . }}
template:
metadata:
labels:
daemonset: {{ template "haveged.name" . }}
# app: {{ template "haveged.name" . }}
# chart: {{ template "haveged.chart" . }}
# release: {{ .Release.Name }}
# # heritage: {{ .Release.Service }}
spec:
# selector:
# matchLabels:
# app: {{ template "haveged.name" . }}
# # chart: {{ template "haveged.chart" . }}
# # release: {{ .Release.Name }}
# # heritage: {{ .Release.Service }}
containers:
- name: {{ template "haveged.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
privileged: true
28 changes: 28 additions & 0 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Default values for haveged.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: ez123/haveged
tag: "1.9"
pullPolicy: Always

# 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: {}