Skip to content

Commit

Permalink
Add route and ingress, use default settings
Browse files Browse the repository at this point in the history
Fixes #959
  • Loading branch information
serverhorror committed Oct 12, 2023
1 parent 9e276a1 commit 616a490
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 50 deletions.
2 changes: 2 additions & 0 deletions docker-plain/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.scratch
scratch/
6 changes: 4 additions & 2 deletions docker-plain/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ odsComponentPipeline(
*/
odsComponentStageBuildOpenShiftImage(context)
}
odsComponentStageRolloutOpenShiftDeployment(context)
odsComponentStageRolloutOpenShiftDeployment(context,[
'selector': "app.kubernetes.io/instance=${context.componentId}",
'helmEnvBasedValuesFiles': ['values.env.yaml']
])
}

def stageBuild(def context) {
Expand All @@ -36,4 +39,3 @@ def stageUnitTest(def context) {
// add your unit tests here, if needed
}
}

2 changes: 1 addition & 1 deletion docker-plain/files/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: chart
name: docker-plain
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
Expand Down
22 changes: 0 additions & 22 deletions docker-plain/files/chart/templates/NOTES.txt

This file was deleted.

15 changes: 15 additions & 0 deletions docker-plain/files/chart/templates/configMap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if false -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Release.Name }}-configmap"
labels:
{{- include "chart.labels" . | nindent 4 }}
data:
capabilities: |
{{- range $capability := .Capabilities.APIVersions }}
- {{ $capability }}
{{- end }}
kubeVersion: {{ printf "%#v" .Capabilities.KubeVersion }}
kubeVersion.gitVersion: {{ printf "%#v" .Capabilities.KubeVersion.GitVersion }}
{{- end }}
11 changes: 6 additions & 5 deletions docker-plain/files/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
image: "{{ .Values.registry }}/{{ .Values.imageNamespace }}/{{ .Values.componentId }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: HTTP_LISTEN_PORT
value: "{{ .Values.service.port }}"
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
tcpSocket:
port: http
readinessProbe:
httpGet:
path: /
tcpSocket:
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions docker-plain/files/chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
{{- range $entry := .Values.ingress.hosts }}
- host: {{ printf "%s" $entry.host | quote }}
http:
paths:
{{- range .paths }}
Expand Down
21 changes: 21 additions & 0 deletions docker-plain/files/chart/templates/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Capabilities.APIVersions.Has "route.openshift.io/v1/Route" }}
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: {{ include "chart.fullname" . }}
labels:
{{- include "chart.labels" . | nindent 4 }}
spec:
# BUG(serverhorror): FIXME
host: {{ include "chart.fullname" . }}
to:
kind: Service
name: {{ include "chart.fullname" . }}
weight: 100
port:
targetPort: http
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
wildcardPolicy: None
{{- end }}
60 changes: 42 additions & 18 deletions docker-plain/files/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
replicaCount: 1

image:
repository: nginx
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
imagePullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
create: false
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
Expand All @@ -38,32 +35,59 @@ securityContext: {}

service:
type: ClusterIP
port: 80
port: 8080

# BUG(serverhorror): FIXME
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
annotations:
# Please see: https://confluence.biscrum.com/x/YxU_FQ
# the cluster-issuer that cert-manager should use
cert-manager.io/cluster-issuer: "bi-acme-issuer"
# Add your CN (e.g. your main domain)
cert-manager.io/common-name: your-app.apps.eu-dev.ocp.aws.boehringer.com
# Add your mail
cert-manager.io/email-sans: [email protected]
# configure your Org
cert-manager.io/subject-organizations: Boehringer Ingelheim GmbH
# configure your Org Unit
cert-manager.io/subject-organizationalunits: IT
# configure your Org country
cert-manager.io/subject-countries: DE
# You can also add your province, etc here (see cert-manager docs)

# try to renew your certificate 30 days before it will expire (default is 15 days)
cert-manager.io/renew-before: 720h
# limit the number of CertificateRequests to keep to the last 5 (by default it will keep all CertificateRequests)
cert-manager.io/revision-history-limit: '5'
# set the encoding of your private key (default is PKCS1)
cert-manager.io/private-key-encoding: PKCS8
# the key size to use for the RSA private key algorithm
# (default is 2048; you can also go up to 8192).
# You could also switch to other private key alogrithms,
# which are not supported by the BI ACME server as far as I know.
cert-manager.io/private-key-size: '4096'
hosts:
- host: chart-example.local
# BUG(serverhorror): FIXME
- host: chart-example.eu.example.invalid
paths:
- path: /
pathType: ImplementationSpecific
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
tls:
- secretName: chart-example-tls
hosts:
# BUG(serverhorror): FIXME
- chart-example.eu.example.invalid

resources: {}
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
limits:
cpu: 100m
memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
Expand Down

0 comments on commit 616a490

Please sign in to comment.