Skip to content

Commit

Permalink
OPSEXP-2205: make service templating consistent (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz authored Jul 19, 2023
1 parent eea5111 commit 6929d97
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 7 deletions.
2 changes: 1 addition & 1 deletion charts/alfresco-transform-service/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: alfresco-transform-service
description: A Helm chart for deploying Alfresco Transform Services
type: application
version: 0.1.0
version: 0.1.1
appVersion: "3.0.0"
dependencies:
- name: alfresco-common
Expand Down
2 changes: 1 addition & 1 deletion charts/alfresco-transform-service/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# alfresco-transform-service

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)

A Helm chart for deploying Alfresco Transform Services

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{{- if .Values.imagemagick.enabled }}
{{- $componentScope := (dict "Values" (dict "nameOverride" "imagemagick" ) "Chart" .Chart "Release" .Release) }}
apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{{- if .Values.transformrouter.enabled }}
{{- $componentScope := (dict "Values" (dict "nameOverride" "router" ) "Chart" .Chart "Release" .Release) }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "alfresco-transform-service.fullname" $componentScope }}
name: {{ template "alfresco-transform-service.deployment-transform-router.name" . }}
labels:
{{- include "alfresco-transform-service.labels" $componentScope | nindent 4 }}
{{- include "alfresco-transform-service.transform-router.labels" . | nindent 4 }}
spec:
type: {{ .Values.transformrouter.service.type }}
ports:
Expand All @@ -14,5 +13,5 @@ spec:
protocol: TCP
name: {{ .Values.transformrouter.service.name }}
selector:
{{- include "alfresco-transform-service.selectorLabels" $componentScope | nindent 4 }}
{{- include "alfresco-transform-service.transform-router.selectorLabels" . | nindent 4 }}
{{- end }}
102 changes: 102 additions & 0 deletions charts/alfresco-transform-service/tests/services_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
suite: ATS kubernetes service tests
templates:
- deployment-filestore.yaml
- deployment-imagemagick.yaml
- deployment-libreoffice.yaml
- deployment-pdfrenderer.yaml
- deployment-tika.yaml
- deployment-transform-misc.yaml
- deployment-transform-router.yaml
- svc-filestore.yaml
- svc-imagemagick.yaml
- svc-libreoffice.yaml
- svc-pdfrenderer.yaml
- svc-tika.yaml
- svc-transform-misc.yaml
- svc-transform-router.yaml
- config-filestore.yaml
- config-imagemagick.yaml
- config-libreoffice.yaml
- config-pdfrenderer.yaml
- config-tika.yaml
- config-transform-misc.yaml
- config-transform-router.yaml
- secret-messagebroker.yaml


tests:
- it: should render a service with matching pods
values: &testvalues
- values/test_values.yaml
asserts:
- isSubset:
path: spec.template.metadata.labels
content: &trouter_labels
app.kubernetes.io/name: transform-router
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-transform-router.yaml
- isSubset:
path: spec.selector
content: *trouter_labels
template: svc-transform-router.yaml
- isSubset:
path: spec.template.metadata.labels
content: &sfs_labels
app.kubernetes.io/name: filestore
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-filestore.yaml
- isSubset:
path: spec.selector
content: *sfs_labels
template: svc-filestore.yaml
- isSubset:
path: spec.template.metadata.labels
content: &im_labels
app.kubernetes.io/name: imagemagick
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-imagemagick.yaml
- isSubset:
path: spec.selector
content: *im_labels
template: svc-imagemagick.yaml
- isSubset:
path: spec.template.metadata.labels
content: &lo_labels
app.kubernetes.io/name: libreoffice
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-libreoffice.yaml
- isSubset:
path: spec.selector
content: *lo_labels
template: svc-libreoffice.yaml
- isSubset:
path: spec.template.metadata.labels
content: &pdf_labels
app.kubernetes.io/name: pdfrenderer
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-pdfrenderer.yaml
- isSubset:
path: spec.selector
content: *pdf_labels
template: svc-pdfrenderer.yaml
- isSubset:
path: spec.template.metadata.labels
content: &tika_labels
app.kubernetes.io/name: tika
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-tika.yaml
- isSubset:
path: spec.selector
content: *tika_labels
template: svc-tika.yaml
- isSubset:
path: spec.template.metadata.labels
content: &misc_labels
app.kubernetes.io/name: transform-misc
app.kubernetes.io/instance: RELEASE-NAME
template: deployment-transform-misc.yaml
- isSubset:
path: spec.selector
content: *misc_labels
template: svc-transform-misc.yaml

0 comments on commit 6929d97

Please sign in to comment.