Skip to content

Commit 4ba0d13

Browse files
committed
Add option to conditionally create Service resource
- Add new parameter `service.create` (default: false) to control Service creation - Wrap Service template in conditional to respect the new parameter - Update documentation and default values to reflect this change This allows users who don't need the Service resource (e.g., when using Ingress directly or external service management) to skip its creation.
1 parent cb49b7f commit 4ba0d13

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ their default values.
4747
| `serviceAccount.name` | ServiceAccount name | `nil` |
4848
| `serviceAccount.annotations` | Annotations to add to the ServiceAccount | `{}` |
4949
| `deployment.annotations` | Annotations to add to the Deployment | `{}` |
50+
| `service.create` | Create Service | `false` |
5051
| `service.port` | TCP port on which the service is exposed | `5000` |
5152
| `service.type` | service type | `ClusterIP` |
5253
| `service.clusterIP` | if `service.type` is `ClusterIP` and this is non-empty, sets the cluster IP of the service | `nil` |

templates/service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.service.create -}}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -50,3 +51,4 @@ spec:
5051
selector:
5152
app: {{ template "docker-registry.name" . }}
5253
release: {{ .Release.Name }}
54+
{{- end -}}

values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ image:
2626
deployment: {}
2727
# annotations:
2828
service:
29+
create: false
2930
name: registry
3031
type: ClusterIP
3132
# sessionAffinity: None

0 commit comments

Comments
 (0)