Skip to content

Commit

Permalink
License File Handling unified
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Friedhoff committed Nov 3, 2023
1 parent d697784 commit 7a7ddb7
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 4 deletions.
11 changes: 10 additions & 1 deletion microservicesruntime/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ Microservices Runtime requires a license file. These license is supposed to be p
Hence before running `helm install`, create the configmap:

```
kubectl create configmap microservicesruntime-license-key --from-file=licenseKey.xml=<your path and filename to Microservices Runtime license file>
kubectl create configmap microservicesruntime-license-key --from-file=licensekey=<your path and filename to Microservices Runtime license file>
```

Optionally you can also provide the license directly when installing your release (see also below).


## Examples for Use-cases

Sub-folder `examples` contains some *values* examples for more use-cases. To use the use-case, adapt and add the provided `values.yaml` to your values.
Expand All @@ -61,6 +64,12 @@ Install release with pulling image and setting secret (to pull image) ...
helm install wm-msr webmethods/microservicesruntime \
```

... (optionally) provide the license key at installation time (can be ommitted for upgrade later)

```shell
--set-file=licensekey=<your path and filename to Microservices Runtime license file>
```

... Ingress is enabled per default. Define Ingress service host ...

```shell
Expand Down
7 changes: 7 additions & 0 deletions microservicesruntime/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the license config map
*/}}
{{- define "microservicesruntime.licenseConfigMapName" -}}
{{- default ( printf "%s-%s" (include "common.names.fullname" .) "-license") .Values.licenseConfigMap }}
{{- end }}
4 changes: 2 additions & 2 deletions microservicesruntime/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ spec:
{{- end }}
- name: microservicesruntime-license
configMap:
name: {{ .Values.microservicesruntime.licenseConfigMap }}
name: {{ include "microservicesruntime.licenseConfigMapName" . }}
defaultMode: 0666
items:
- key: licenseKey.xml
- key: licensekey
path: licenseKey.xml
- name: application-properties
configMap:
Expand Down
33 changes: 33 additions & 0 deletions microservicesruntime/helm/templates/license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{ if .Values.license }}
---
# /*
# * Copyright (c) 2021 Software AG, Darmstadt, Germany and/or its licensors
# *
# * SPDX-License-Identifier: Apache-2.0
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
# */

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "microservicesruntime.licenseConfigMapName" . }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
annotations:
helm.sh/resource-policy: keep
data:
licensekey:
{{ .Values.license | toYaml }}
{{- end }}
2 changes: 1 addition & 1 deletion microservicesruntime/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ microservicesruntime:
readinessProbe:
# -- Scheme of administration port port, uppercase
scheme: "HTTP"
# -- Name of config map which contains the license key
# -- Name of config map which contains the license key. If you ommit this, it defaults to the release name + microservicesruntime-license.
licenseConfigMap: "microservicesruntime-license-key"
memoryHeap:
## -- Minimum of allocated heap memory
Expand Down

0 comments on commit 7a7ddb7

Please sign in to comment.