Add helm package
This commit is contained in:
parent
e8aa05512a
commit
899e6e8d23
9 changed files with 415 additions and 54 deletions
|
|
@ -1,21 +1,27 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: easyhaproxy
|
||||
|
||||
---
|
||||
# Source: easyhaproxy-ingress/templates/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: easyhaproxy-ingress
|
||||
namespace: easyhaproxy
|
||||
|
||||
name: manual-easyhaproxy-ingress
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-ingress-0.1.0
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
app.kubernetes.io/version: "test"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
---
|
||||
# Source: easyhaproxy-ingress/templates/clusterrole.yaml
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: easyhaproxy-ingress
|
||||
name: manual-easyhaproxy-ingress
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-ingress-0.1.0
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
app.kubernetes.io/version: "test"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
|
|
@ -69,36 +75,47 @@ rules:
|
|||
# - get
|
||||
# - list
|
||||
# - watch
|
||||
|
||||
---
|
||||
# Source: easyhaproxy-ingress/templates/clusterrolebinding.yaml
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: easyhaproxy-ingress
|
||||
namespace: easyhaproxy
|
||||
name: manual-easyhaproxy-ingress
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-ingress-0.1.0
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
app.kubernetes.io/version: "test"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: easyhaproxy-ingress
|
||||
name: manual-easyhaproxy-ingress
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: easyhaproxy-ingress
|
||||
namespace: easyhaproxy
|
||||
|
||||
name: manual-easyhaproxy-ingress
|
||||
---
|
||||
# Source: easyhaproxy-ingress/templates/deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: easyhaproxy-ingress
|
||||
namespace: easyhaproxy
|
||||
name: manual-easyhaproxy-ingress
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-ingress-0.1.0
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
app.kubernetes.io/version: "test"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: easyhaproxy-ingress
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: easyhaproxy-ingress
|
||||
app.kubernetes.io/name: easyhaproxy-ingress
|
||||
app.kubernetes.io/instance: manual
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
|
|
@ -109,11 +126,15 @@ spec:
|
|||
operator: In
|
||||
values:
|
||||
- master
|
||||
serviceAccountName: easyhaproxy-ingress
|
||||
serviceAccountName: manual-easyhaproxy-ingress
|
||||
securityContext:
|
||||
{}
|
||||
containers:
|
||||
- image: byjg/easy-haproxy:test
|
||||
- name: easyhaproxy-ingress
|
||||
securityContext:
|
||||
{}
|
||||
image: "byjg/easy-haproxy:test"
|
||||
imagePullPolicy: Always
|
||||
name: easyhaproxy-ingress
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
|
|
@ -125,10 +146,7 @@ spec:
|
|||
containerPort: 1936
|
||||
hostPort: 1936
|
||||
resources:
|
||||
requests:
|
||||
cpu: "100m"
|
||||
memory: "128Mi"
|
||||
|
||||
{}
|
||||
env:
|
||||
- name: EASYHAPROXY_DISCOVER
|
||||
value: kubernetes
|
||||
|
|
@ -142,3 +160,9 @@ spec:
|
|||
value: "true"
|
||||
- name: EASYHAPROXY_SSL_MODE
|
||||
value: loose
|
||||
- name: EASYHAPROXY_LOG_LEVEL
|
||||
value: DEBUG
|
||||
- name: HAPROXY_LOG_LEVEL
|
||||
value: DEBUG
|
||||
- name: CERTBOT_LOG_LEVEL
|
||||
value: DEBUG
|
||||
23
helm/easyhaproxy-ingress/.helmignore
Normal file
23
helm/easyhaproxy-ingress/.helmignore
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# 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
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
24
helm/easyhaproxy-ingress/Chart.yaml
Normal file
24
helm/easyhaproxy-ingress/Chart.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
apiVersion: v2
|
||||
name: easyhaproxy-ingress
|
||||
description: "EasyHAProxy - A service discovery backed on HAProxy"
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "test"
|
||||
62
helm/easyhaproxy-ingress/templates/_helpers.tpl
Normal file
62
helm/easyhaproxy-ingress/templates/_helpers.tpl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "easyhaproxy-ingress.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 "easyhaproxy-ingress.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 "easyhaproxy-ingress.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "easyhaproxy-ingress.labels" -}}
|
||||
helm.sh/chart: {{ include "easyhaproxy-ingress.chart" . }}
|
||||
{{ include "easyhaproxy-ingress.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "easyhaproxy-ingress.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "easyhaproxy-ingress.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "easyhaproxy-ingress.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "easyhaproxy-ingress.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
66
helm/easyhaproxy-ingress/templates/clusterrole.yaml
Normal file
66
helm/easyhaproxy-ingress/templates/clusterrole.yaml
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
---
|
||||
kind: ClusterRole
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "easyhaproxy-ingress.fullname" . }}
|
||||
labels:
|
||||
{{- include "easyhaproxy-ingress.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
# - configmaps
|
||||
# - endpoints
|
||||
# - nodes
|
||||
- pods
|
||||
- services
|
||||
- namespaces
|
||||
# - events
|
||||
- serviceaccounts
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "extensions"
|
||||
- "networking.k8s.io"
|
||||
resources:
|
||||
- ingresses
|
||||
# - ingresses/status
|
||||
# - ingressclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
# - apiGroups:
|
||||
# - "extensions"
|
||||
# - "networking.k8s.io"
|
||||
# resources:
|
||||
# - ingresses/status
|
||||
# verbs:
|
||||
# - update
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
# - watch
|
||||
# - create
|
||||
# - patch
|
||||
# - update
|
||||
# - apiGroups:
|
||||
# - "discovery.k8s.io"
|
||||
# resources:
|
||||
# - endpointslices
|
||||
# verbs:
|
||||
# - get
|
||||
# - list
|
||||
# - watch
|
||||
{{- end }}
|
||||
20
helm/easyhaproxy-ingress/templates/clusterrolebinding.yaml
Normal file
20
helm/easyhaproxy-ingress/templates/clusterrolebinding.yaml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
---
|
||||
kind: ClusterRoleBinding
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "easyhaproxy-ingress.fullname" . }}
|
||||
labels:
|
||||
{{- include "easyhaproxy-ingress.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "easyhaproxy-ingress.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "easyhaproxy-ingress.serviceAccountName" . }}
|
||||
{{- end }}
|
||||
65
helm/easyhaproxy-ingress/templates/deployment.yaml
Normal file
65
helm/easyhaproxy-ingress/templates/deployment.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ include "easyhaproxy-ingress.fullname" . }}
|
||||
labels:
|
||||
{{- include "easyhaproxy-ingress.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "easyhaproxy-ingress.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "easyhaproxy-ingress.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: {{ .Values.masterNode.label }}
|
||||
operator: In
|
||||
values:
|
||||
{{- toYaml .Values.masterNode.values | nindent 18 }}
|
||||
serviceAccountName: {{ include "easyhaproxy-ingress.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 80
|
||||
hostPort: 80
|
||||
- name: https
|
||||
containerPort: 443
|
||||
hostPort: 443
|
||||
- name: stats
|
||||
containerPort: 1936
|
||||
hostPort: 1936
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
env:
|
||||
- name: EASYHAPROXY_DISCOVER
|
||||
value: kubernetes
|
||||
- name: HAPROXY_USERNAME
|
||||
value: {{ .Values.easyhaproxy.stats.username }}
|
||||
- name: HAPROXY_PASSWORD
|
||||
value: {{ .Values.easyhaproxy.stats.password }}
|
||||
- name: EASYHAPROXY_REFRESH_CONF
|
||||
value: {{ .Values.easyhaproxy.refresh | quote }}
|
||||
- name: HAPROXY_CUSTOMERRORS
|
||||
value: {{ .Values.easyhaproxy.customErrors | quote}}
|
||||
- name: EASYHAPROXY_SSL_MODE
|
||||
value: {{ .Values.easyhaproxy.sslMode }}
|
||||
- name: EASYHAPROXY_LOG_LEVEL
|
||||
value: {{ .Values.easyhaproxy.logLevel.easyhaproxy }}
|
||||
- name: HAPROXY_LOG_LEVEL
|
||||
value: {{ .Values.easyhaproxy.logLevel.haproxy }}
|
||||
- name: CERTBOT_LOG_LEVEL
|
||||
value: {{ .Values.easyhaproxy.logLevel.certbot }}
|
||||
12
helm/easyhaproxy-ingress/templates/serviceaccount.yaml
Normal file
12
helm/easyhaproxy-ingress/templates/serviceaccount.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "easyhaproxy-ingress.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "easyhaproxy-ingress.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
65
helm/easyhaproxy-ingress/values.yaml
Normal file
65
helm/easyhaproxy-ingress/values.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Default values for easyhaproxy-ingress.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: byjg/easy-haproxy
|
||||
pullPolicy: Always # IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
create: true
|
||||
annotations: {}
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
resources: {}
|
||||
# requests:
|
||||
# cpu: "100m"
|
||||
# memory: "128Mi"
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
easyhaproxy:
|
||||
stats:
|
||||
username: admin
|
||||
password: password
|
||||
refresh: "10"
|
||||
customErrors: "true"
|
||||
sslMode: loose
|
||||
logLevel:
|
||||
certbot: DEBUG
|
||||
easyhaproxy: DEBUG
|
||||
haproxy: DEBUG
|
||||
|
||||
# Make sure to create this
|
||||
masterNode:
|
||||
label: easyhaproxy/node
|
||||
values:
|
||||
- master
|
||||
Loading…
Add table
Add a link
Reference in a new issue