Skip to content

Commit

Permalink
fix secondary resources
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Jan 5, 2024
1 parent e3c6792 commit 9bc425d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 27 deletions.
7 changes: 6 additions & 1 deletion charts/alfresco-search-service/templates/_helpers-name.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
{{- end }}

{{- define "alfresco-search-service.repository-config.name" -}}
{{- $scope := (dict "Values" (dict "nameOverride" "repository-config" ) "Chart" .Chart "Release" .Release) }}
{{- $scope := (dict "Values" (dict "nameOverride" "solr-repository-config" ) "Chart" .Chart "Release" .Release) }}
{{- include "alfresco-search-service.fullname" $scope }}
{{- end }}

{{- define "alfresco-search-service.ingress-secret.name" -}}
{{- $scope := (dict "Values" (dict "nameOverride" "solr-ingress-credentials" ) "Chart" .Chart "Release" .Release) }}
{{- include "alfresco-search-service.fullname" $scope }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/alfresco-search-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
15 changes: 8 additions & 7 deletions charts/alfresco-search-service/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{{- if .Values.ingress.enabled }}
{{- $serviceName := printf "%s-%s" (include "alfresco-search-service.fullname" .) "solr" -}}
{{- $servicePort := .Values.service.name | default (include "alfresco-search.svcPort" .) -}}
{{- $backendSvc := dict "serviceName" $serviceName "servicePort" $servicePort "context" $ -}}
{{- $backendSvc := dict "serviceName" (include "alfresco-search-service.deployment.name" .) "servicePort" $servicePort "context" $ -}}

apiVersion: {{ template "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ template "alfresco-search-service.fullname" . }}-solr
name: {{ template "alfresco-search-service.deployment.name" . }}
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/auth-secret: {{ $.Values.ingress.existingSecretName | default (printf "%s-ingress-secret" (include "alfresco-search-service.fullname" $)) }}
{{- if .Values.ingress.annotations -}}
{{ toYaml .Values.ingress.annotations | nindent 4 }}
{{- end }}
nginx.ingress.kubernetes.io/auth-secret: {{ $.Values.ingress.existingSecretName | default (include "alfresco-search-service.ingress-secret.name" .) }}
{{- if .Values.ingress.annotations -}}
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- end }}
labels:
{{- include "alfresco-search-service.labels" . | nindent 4 }}
spec:
{{- if .Values.ingress.tls }}
tls:
Expand Down
5 changes: 2 additions & 3 deletions charts/alfresco-search-service/templates/secret-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "alfresco-search-service.fullname" . }}-ingress-secret
name: {{ template "alfresco-search-service.ingress-secret.name" . }}
labels:
app: {{ template "alfresco-search-service.fullname" . }}-solr
release: {{ .Release.Name }}
{{- include "alfresco-search-service.labels" . | nindent 4 }}
type: Opaque
data:
auth: {{ .Values.ingress.basicAuth | quote }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{{- if (not .Values.repository.existingSecret.name) }}
{{- if and (eq "secret" .Values.repository.securecomms) (not .Values.repository.existingConfigMap.name) }}
{{- if and (not .Values.repository.existingSecret.name) (eq "secret" .Values.repository.securecomms) }}
apiVersion: v1
kind: Secret
metadata: {{- $ctx := dict "Values" (dict "nameOverride" (printf "%s-repository" $.Chart.Name )) "Chart" $.Chart "Release" $.Release }}
name: {{ template "alfresco-search-service.fullname" $ctx }}
metadata:
name: {{ template "alfresco-search-service.repository-config.name" . }}
labels:
{{ template "alfresco-search-service.labels" . }}
type: Opaque
Expand All @@ -12,4 +11,3 @@ data:
{{- $shared_secret := required $reqmsg (index .Values.repository "sharedSecret") }}
SOLR_ALFRESCO_SECURECOMMS_SECRET: {{ $shared_secret | b64enc | quote }}
{{- end }}
{{- end }}
10 changes: 3 additions & 7 deletions charts/alfresco-search-service/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "alfresco-search-service.fullname" . }}-solr
name: {{ template "alfresco-search-service.deployment.name" . }}
labels:
app: {{ template "alfresco-search-service.fullname" . }}-solr
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- include "alfresco-search-service.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ template "alfresco-search.svcPort" . }}
targetPort: {{ template "alfresco-search.containerPort" . }}
name: {{ .Values.service.name }}
selector:
app: {{ template "alfresco-search-service.fullname" . }}-solr
release: {{ .Release.Name }}
{{- include "alfresco-search-service.selectorLabels" . | nindent 4 }}
2 changes: 1 addition & 1 deletion charts/alfresco-search-service/tests/ingress_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tests:
asserts:
- equal:
path: metadata.name
value: RELEASE-NAME-alfresco-search-service-solr
value: RELEASE-NAME-solr
template: ingress.yaml
- equal:
path: metadata.annotations['nginx.ingress.kubernetes.io/auth-secret']
Expand Down
4 changes: 2 additions & 2 deletions charts/alfresco-search-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ initContainer:
global:
alfrescoRegistryPullSecrets: quay-registry-secret


nodeSelector: {}
tolerations: []
affinity: {}
# -- Pod affinity, passed thru tpl function
affinity: |-
serviceAccount:
# -- Specifies whether a service account should be created
Expand Down

0 comments on commit 9bc425d

Please sign in to comment.