@@ -69,13 +69,29 @@ Create the database host based on backend selection
6969{ {- .Values.externalDatabase.host } 
7070{ {- else  if  eq  .Values.backend " elasticsearch" } 
7171{ {- if  .Values.elasticsearch.enabled } 
72+ { {- if  .Values.elasticsearch.masterService } 
73+ { {- .Values.elasticsearch.masterService } 
74+ { {- else  if  .Values.elasticsearch.fullnameOverride } 
75+ { {- printf " %s-master" } 
76+ { {- else  if  .Values.elasticsearch.clusterName } 
77+ { {- printf " %s-master" } 
78+ { {- else  } 
7279{ {- printf " %s-%s" " elasticsearch-master" } 
80+ { {- end } 
7381{ {- else  } 
7482{ {- fail " Elasticsearch is not enabled but backend is set to elasticsearch" } 
7583{ {- end } 
7684{ {- else  if  eq  .Values.backend " opensearch" } 
7785{ {- if  .Values.opensearch.enabled } 
86+ { {- if  .Values.opensearch.masterService } 
87+ { {- .Values.opensearch.masterService } 
88+ { {- else  if  .Values.opensearch.fullnameOverride } 
89+ { {- printf " %s-master" } 
90+ { {- else  if  .Values.opensearch.clusterName } 
91+ { {- printf " %s-master" } 
92+ { {- else  } 
7893{ {- printf " %s-%s" " opensearch-cluster-master" } 
94+ { {- end } 
7995{ {- else  } 
8096{ {- fail " OpenSearch is not enabled but backend is set to opensearch" } 
8197{ {- end } 
@@ -168,4 +184,28 @@ Determine if OpenSearch should be enabled based on backend selection
168184{ {- else  } 
169185{ {- false  } 
170186{ {- end } 
187+ { {- end } 
188+ 
189+ { {/*
190+ Determine PodDisruptionBudget apiVersion based on cluster capabilities 
191+ */}  }
192+ { {- define " stac-fastapi.pdb.apiVersion" } 
193+ { {- if  semverCompare " >=1.21-0" } 
194+ policy/v1
195+ { {- else  } 
196+ policy/v1beta1
197+ { {- end } 
198+ { {- end } 
199+ 
200+ { {/*
201+ Determine HorizontalPodAutoscaler apiVersion based on cluster capabilities 
202+ */}  }
203+ { {- define " stac-fastapi.hpa.apiVersion" } 
204+ { {- if  .Capabilities.APIVersions.Has " autoscaling/v2" } 
205+ autoscaling/v2
206+ { {- else  if  .Capabilities.APIVersions.Has " autoscaling/v2beta2" } 
207+ autoscaling/v2beta2
208+ { {- else  } 
209+ autoscaling/v2beta1
210+ { {- end } 
171211{ {- end } 
0 commit comments