Skip to content

Commit

Permalink
Add service resource for the controller manager (kubernetes-retired#2431
Browse files Browse the repository at this point in the history
)

* Add service resource for the controller manager

Signed-off-by: Sébastien Prud'homme <[email protected]>

* Use ClusterIP for controller manager Service type

Signed-off-by: Sébastien Prud'homme <[email protected]>
  • Loading branch information
sebastien-prudhomme authored and yangweiwei committed May 10, 2019
1 parent 6de9ba7 commit e7e70a1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ chart and their default values.
| `controllerManager.serviceAccount` | Service account | `service-catalog-controller-manager` |
| `controllerManager.apiserverSkipVerify` | Controls whether the API server's TLS verification should be skipped | `true` |
| `controllerManager.enablePrometheusScrape` | Whether the controller will expose metrics on /metrics | `false` |
| `controllerManager.service.type` | Type of service; valid values are `LoadBalancer` , `NodePort` and `ClusterIP` | `ClusterIP` |
| `controllerManager.service.nodePort.securePort` | If service type is `NodePort`, specifies a port in allowable range (e.g. 30000 - 32767 on minikube); The TLS-enabled endpoint will be exposed here | `30444` |
| `controllerManager.service.clusterIP` | If service type is ClusterIP, specify clusterIP as `None` for `headless services` OR specify your own specific IP OR leave blank to let Kubernetes assign a cluster IP | |
| `controllerManager.resources` | Resources allocation (Requests and Limits) | `{requests: {cpu: 100m, memory: 20Mi}, limits: {cpu: 100m, memory: 30Mi}}` |
| `useAggregator` | whether or not to set up the controller-manager to go through the main Kubernetes API server's API aggregator | `true` |
| `rbacEnable` | If true, create & use RBAC resources | `true` |
Expand Down
26 changes: 26 additions & 0 deletions charts/catalog/templates/controller-manager-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
kind: Service
apiVersion: v1
metadata:
name: {{ template "fullname" . }}-controller-manager
labels:
app: {{ template "fullname" . }}-controller-manager
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.controllerManager.service.type }}
{{- if eq .Values.controllerManager.service.type "ClusterIP" }}
{{- if .Values.controllerManager.service.clusterIP }}
clusterIP: {{ .Values.controllerManager.service.clusterIP }}
{{- end }}
{{- end }}
selector:
app: {{ template "fullname" . }}-controller-manager
ports:
- name: secure
protocol: TCP
port: 443
targetPort: 8444
{{- if eq .Values.controllerManager.service.type "NodePort" }}
nodePort: {{ .Values.controllerManager.service.nodePort.securePort }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ controllerManager:
apiserverSkipVerify: true
# Whether the controller will expose metrics on /metrics
enablePrometheusScrape: false
# Attributes of the controller's service resource
service:
# Type of service; valid values are "LoadBalancer", "NodePort" and "ClusterIP"
# NodePort is useful if deploying on bare metal or hacking locally on
# minikube
type: ClusterIP
# Further configuration for services of type NodePort
nodePort:
# Available port in allowable range (e.g. 30000 - 32767 on minikube)
# The TLS-enabled endpoint will be exposed here
securePort: 30444
# Controller Manager resource requests and limits
# Ref: http://kubernetes.io/docs/user-guide/compute-resources/
resources:
Expand Down

0 comments on commit e7e70a1

Please sign in to comment.