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

services: Add custom labels for to-client mode case. #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ clients:
port: 6444
endpoint: services:443
servicePort: 443
labels:
company/blackbox_monitoring: true
- user: sample2
password: sample2se"e'$acret
services:
Expand Down Expand Up @@ -250,6 +252,7 @@ For each service name / key an array of services can be defined. Each service de
| `servicePort` | The port this service should be exposed on the service object. Defaults to `port` if omitted. |
| `endpoint` | The destination to which chisel forwards this service. **required** |
| `name` | Custom name of this service within the service |
| `labels` | Custom labels for to-client services. Optional for selecting services (e.g monitoring). |
| `serviceType` | Only valid on first entry: Sets `type` for the kubernetes service definition. Defaults to `ClusterIP` |
| `clusterIP` | Only valid on first entry: Sets `clusterIP` on the kubernetes service definition when `type=LoadBalancer` |
| `loadBalancerIP` | Only valid on first entry: Sets `loadBalancerIP` on the kubernetes service definition when `type=LoadBalancer` |
Expand Down
7 changes: 7 additions & 0 deletions chisel/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ metadata:
name: {{ $opdata.serviceObjName }}
labels:
{{- $chiselLabels }}
{{- range $ports }}
{{- if .labels }}
{{- range $key, $value := .labels }}
{{ printf "%s: %v" $key $value }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- with (first $ports) }}{{- /* service settings are taken from first port entry */ -}}
{{- $type := default "ClusterIP" .serviceType }}
Expand Down
1 change: 1 addition & 0 deletions chisel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ service:
port: 80

ingress:
host: example.domain.com
enabled: true
nginxRewrite: false
annotations: {}
Expand Down