Fábio Kaiser Rauber
5 years ago
9 changed files with 264 additions and 0 deletions
@ -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/ |
@ -0,0 +1,25 @@ |
|||||
|
apiVersion: v2 |
||||
|
name: keepalived |
||||
|
description: Highly available IP addresses with VRRP |
||||
|
|
||||
|
# 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.3.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. |
||||
|
appVersion: 2.2.0 |
||||
|
|
||||
|
icon: https://beopen.bplaced.net/wp-content/uploads/2016/11/Keepalived-logo.png |
@ -0,0 +1,16 @@ |
|||||
|
# Keepalived Helm Chart |
||||
|
|
||||
|
This helm chart provides Keepalived as a DaemonSet for hosts with a specific nodeSelector (default role=ingress). |
||||
|
|
||||
|
## Parameters and Default Values |
||||
|
|
||||
|
| Parameter | Description | Default | |
||||
|
| ---------------------------- | ------------------------------------------ | --------------------- | |
||||
|
| keepalived.auth_pass | Keepalived authentication Password | `agoodpwd` | |
||||
|
| keepalived.check_port | Port the service should be listening on | `443 | |
||||
|
| keepalived.check_script | Custom script for service healthcheckabled | `ss -ltn | grep :443` | |
||||
|
| keepalived.interface | Interface for keepalived heartbeats | `eth0` | |
||||
|
| keepalived.virtual_ip | IP Address for your HA service | `192.168.1.1 ` | |
||||
|
| keepalived.virtual_mask | Network Mask for the HA IP Address | `24` | |
||||
|
| keepalived.vrid | VRRP Virtual Router ID (0-255) | `124` | |
||||
|
| nodeSelector | Used to select the nodes for the daemonset | `role: ingress` | |
@ -0,0 +1,3 @@ |
|||||
|
# Keepalived Rancher chart |
||||
|
|
||||
|
Use the form below to configure your Keepalived instance. |
@ -0,0 +1,41 @@ |
|||||
|
labels: |
||||
|
io.cattle.role: project |
||||
|
categories: |
||||
|
- High Availibility |
||||
|
questions: |
||||
|
- variable: keepalived.virtual_ip |
||||
|
default: "192.168.1.1" |
||||
|
description: "VRRP Virtual IP Address" |
||||
|
label: Virtual IP |
||||
|
type: string |
||||
|
- variable: keepalived.virtual_mask |
||||
|
default: 24 |
||||
|
description: "VRRP Virtual IP Network Mask" |
||||
|
label: Network Mask |
||||
|
type: int |
||||
|
- variable: keepalived.vrid |
||||
|
default: 1 |
||||
|
description: "VRRP Virtual Router ID" |
||||
|
label: Router ID |
||||
|
type: int |
||||
|
- variable: keepalived.interface |
||||
|
default: "eth0" |
||||
|
description: "Network Interface for VRRP Packets" |
||||
|
label: Network Interface |
||||
|
type: string |
||||
|
- variable: keepalived.auth_pass |
||||
|
default: "agoodpwd" |
||||
|
description: "VRRP Authentication Password" |
||||
|
label: Auth Password |
||||
|
type: password |
||||
|
- variable: keepalived.check_port |
||||
|
default: "443" |
||||
|
description: "Service Healthcheck Port" |
||||
|
label: Check Port |
||||
|
type: int |
||||
|
- variable: keepalived.check_script |
||||
|
default: "ss -ltn | grep :443" |
||||
|
description: "Service Healthcheck Script" |
||||
|
label: Check Script |
||||
|
type: string |
||||
|
|
@ -0,0 +1 @@ |
|||||
|
Do not forget to create labels on your keepalived hosts! The default is "role: ingress" |
@ -0,0 +1,63 @@ |
|||||
|
{{/* vim: set filetype=mustache: */}} |
||||
|
{{/* |
||||
|
Expand the name of the chart. |
||||
|
*/}} |
||||
|
{{- define "keepalived.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 "keepalived.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 "keepalived.chart" -}} |
||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Common labels |
||||
|
*/}} |
||||
|
{{- define "keepalived.labels" -}} |
||||
|
helm.sh/chart: {{ include "keepalived.chart" . }} |
||||
|
{{ include "keepalived.selectorLabels" . }} |
||||
|
{{- if .Chart.AppVersion }} |
||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
||||
|
{{- end }} |
||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Selector labels |
||||
|
*/}} |
||||
|
{{- define "keepalived.selectorLabels" -}} |
||||
|
app.kubernetes.io/name: {{ include "keepalived.name" . }} |
||||
|
app.kubernetes.io/instance: {{ .Release.Name }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Create the name of the service account to use |
||||
|
*/}} |
||||
|
{{- define "keepalived.serviceAccountName" -}} |
||||
|
{{- if .Values.serviceAccount.create }} |
||||
|
{{- default (include "keepalived.fullname" .) .Values.serviceAccount.name }} |
||||
|
{{- else }} |
||||
|
{{- default "default" .Values.serviceAccount.name }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
@ -0,0 +1,60 @@ |
|||||
|
apiVersion: apps/v1 |
||||
|
kind: DaemonSet |
||||
|
metadata: |
||||
|
name: {{ include "keepalived.fullname" . }} |
||||
|
labels: |
||||
|
{{- include "keepalived.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
{{- include "keepalived.selectorLabels" . | nindent 6 }} |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
{{- include "keepalived.selectorLabels" . | nindent 8 }} |
||||
|
spec: |
||||
|
{{- with .Values.imagePullSecrets }} |
||||
|
imagePullSecrets: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
containers: |
||||
|
- name: {{ .Chart.Name }} |
||||
|
env: |
||||
|
- name: AUTH_PASS |
||||
|
value: "{{ .Values.keepalived.auth_pass }}" |
||||
|
- name: CHECK_PORT |
||||
|
value: "{{ .Values.keepalived.check_port }}" |
||||
|
- name: CHECK_SCRIPT |
||||
|
value: "{{ .Values.keepalived.check_script }}" |
||||
|
- name: INTERFACE |
||||
|
value: "{{ .Values.keepalived.interface }}" |
||||
|
- name: VIRTUAL_IP |
||||
|
value: "{{ .Values.keepalived.virtual_ip }}" |
||||
|
- name: VIRTUAL_MASK |
||||
|
value: "{{ .Values.keepalived.virtual_mask }}" |
||||
|
- name: VRID |
||||
|
value: "{{ .Values.keepalived.vrid }}" |
||||
|
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" |
||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }} |
||||
|
securityContext: |
||||
|
capabilities: |
||||
|
add: |
||||
|
- NET_ADMIN |
||||
|
- NET_BROADCAST |
||||
|
stdin: true |
||||
|
tty: true |
||||
|
resources: |
||||
|
{{- toYaml .Values.resources | nindent 12 }} |
||||
|
{{- with .Values.nodeSelector }} |
||||
|
nodeSelector: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.affinity }} |
||||
|
affinity: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.tolerations }} |
||||
|
tolerations: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
restartPolicy: Always |
@ -0,0 +1,32 @@ |
|||||
|
# Default values for keepalived. |
||||
|
# This is a YAML-formatted file. |
||||
|
# Declare variables to be passed into your templates. |
||||
|
image: |
||||
|
repository: interlegis/keepalived |
||||
|
pullPolicy: IfNotPresent |
||||
|
|
||||
|
keepalived: |
||||
|
auth_pass: agoodpwd |
||||
|
check_port: 443 |
||||
|
check_script: ss -ltn | grep :443 |
||||
|
interface: eth0 |
||||
|
virtual_ip: 192.168.1.1 |
||||
|
virtual_mask: 24 |
||||
|
vrid: 124 |
||||
|
|
||||
|
nodeSelector: |
||||
|
role: ingress |
||||
|
|
||||
|
tolerations: [] |
||||
|
|
||||
|
affinity: {} |
||||
|
|
||||
|
imagePullSecrets: [] |
||||
|
|
||||
|
resources: |
||||
|
limits: |
||||
|
cpu: 300m |
||||
|
memory: 25Mi |
||||
|
requests: |
||||
|
cpu: 100m |
||||
|
memory: 10Mi |
Loading…
Reference in new issue