Skip to content

Commit 7c50a99

Browse files
authored
Merge pull request #9
replace-haproxy-configurator
2 parents 3549b9b + 63d1ba6 commit 7c50a99

File tree

4 files changed

+167
-10
lines changed

4 files changed

+167
-10
lines changed

deploy/haproxy-ccm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
88
# Versions are expected to follow Semantic Versioning (https://semver.org/)
9-
version: 0.1.0
9+
version: 0.1.1
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application. Versions are not expected to

deploy/haproxy-ccm/README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# HAProxy Cloud Controller Manager Helm Chart
2+
3+
This Helm chart deploys the HAProxy Cloud Controller Manager (CCM) for Kubernetes.
4+
5+
## Configuration
6+
7+
### Basic Configuration
8+
9+
The chart supports configuration through the `values.yaml` file. Here are the key configuration options:
10+
11+
### Image Configuration
12+
13+
```yaml
14+
image:
15+
name: bearsan/haproxy-ccm
16+
tag: 0.1.0
17+
useImagePullSecret:
18+
enabled: false
19+
name: ""
20+
```
21+
22+
### Environment Variables
23+
24+
```yaml
25+
env:
26+
useExistsSecret:
27+
enabled: false
28+
secretRef:
29+
baseUrl:
30+
name: ""
31+
key: ""
32+
auth:
33+
name: ""
34+
key: ""
35+
baseUrl: ""
36+
auth: ""
37+
```
38+
39+
### Command Line Arguments
40+
41+
You can customize the command line arguments passed to the HAProxy CCM:
42+
43+
```yaml
44+
args:
45+
# Cloud provider specific arguments
46+
cloudProvider: "haproxy"
47+
48+
# Additional custom arguments (list format)
49+
additional: []
50+
```
51+
52+
## Usage Examples
53+
54+
### Basic Deployment
55+
56+
```bash
57+
helm install haproxy-ccm ./deploy/haproxy-ccm \
58+
--set env.baseUrl="http://haproxy:5555" \
59+
--set env.auth="admin:password"
60+
```
61+
62+
### Deployment with Additional Arguments
63+
64+
```yaml
65+
# custom-values.yaml
66+
env:
67+
baseUrl: "grpc://haproxy-manager:50051"
68+
69+
args:
70+
additional:
71+
- "--log-level=debug"
72+
- "--bind-address=0.0.0.0"
73+
- "--port=10258"
74+
- "--haproxy-endpoint=grpc://haproxy-manager:50051"
75+
```
76+
77+
```bash
78+
helm install haproxy-ccm ./deploy/haproxy-ccm -f custom-values.yaml
79+
```
80+
81+
### Using Existing Secrets
82+
83+
```yaml
84+
# secret-values.yaml
85+
env:
86+
useExistsSecret:
87+
enabled: true
88+
secretRef:
89+
baseUrl:
90+
name: "haproxy-config"
91+
key: "endpoint"
92+
auth:
93+
name: "haproxy-config"
94+
key: "auth"
95+
96+
args:
97+
additional:
98+
- "--v=4"
99+
- "--leader-elect=true"
100+
```
101+
102+
```bash
103+
helm install haproxy-ccm ./deploy/haproxy-ccm -f secret-values.yaml
104+
```
105+
106+
## Common Additional Arguments
107+
108+
Here are some commonly used additional arguments:
109+
110+
- `--log-level=debug`: Set log level to debug
111+
- `--bind-address=0.0.0.0`: Bind address for the CCM server
112+
- `--port=10258`: Port for the CCM server
113+
- `--haproxy-endpoint=<endpoint>`: Override HAProxy endpoint (alternative to env var)
114+
- `--v=4`: Set verbosity level
115+
- `--leader-elect=true`: Enable leader election for HA deployments
116+
- `--cloud-config=<path>`: Path to cloud configuration file
117+
- `--allocate-node-cidrs=false`: Disable node CIDR allocation
118+
- `--configure-cloud-routes=false`: Disable cloud route configuration
119+
120+
## Installation
121+
122+
1. Clone the repository
123+
2. Configure your `values.yaml` or use `--set` flags
124+
3. Install the chart:
125+
126+
```bash
127+
helm install haproxy-ccm ./deploy/haproxy-ccm
128+
```
129+
130+
## Upgrading
131+
132+
```bash
133+
helm upgrade haproxy-ccm ./deploy/haproxy-ccm
134+
```
135+
136+
## Uninstallation
137+
138+
```bash
139+
helm uninstall haproxy-ccm
140+
```

deploy/haproxy-ccm/templates/deployments.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,30 @@ spec:
1717
image: {{ .Values.image.name }}:{{ .Values.image.tag }}
1818
env:
1919
- name: HAPROXY_ENDPOINT
20-
{{ if .Values.env.useExistsSecret.enabled }}
20+
{{- if .Values.env.useExistsSecret.enabled }}
2121
valueFrom:
2222
secretKeyRef:
2323
name: {{ .Values.env.useExistsSecret.secretRef.baseUrl.name }}
2424
key: {{ .Values.env.useExistsSecret.secretRef.baseUrl.key }}
25-
{{ else }}
26-
value: {{ .Values.env.baseUrl }}
27-
{{ end }}
25+
{{- else }}
26+
value: {{ .Values.env.baseUrl | quote }}
27+
{{- end }}
28+
{{- if or .Values.env.useExistsSecret.enabled .Values.env.auth }}
2829
- name: HAPROXY_AUTH
29-
{{ if .Values.env.useExistsSecret.enabled }}
30+
{{- if .Values.env.useExistsSecret.enabled }}
3031
valueFrom:
3132
secretKeyRef:
3233
name: {{ .Values.env.useExistsSecret.secretRef.auth.name }}
3334
key: {{ .Values.env.useExistsSecret.secretRef.auth.key }}
34-
{{ else }}
35-
value: {{ .Values.env.auth }}
36-
{{ end }}
35+
{{- else }}
36+
value: {{ .Values.env.auth | quote }}
37+
{{- end }}
38+
{{- end }}
3739
args:
38-
- --cloud-provider=haproxy
40+
- --cloud-provider={{ .Values.args.cloudProvider }}
41+
{{- range .Values.args.additional }}
42+
- {{ . }}
43+
{{- end }}
3944
serviceAccountName: haproxy-ccm
4045
{{ if .Values.image.useImagePullSecret.enabled }}
4146
imagePullSecrets:

deploy/haproxy-ccm/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@ env:
1616
key: ""
1717
baseUrl: ""
1818
auth: ""
19+
20+
# Additional command line arguments for haproxy-ccm
21+
args:
22+
# Cloud provider specific arguments
23+
cloudProvider: "haproxy"
24+
25+
# Additional custom arguments (list format)
26+
# Example:
27+
# - "--log-level=debug"
28+
# - "--bind-address=0.0.0.0"
29+
# - "--port=10258"
30+
additional: []

0 commit comments

Comments
 (0)