Skip to content

Commit 533d621

Browse files
committed
add conditional serviceType settings for web service
1 parent 52d3f9d commit 533d621

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

osm-seed/templates/web/web-service.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@ metadata:
99
environment: {{ .Values.environment }}
1010
release: {{ .Release.Name }}
1111
annotations:
12+
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
13+
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
14+
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
15+
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
16+
{{- end }}
17+
{{- if eq .Values.serviceType "ClusterIP" -}}
1218
kubernetes.io/ingress.class: nginx
13-
# nginx.ingress.kubernetes.io/proxy-body-size: "300m"
1419
cert-manager.io/cluster-issuer: letsencrypt-prod-issuer
20+
{{- end }}
21+
1522
spec:
16-
{{- if eq .Values.cloudProvider "minikube" }}
17-
type: NodePort
18-
{{- else }}
19-
type: ClusterIP
20-
{{- end }}
23+
type: {{ .Values.serviceType }}
2124
ports:
2225
- port: 80
2326
targetPort: http
24-
nodePort: null
2527
protocol: TCP
2628
name: http
29+
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
30+
- port: 443
31+
targetPort: http
32+
protocol: TCP
33+
name: https
34+
{{- end }}
2735
selector:
2836
app: {{ template "osm-seed.name" . }}
2937
release: {{ .Release.Name }}

osm-seed/values.yaml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,21 @@ AZURE_STORAGE_CONNECTION_STRING: xyz..
3232

3333
AWS_SSL_ARN: false
3434

35-
# ====================================================================================================
36-
# Ingress variables
37-
# ====================================================================================================
38-
# ingress:
39-
# enabled: false
40-
# annotations: {}
41-
# # kubernetes.io/ingress.class: nginx
42-
# # kubernetes.io/tls-acme: "true"
43-
# path: /
44-
# hosts:
45-
# - chart-example.local
46-
# tls: []
35+
# Specify serviceType.
36+
#
37+
# serviceType can be one of three values: 'NodePort', 'ClusterIP' or 'LoadBalancer'
38+
# Use `NodePort` for local testing on minikube.
39+
#
40+
# The recommended setting is `ClusterIP`, and then following the instructions to
41+
# point a DNS record to the cluster IP address. This will setup the ingress rules
42+
# for all services as subdomains and configure SSL using Lets Encrypt.
43+
#
44+
# If you specify `LoadBalancer` as the service type, if you also specify
45+
# an `AWS_SSL_ARN` that is a wildcart certificate, that will be configured
46+
# as the SSL certificate for your services. Else, you will need to configure
47+
# SSL separately.
48+
serviceType: NodePort
4749

48-
# # ====================================================================================================
49-
# # Domain app configuration
50-
# # ====================================================================================================
51-
# domain:
52-
# #enabled, If you set enabled=true, you should uncomment the following configurations
53-
# enabled: false
54-
# # domainName, Add here your domain or the fixed IP where the server is running
55-
# domainName: example.com
56-
# protocolo: http
5750

5851
# Domain that is pointed to the clusterIP
5952
# You will need to create an A record like *.osmseed.example.com pointed to the ClusterIP

0 commit comments

Comments
 (0)