Skip to content

Commit

Permalink
update nginx manifest and configurations (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennsimon authored Sep 23, 2021
1 parent c6004aa commit 100f1d0
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 18 deletions.
2 changes: 1 addition & 1 deletion charts/opensrp-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.8
version: 0.2.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
29 changes: 18 additions & 11 deletions charts/opensrp-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,22 @@ ingress:
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "<cluster-issuer>"
cert-manager.io/cluster-issuer: <YourClusterIssuer>
cert-manager.io/acme-challenge-type: http01
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
hosts:
- host: <website-url>
paths: ["/"]
tls:
- secretName: <website-tls-name>
hosts:
- <website-url>
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: opensrp-web.local
paths:
- path: /
pathType: ImplementationSpecific

tls:
- secretName: opensrp-web-tls
hosts:
- opensrp-web.local

sharedVars:
keycloakUrl: "keycloak-url"
Expand Down Expand Up @@ -89,9 +95,10 @@ reactEnvironmentVariables:
| `service.type` | | `"ClusterIP"` |
| `service.port` | | `8080` |
| `ingress.enabled` | | `false` |
| `ingress.annotations` | | `{}` |
| `ingress.hosts` | | `[{"host": "opensrp-web.local", "paths": []}]` |
| `ingress.tls` | | `[]` |
| `ingress.className` | | `""` |
| `ingress.annotations` | | `{}` |
| `ingress.hosts` | | `[{"host": "opensrp-web.local", "paths": [{"path": "/", "pathType": "ImplementationSpecific"}]}]` |
| `ingress.tls` | | `[]` |
| `resources` | | `{}` |
| `autoscaling.enabled` | | `false` |
| `autoscaling.minReplicas` | | `1` |
Expand Down
2 changes: 1 addition & 1 deletion charts/opensrp-web/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
Expand Down
28 changes: 24 additions & 4 deletions charts/opensrp-web/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{{- if .Values.ingress.enabled -}}
{{- if and .Values.ingress.enabled -}}
{{- $fullName := include "opensrp-web.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
Expand All @@ -16,6 +23,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -32,10 +42,20 @@ spec:
http:
paths:
{{- range .paths }}
- path: {{ . }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
12 changes: 11 additions & 1 deletion charts/opensrp-web/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,21 @@ service:

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: opensrp-web.local
paths: []
paths:
- path: /
pathType: ImplementationSpecific

tls: []
# - secretName: opensrp-web-tls
# hosts:
# - opensrp-web.local

resources: {}

autoscaling:
Expand Down

0 comments on commit 100f1d0

Please sign in to comment.