Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-2900 Configurable init containers #413

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/alfresco-connector-hxi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: alfresco-connector-hxi
description: A Helm chart for deploying Alfresco connector hxi services
type: application
version: 0.1.0-alpha.2
version: 0.1.0-alpha.3
appVersion: 1.0.0
dependencies:
- name: alfresco-common
Expand Down
7 changes: 5 additions & 2 deletions charts/alfresco-connector-hxi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-connector-hxi

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

A Helm chart for deploying Alfresco connector hxi services

Expand Down Expand Up @@ -34,7 +34,10 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs
| bulkIngester.image.pullPolicy | string | `"IfNotPresent"` | |
| bulkIngester.image.repository | string | `"quay.io/alfresco/alfresco-hxinsight-connector-bulk-ingester"` | |
| bulkIngester.image.tag | string | `"1.0.0-A13"` | |
| bulkIngester.initContainers.waitForRepository.resources.limits.cpu | string | `"0.25"` | |
| bulkIngester.initContainers.waitForRepository.image.pullPolicy | string | `"IfNotPresent"` | |
| bulkIngester.initContainers.waitForRepository.image.repository | string | `"curlimages/curl"` | |
| bulkIngester.initContainers.waitForRepository.image.tag | string | `"8.11.0"` | |
| bulkIngester.initContainers.waitForRepository.resources.limits.cpu | string | `"250m"` | |
| bulkIngester.initContainers.waitForRepository.resources.limits.memory | string | `"20Mi"` | |
| bulkIngester.resources.limits.cpu | string | `"2"` | |
| bulkIngester.resources.limits.memory | string | `"512Mi"` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ spec:
protocol: TCP
initContainers:
- name: wait-for-repository
image: curlimages/curl:7.79.1
{{- with .Values.bulkIngester.initContainers.waitForRepository }}
image: {{ printf "%s:%s" .image.repository .image.tag | quote }}
imagePullPolicy: {{ .image.pullPolicy }}
resources: {{- toYaml .resources | nindent 12 }}
{{- end }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
resources: {{- toYaml .Values.bulkIngester.initContainers.waitForRepository.resources | nindent 12 }}
env:
{{- $repoCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" $.Chart "Release" $.Release }}
{{- $repoCm := coalesce .Values.repository.existingConfigMap.name (include "alfresco-connector-hxi.fullname" $repoCtx) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
suite: test bulk ingester job manifest
templates:
- job-connector-hxi-bulk-ingester.yaml
tests:
- it: should have the default init container
asserts:
- equal:
path: spec.template.spec.initContainers[0].name
value: wait-for-repository
- matchRegex:
path: spec.template.spec.initContainers[0].image
pattern: "curlimages/curl:.+"
- equal:
path: spec.template.spec.initContainers[0].imagePullPolicy
value: IfNotPresent
8 changes: 6 additions & 2 deletions charts/alfresco-connector-hxi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ bulkIngester:
ALFRESCO_BULK_INGEST_PUBLISHER_ENDPOINT: activemq:queue:bulk-ingester-events
initContainers:
waitForRepository:
image:
repository: curlimages/curl
tag: "8.11.0"
pullPolicy: IfNotPresent
resources:
limits:
cpu: "0.25"
memory: "20Mi"
cpu: 250m
memory: 20Mi
affinity: {}
predictionApplier:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion charts/alfresco-repository/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: alfresco-repository
description: Alfresco content repository Helm chart
type: application
version: 0.7.2
version: 0.8.0-alpha.0
appVersion: 23.3.2
dependencies:
- name: alfresco-common
Expand Down
7 changes: 6 additions & 1 deletion charts/alfresco-repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-repository

![Version: 0.7.2](https://img.shields.io/badge/Version-0.7.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 23.3.2](https://img.shields.io/badge/AppVersion-23.3.2-informational?style=flat-square)
![Version: 0.8.0-alpha.0](https://img.shields.io/badge/Version-0.8.0--alpha.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 23.3.2](https://img.shields.io/badge/AppVersion-23.3.2-informational?style=flat-square)

Alfresco content repository Helm chart

Expand Down Expand Up @@ -102,6 +102,11 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs
| ingress.hosts[0].paths[1].path | string | `"/api-explorer"` | |
| ingress.hosts[0].paths[1].pathType | string | `"Prefix"` | |
| ingress.tls | list | `[]` | |
| initContainers.waitDbReady.image.pullPolicy | string | `"IfNotPresent"` | |
| initContainers.waitDbReady.image.repository | string | `"busybox"` | |
| initContainers.waitDbReady.image.tag | string | `"1.37.0"` | |
| initContainers.waitDbReady.resources.limits.cpu | string | `"250m"` | |
| initContainers.waitDbReady.resources.limits.memory | string | `"20Mi"` | |
| livenessProbe.httpGet.path | string | `"/alfresco/api/-default-/public/alfresco/versions/1/probes/-live-"` | |
| livenessProbe.httpGet.port | string | `"http"` | |
| livenessProbe.periodSeconds | int | `20` | |
Expand Down
13 changes: 6 additions & 7 deletions charts/alfresco-repository/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ spec:
{{- include "alfresco-common.imagePullSecrets" . | indent 6 }}
initContainers:
- name: wait-db-ready
image: busybox:1.35
imagePullPolicy: IfNotPresent
{{- include "alfresco-common.component-security-context" dict | indent 8 }}
resources:
limits:
cpu: "0.25"
memory: "20Mi"
{{- with .Values.initContainers.waitDbReady }}
image: {{ printf "%s:%s" .image.repository .image.tag | quote }}
imagePullPolicy: {{ .image.pullPolicy }}
resources: {{- toYaml .resources | nindent 12 }}
{{- end }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
env:
{{ include "alfresco-repository.db.env" . | indent 12 }}
command:
Expand Down
13 changes: 13 additions & 0 deletions charts/alfresco-repository/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ tests:
name: mycm
key: DBDRIVER

- it: should have the default init container
values: *test_values
asserts:
- equal:
path: spec.template.spec.initContainers[0].name
value: wait-db-ready
- matchRegex:
path: spec.template.spec.initContainers[0].image
pattern: "busybox:.+"
- equal:
path: spec.template.spec.initContainers[0].imagePullPolicy
value: IfNotPresent

- it: should deploy with extra containers
values: *test_values
set:
Expand Down
10 changes: 10 additions & 0 deletions charts/alfresco-repository/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ command: []
args: []
nodeSelector: {}
tolerations: []
initContainers:
waitDbReady:
image:
repository: busybox
tag: 1.37.0
pullPolicy: IfNotPresent
resources:
limits:
cpu: 250m
memory: 20Mi
global:
# -- If a private image registry a secret can be defined and passed to
# kubernetes, see:
Expand Down
2 changes: 1 addition & 1 deletion charts/alfresco-search-enterprise/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
name: alfresco-search-enterprise
description: A Helm chart for deploying Alfresco Elasticsearch connector
type: application
version: 4.2.0-alpha.2
version: 4.2.0-alpha.3
appVersion: 4.1.0
dependencies:
- name: alfresco-common
Expand Down
7 changes: 5 additions & 2 deletions charts/alfresco-search-enterprise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parent: Charts Reference

# alfresco-search-enterprise

![Version: 4.2.0-alpha.2](https://img.shields.io/badge/Version-4.2.0--alpha.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.1.0](https://img.shields.io/badge/AppVersion-4.1.0-informational?style=flat-square)
![Version: 4.2.0-alpha.3](https://img.shields.io/badge/Version-4.2.0--alpha.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.1.0](https://img.shields.io/badge/AppVersion-4.1.0-informational?style=flat-square)

A Helm chart for deploying Alfresco Elasticsearch connector

Expand Down Expand Up @@ -109,7 +109,10 @@ Checkout [alfresco-content-services chart's doc](https://github.com/Alfresco/acs
| reindexing.image.pullPolicy | string | `"IfNotPresent"` | |
| reindexing.image.repository | string | `"quay.io/alfresco/alfresco-elasticsearch-reindexing"` | |
| reindexing.image.tag | string | `"4.1.0"` | |
| reindexing.initcontainers.waitForRepository.resources.limits.cpu | string | `"0.25"` | |
| reindexing.initcontainers.waitForRepository.image.pullPolicy | string | `"IfNotPresent"` | |
| reindexing.initcontainers.waitForRepository.image.repository | string | `"curlimages/curl"` | |
| reindexing.initcontainers.waitForRepository.image.tag | string | `"8.11.0"` | |
| reindexing.initcontainers.waitForRepository.resources.limits.cpu | string | `"250m"` | |
| reindexing.initcontainers.waitForRepository.resources.limits.memory | string | `"20Mi"` | |
| reindexing.pathIndexingEnabled | bool | `true` | |
| reindexing.repository.existingConfigMap.keys.url | string | `"REPOSITORY_URL"` | Key within the configmap holding the full url to connect to the alfresco repository |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ spec:
protocol: TCP
initContainers:
- name: wait-for-repository
image: curlimages/curl:7.79.1
{{- with .Values.reindexing.initcontainers.waitForRepository }}
image: {{ printf "%s:%s" .image.repository .image.tag | quote }}
imagePullPolicy: {{ .image.pullPolicy }}
resources: {{- toYaml .resources | nindent 12 }}
{{- end }}
{{- include "alfresco-common.component-security-context" .Values | indent 8 }}
resources: {{- toYaml .Values.reindexing.initcontainers.waitForRepository.resources | nindent 12 }}
env:
{{- $repoCtx := dict "Values" (dict "nameOverride" (printf "%s-%s" ($.Values.nameOverride | default $.Chart.Name) "repository")) "Chart" $.Chart "Release" $.Release }}
{{- $repoCm := coalesce .Values.reindexing.repository.existingConfigMap.name (include "alfresco-search-enterprise.fullname" $repoCtx) }}
Expand Down
12 changes: 12 additions & 0 deletions charts/alfresco-search-enterprise/tests/reindexing-job_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ tests:
- hasDocuments:
count: 0

- it: should render default init container
asserts:
- equal:
path: spec.template.spec.initContainers[0].name
value: wait-for-repository
- matchRegex:
path: spec.template.spec.initContainers[0].image
pattern: "curlimages/curl:.+"
- equal:
path: spec.template.spec.initContainers[0].imagePullPolicy
value: IfNotPresent

- it: render the initContainer with given configmap details
set:
reindexing:
Expand Down
8 changes: 6 additions & 2 deletions charts/alfresco-search-enterprise/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,14 @@ reindexing:
memory: "512Mi"
initcontainers:
waitForRepository:
image:
repository: curlimages/curl
tag: "8.11.0"
pullPolicy: IfNotPresent
resources:
limits:
cpu: "0.25"
memory: "20Mi"
cpu: 250m
memory: 20Mi
serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down
Loading