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

Add Rabbitmq external chart #3594

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/rabbitmq-external/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: Refer to rabbitmq IPs located outside kubernetes by specifying IPs manually
name: rabbitmq-external
version: 0.0.42
38 changes: 38 additions & 0 deletions charts/rabbitmq-external/templates/endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# create a headless clusterIP service to create dns name "rabbitmq-external"
# and a custom endpoint, thus forwarding traffic when resolving DNS to custom IPs
kind: Service
apiVersion: v1
metadata:
name: {{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
chart: {{ template "rabbitmq-external.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: ClusterIP
clusterIP: None # headless service
ports:
- name: http
port: {{ .Values.portHttp }}
targetPort: {{ .Values.portHttp }}
---
kind: Endpoints
apiVersion: v1
metadata:
name: {{ .Chart.Name }}
labels:
app: {{ .Chart.Name }}
chart: {{ template "rabbitmq-external.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
subsets:
- addresses:
{{- range .Values.IPs }}
- ip: {{ . }}
{{- end }}
ports:
# port and name in the endpoint must match port and name in the service
# see also https://docs.openshift.com/enterprise/3.0/dev_guide/integrating_external_services.html
- name: http
port: {{ .Values.portHttp }}
11 changes: 11 additions & 0 deletions charts/rabbitmq-external/templates/helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- define "rabbitmq-external.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "rabbitmq-external.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/rabbitmq-external/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
portHttp: 5672

## Configure this helm chart with:
# IPs:
# - 1.2.3.4
# - 5.6.7.8