Skip to content

Commit

Permalink
Merge pull request #69 from yhayoz/master
Browse files Browse the repository at this point in the history
[common]: Add Service Type Loadbalancer
  • Loading branch information
yhayoz authored Feb 9, 2023
2 parents 7669508 + da0d588 commit 17b0ee1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/common/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: common
description: "Bedag's common Helm chart to use for creating other Helm charts"
version: 8.0.0
version: 8.1.0
# 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
Expand All @@ -27,4 +27,4 @@ annotations:
artifacthub.io/prerelease: "false"
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
- "[Removed]: logPersistence"
- "[added]: Service Type LoadBalancer"
2 changes: 1 addition & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![Version: 8.0.0](https://img.shields.io/badge/Version-8.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 8.1.0](https://img.shields.io/badge/Version-8.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Bedag's common Helm chart to use for creating other Helm charts

Expand Down
5 changes: 5 additions & 0 deletions charts/common/ci/values.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ components:
services:
service-1:
deploy: true
type: LoadBalancer
loadBalancerIP: 10.0.0.0
loadBalancerClass: test
loadBalancerSourceRanges:
- 10.0.0.0/8
# end common.service
# start common.networkpolicy
networkpolicy:
Expand Down
14 changes: 14 additions & 0 deletions charts/common/templates/_service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ metadata:
app.kubernetes.io/component: {{ $componentname }}
spec:
type: {{ $service.type | default "ClusterIP" }}
{{- if eq $service.type "LoadBalancer" }}
{{- if $service.loadBalancerIP }}
loadBalancerIP: {{ $service.loadBalancerIP }}
{{- end }}
{{- if $service.loadBalancerClass }}
loadBalancerClass: {{ $service.loadBalancerClass }}
{{- end }}
{{- if $service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- with $service.loadBalancerSourceRanges }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
ports:
- name: {{ $service.name | default "http" }}
port: {{ $service.port | default "80" }}
Expand Down
7 changes: 7 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ components:
deploy: false
# type is optional with a default value of "ClusterIP"
#type:
# loadBalancerIP is required if type is "LoadBalancer"
#loadBalancerIP: 10.0.0.0
# loadBalancerClass is optional with no default value
#loadBalancerClass: test
# loadBalancerSourceRanges is an optional List with no default value
#loadBalancerSourceRanges:
# - 10.0.0.0/8
# name is optional with a default value of "http"
#name:
# port is optional with a default value of "80"
Expand Down

0 comments on commit 17b0ee1

Please sign in to comment.