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

Add report-status & leader-election to Helm chart #335

Merged
merged 8 commits into from
Aug 16, 2018

Conversation

Dean-Coakley
Copy link
Contributor

@Dean-Coakley Dean-Coakley commented Aug 13, 2018

Proposed changes

  • Add support for report-status to the Helm chart.
    • externalService cli arg support
    • external-status-address configmap example
  • Add support for leader-election to the Helm chart.

Checklist

  • I have read the CONTRIBUTING doc
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

Note: I will update documentation once my changes are reviewed

@Dean-Coakley Dean-Coakley added the enhancement Pull requests for new features/feature enhancements label Aug 13, 2018
@Dean-Coakley Dean-Coakley self-assigned this Aug 13, 2018
@@ -69,6 +69,12 @@ spec:
{{- if .Values.controller.healthStatus }}
- -health-status
{{- end }}
{{- if and (.Values.controller.reportIngressStatus.enable) (.Values.controller.reportIngressStatus.externalService) }}
- -external-service={{ .Values.controller.reportIngressStatus.externalService }}
{{- end }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need to add the flag -report-ingress-status.

Something like:

{{- if .Values.controller.reportIngressStatus.enable }}
        - -report-ingress-status
{{- end }}

Without that flag, status reporting is not actually turned on.

@Dean-Coakley Dean-Coakley force-pushed the update-helm-chart branch 4 times, most recently from ec60483 to 029f666 Compare August 14, 2018 13:44
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally,
could you make sure the following lines https://github.com/nginxinc/kubernetes-ingress/blob/master/install/rbac/rbac.yaml#L53-L59 are present in the helm RBAC? Also, could you make them depend on controller.reportIngressStatus.enable?

@@ -14,6 +14,7 @@ controller:
secret: # <namespace>/<secret_name>
config:
entries: {}
# external-status-address: "1.2.3.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this line

@@ -9,6 +9,7 @@ controller:
pullPolicy: IfNotPresent
config:
entries: {}
# external-status-address: "1.2.3.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this line

@@ -81,6 +81,9 @@ Parameter | Description | Default
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources. Requires `controller.reportIngressStatus.externalService`, or `controller.config.entries.external-status-address`. | false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> Update the address field in the status of Ingresses resources with an external address of the Ingress controller. You must also specify the source of the external address either through an external service via controller.reportIngressStatus.externalService or the external-status-address entry in the ConfigMap via controller.config.entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Adding a note **Note:** controller.reportIngressStatus.externalService takes precedence if both are set.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

external-status-address takes precedence

@@ -81,6 +81,9 @@ Parameter | Description | Default
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources. Requires `controller.reportIngressStatus.externalService`, or `controller.config.entries.external-status-address`. | false
`controller.reportIngressStatus.externalService` | Specifies the name of the service with the type LoadBalancer through which the Ingress controller pods are exposed externally. The external address of the service is used when reporting the status of Ingress resources. Requires `controller.reportIngressStatus.enable`. | nginx-ingress
`controller.reportIngressStatus.enableLeaderElection` | Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources. | true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--> Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources. Requires controller.reportIngressStatus.enable.

{{- if .Values.controller.reportIngressStatus.enable }}
- -report-ingress-status
{{- if .Values.controller.reportIngressStatus.externalService }}
- -external-service="{{ .Values.controller.reportIngressStatus.externalService }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "?

{{- if .Values.controller.reportIngressStatus.enable }}
- -report-ingress-status
{{- if .Values.controller.reportIngressStatus.externalService }}
- -external-service="{{ .Values.controller.reportIngressStatus.externalService }}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "?

@@ -81,6 +81,9 @@ Parameter | Description | Default
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources. Requires `controller.reportIngressStatus.externalService`, or `controller.config.entries.external-status-address` to be set. **Note:** `controller.reportIngressStatus.externalService` takes preference if both are set. | false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

controller.config.entries.external-status-address takes precedence if both are set.

@@ -81,6 +81,9 @@ Parameter | Description | Default
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources. Requires `controller.reportIngressStatus.externalService`, or `controller.config.entries.external-status-address` to be set. **Note:** `controller.reportIngressStatus.externalService` takes preference if both are set. | false
`controller.reportIngressStatus.externalService` | Specifies the name of the service with the type LoadBalancer through which the Ingress controller pods are exposed externally. The external address of the service is used when reporting the status of Ingress resources. `controller.reportIngressStatus.enable` must be set to `true`. | nginx-ingress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just say "through which the Ingress controller is exposed externally" and not mention pods.

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase against the master

  • 2 suggestions

@@ -56,12 +56,14 @@ rules:
verbs:
- list
- watch
{{- if .Values.controller.reportIngressStatus.enable }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need get as well for Ingress resources

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought i added that weeks ago

@@ -81,6 +81,9 @@ Parameter | Description | Default
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources with an external address of the Ingress controller. You must also specify the source of the external address either through an external service via `controller.reportIngressStatus.externalService` or the `external-status-address` entry in the ConfigMap via `controller.config.entries`. **Note:** `controller.config.entries.external-status-address` takes precedence if both are set. | false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since by default we set controller.service.create to true, perhaps this should be enabled by default as well?

Dean-Coakley and others added 7 commits August 16, 2018 09:37
* Added report-ingress-status to both templates
* Fixed leader-election to only be set when report-ingress-status is
enabled
* Fix external-status-address to use example ip 1.2.3.4
* Fix externalService default to be nginx-ingress as this will be the
most common default
* Removed quotes from externalService in values files and moved to
templates to follow existing code style
* Added documentation for report-ingress-status related values
* Added documentation for leader-election
The IC only requires ingress/status update permissions if
report-ingress-status is enabled.
Also add get permissions on ingress resources, needed when the status
updater is retrying a status update.
@isaachawley isaachawley merged commit 51a5962 into master Aug 16, 2018
@isaachawley isaachawley deleted the update-helm-chart branch August 17, 2018 08:42
@pleshakov pleshakov changed the title Helm: Add report-status & leader-election support Add report-status & leader-election to Helm chart Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants