Skip to content

Commit

Permalink
Merge pull request #15 from progress/kiranb-main
Browse files Browse the repository at this point in the history
Add LBDeployment Projects
  • Loading branch information
kiranbabuneela authored Apr 16, 2024
2 parents ef0d8a9 + 5dfdae2 commit 44b0094
Show file tree
Hide file tree
Showing 25 changed files with 797 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
strategy:
matrix:
project:
- './charts/BasicDeployment'
- './charts/BasicDeployment'
- './charts/LBDeployment'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hdp-kubernetes</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
23 changes: 23 additions & 0 deletions charts/LBDeployment/haproxy-deploy/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
28 changes: 28 additions & 0 deletions charts/LBDeployment/haproxy-deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: v2
name: haproxy-deploy
description: A Helm chart for Kubernetes that deploys 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.0.1

# 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: "1.11.0"
dependencies:
- name: kubernetes-ingress
version: "^1.38.2"
repository: https://haproxytech.github.io/helm-charts/
43 changes: 43 additions & 0 deletions charts/LBDeployment/haproxy-deploy/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
========
Overview
========

This HELM project wraps Haproxy Ingress Controller helm chart as a dependency, when installed - this will setup a HAProxy Ingress Controller with two pods and a service.

To build this project, run -
helm dep up hdp-lb-server-deploy

This will download the chart to /charts directory.

The .values.yaml has the basic configuration needed for the HAProxy Ingress Controller HELM project setup. Based on the need, values can be finetuned further.

Refer to this wiki page for more details - https://progresssoftware.atlassian.net/wiki/spaces/DataDirectRandD/pages/541753550/Deploying+HDP+Server+on+Azure+Kubernetes+Service+AKS

================
Steps to Install
================

helm install haproxy-deploy haproxy-deploy --namespace haproxy-controller -create-namespace -f values.yaml

This would install necessary resources, to get the external IP for the HAProxy Controller Service,
run the command kubectl get svc and check the External - IP column.

'A' record should be mapped to this IP address for the valid dns hostname in a valid dns zone.

As an example, this is the default dns zone offerred by Azure AKS accessible over public internet.
To access HDP would be something like - http://hdp.2565fbe255034c49a07b.eastus.aksapp.io/

================
Useful Commands
================

helm install haproxy-deploy haproxy-deploy --namespace haproxy-controller --create-namespace -f values.yaml

helm list --namespace haproxy-controller

kubectl get svc --namespace haproxy-controller

kubectl get pods --namespace haproxy-controller

helm uninstall haproxy-deploy --namespace haproxy-controller

Empty file.
62 changes: 62 additions & 0 deletions charts/LBDeployment/haproxy-deploy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "haproxy-deploy.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 "haproxy-deploy.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 "haproxy-deploy.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "haproxy-deploy.labels" -}}
helm.sh/chart: {{ include "haproxy-deploy.chart" . }}
{{ include "haproxy-deploy.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "haproxy-deploy.selectorLabels" -}}
app.kubernetes.io/name: {{ include "haproxy-deploy.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "haproxy-deploy.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "haproxy-deploy.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/LBDeployment/haproxy-deploy/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kubernetes-ingress:
controller:
ingressClass: "haproxy"
service:
type: "LoadBalancer"
externalTrafficPolicy: Local
annotations:
service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path: "/healthz"
23 changes: 23 additions & 0 deletions charts/LBDeployment/hdp-lb-server-deploy/.helmignore
Original file line number Diff line number Diff line change
@@ -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/
29 changes: 29 additions & 0 deletions charts/LBDeployment/hdp-lb-server-deploy/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v2
name: hdp-lb-server-deploy
description: A Helm chart for Kubernetes

# 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: "4.6.1"
dependencies:
- name: postgresql
version: "^13.2.30"
repository: https://charts.bitnami.com/bitnami
condition: postgres.enabled
41 changes: 41 additions & 0 deletions charts/LBDeployment/hdp-lb-server-deploy/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
========
Overview
========

This HELM project wraps PostgreSQL helm chart as a dependency, when installed - this will setup a PostgreSQL database.

To build this project, run -
helm dep up hdp-lb-server-deploy

This will download the chart to /charts

The .values.yaml has the defaults for the HAProxy HELM project setup. Based on the need, values can be finetuned.

Note: This project does not configure the Ingress Controller to run over SSL yet.

================
Steps to Install
================

helm install hdp-lb-server-deploy hdp-lb-server-deploy --namespace hdp-deployment -create-namespace -f values.yaml

This would install necessary resources.

================
Useful Commands
================

helm install hdp-lb-server-deploy hdp-lb-server-deploy --namespace hdp-deployment --create-namespace -f values.yaml

helm list --namespace hdp-deployment

kubectl get svc --namespace hdp-deployment

kubectl get pods --namespace hdp-deployment

kubectl logs hdp-0 --namespace hdp-deployment

kubectl exec -it hdp-0 --namespace hdp-deployment -- bash

helm uninstall hdp-lb-server-deploy --namespace hdp-deployment

Loading

0 comments on commit 44b0094

Please sign in to comment.