Skip to content

Commit

Permalink
Merge pull request #54 from lalithkota/2.0
Browse files Browse the repository at this point in the history
Removed sr-landing charts and reorg. Removed docker regsitries, prefe…
  • Loading branch information
lalithkota authored Dec 20, 2024
2 parents 7c39598 + 2bb7bc3 commit df6875c
Show file tree
Hide file tree
Showing 24 changed files with 453 additions and 635 deletions.
2 changes: 0 additions & 2 deletions charts/openg2p-social-registry/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
charts/*
Chart.lock

!charts/sr-landing
3 changes: 0 additions & 3 deletions charts/openg2p-social-registry/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ description: A Helm chart for OpenG2P Social Registry
type: application
version: 2.0.0-develop
dependencies:
- name: sr-landing
version: 2.0.0-develop
condition: sr-landing.enabled
- name: odoo
version: 26.2.9
repository: oci://registry-1.docker.io/bitnamicharts
Expand Down
1 change: 0 additions & 1 deletion charts/openg2p-social-registry/charts/sr-landing

This file was deleted.

5 changes: 5 additions & 0 deletions charts/openg2p-social-registry/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ Render Env values section
{{- $envVars := merge (deepCopy .Values.kafkaUi.envVars) (deepCopy .Values.kafkaUi.envVarsFrom) -}}
{{- include "socialRegistry.baseEnvVars" (dict "envVars" $envVars "context" $) }}
{{- end -}}

{{- define "socialRegistry.landing.envVars" -}}
{{- $envVars := merge (deepCopy .Values.landing.envVars) (deepCopy .Values.landing.envVarsFrom) -}}
{{- include "socialRegistry.baseEnvVars" (dict "envVars" $envVars "context" $) }}
{{- end -}}
41 changes: 0 additions & 41 deletions charts/openg2p-social-registry/templates/gateway.yaml

This file was deleted.

96 changes: 96 additions & 0 deletions charts/openg2p-social-registry/templates/landing/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{{- if .Values.landing.enabled }}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}-landing
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.landing.commonLabels "context" $) | nindent 4 }}
{{- if .Values.landing.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.landing.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.landing.replicaCount }}
{{- if .Values.landing.updateStrategy }}
strategy: {{- toYaml .Values.landing.updateStrategy | nindent 4 }}
{{- end }}
selector:
matchLabels: {{- include "common.labels.matchLabels" (dict "customLabels" .Values.landing.podLabels "context" $) | nindent 6 }}
template:
metadata:
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.landing.podLabels "context" $) | nindent 8 }}
{{- if .Values.landing.podAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.landing.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
{{- /* Using Odoo Service Account name for now */}}
serviceAccountName: {{ include "odoo.serviceAccountName" .Subcharts.odoo }}
{{- include "common.images.pullSecrets" (dict "images" (list .Values.landing.image) "global" .Values.global) | nindent 6 }}
{{- if .Values.landing.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.landing.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.landing.affinity }}
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.landing.affinity "context" $) | nindent 8 }}
{{- else }}
affinity:
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.landing.podAffinityPreset "context" $) | nindent 10 }}
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.landing.podAntiAffinityPreset "context" $) | nindent 10 }}
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.landing.nodeAffinityPreset.type "key" .Values.landing.nodeAffinityPreset.key "values" .Values.landing.nodeAffinityPreset.values) | nindent 10 }}
{{- end }}
{{- if .Values.landing.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.landing.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.landing.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.landing.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.landing.priorityClassName }}
priorityClassName: {{ .Values.landing.priorityClassName | quote }}
{{- end }}
{{- if .Values.landing.podSecurityContext.enabled }}
securityContext: {{- omit .Values.landing.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.landing.initContainers }}
initContainers:
{{- include "common.tplvalues.render" (dict "value" .Values.landing.initContainers "context" $) | nindent 8 }}
{{- end }}
containers:
- name: landing-page
image: {{ include "common.images.image" (dict "imageRoot" .Values.landing.image "global" .Values.global) }}
imagePullPolicy: {{ .Values.landing.image.pullPolicy }}
{{- if .Values.landing.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.landing.lifecycleHooks "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.landing.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.landing.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.landing.command "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.args }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.landing.args "context" $) | nindent 12 }}
{{- end }}
env:
{{- include "socialRegistry.landing.envVars" . | nindent 12 }}
ports:
- name: http
containerPort: {{ .Values.landing.containerPort }}
{{- if .Values.landing.resources }}
resources: {{- toYaml .Values.landing.resources | nindent 12 }}
{{- end }}
{{- if .Values.landing.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.landing.startupProbe "enabled") "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.landing.livenessProbe "enabled") "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.landing.readinessProbe "enabled") "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.extraVolumeMounts }}
volumeMounts: {{- include "common.tplvalues.render" (dict "value" .Values.landing.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.landing.sidecars }}
{{- include "common.tplvalues.render" ( dict "value" .Values.landing.sidecars "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.landing.extraVolumes }}
volumes: {{- include "common.tplvalues.render" (dict "value" .Values.landing.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/openg2p-social-registry/templates/landing/gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.landing.enabled }}
{{- if .Values.landing.istio.enabled }}
{{- if .Values.landing.istio.gateway.enabled }}
{{- $istioGatewayHostname := include "common.tplvalues.render" (dict "value" .Values.landing.istio.gateway.host "context" $) }}
{{- $mainHostname := include "common.tplvalues.render" (dict "value" .Values.landing.hostname "context" $) }}
{{- $hostname := default $mainHostname $istioGatewayHostname }}
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: {{ include "common.names.fullname" . }}-landing
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.landing.commonLabels "context" $) | nindent 4 }}
{{- if .Values.landing.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.landing.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
selector:
{{ toYaml .Values.landing.istio.gateway.ingressController | nindent 4 }}
servers:
{{- if .Values.landing.istio.gateway.httpEnabled }}
- port:
name: http2
number: 8080
protocol: HTTP2
hosts:
- {{ $hostname | quote }}
{{- if .Values.landing.istio.gateway.httpTlsRedirect }}
tls:
httpsRedirect: true
{{- end }}
{{- end }}
{{- if .Values.landing.istio.gateway.httpsEnabled }}
- port:
name: https
number: 8443
protocol: HTTPS
hosts:
- {{ $hostname | quote }}
tls:
{{ toYaml (omit .Values.landing.istio.gateway.tls "enabled") | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/openg2p-social-registry/templates/landing/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.landing.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}-landing
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.landing.commonLabels "context" $) | nindent 4 }}
{{- if .Values.landing.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.landing.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.landing.service.type }}
{{- if (or (eq .Values.landing.service.type "LoadBalancer") (eq .Values.landing.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.landing.service.externalTrafficPolicy | quote }}
{{- end }}
{{ if eq .Values.landing.service.type "LoadBalancer" }}
loadBalancerSourceRanges: {{ .Values.landing.service.loadBalancerSourceRanges }}
{{ end }}
{{- if (and (eq .Values.landing.service.type "LoadBalancer") (not (empty .Values.landing.service.loadBalancerIP))) }}
loadBalancerIP: {{ .Values.landing.service.loadBalancerIP }}
{{- end }}
ports:
- name: http
port: {{ .Values.landing.service.port }}
protocol: TCP
targetPort: {{ .Values.landing.containerPort }}
selector: {{- include "common.labels.matchLabels" (dict "customLabels" .Values.landing.podLabels "context" $) | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.landing.enabled }}
{{- if .Values.landing.istio.enabled }}
{{- if .Values.landing.istio.virtualservice.enabled }}
{{- $istioVsHostname := include "common.tplvalues.render" (dict "value" .Values.landing.istio.virtualservice.host "context" $) }}
{{- $mainHostname := include "common.tplvalues.render" (dict "value" .Values.landing.hostname "context" $) }}
{{- $hostname := default $mainHostname $istioVsHostname }}
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ include "common.names.fullname" . }}-landing
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.landing.commonLabels "context" $) | nindent 4 }}
{{- if .Values.landing.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.landing.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
hosts:
- {{ $hostname | quote }}
gateways:
- {{ default (include "common.names.fullname" .) .Values.landing.istio.virtualservice.gateway }}
http:
- headers:
request:
set:
x-forwarded-host: {{ $hostname | quote }}
x-forwarded-proto: https
match:
- uri:
prefix: {{ .Values.landing.istio.virtualservice.prefix }}
{{- if .Values.landing.istio.virtualservice.rewriteUri }}
rewrite:
uri: {{ .Values.landing.istio.virtualservice.rewriteUri }}
{{- end }}
route:
- destination:
host: {{ include "common.tplvalues.render" (dict "value" .Values.landing.istio.virtualservice.destination "context" $) }}
port:
number: {{ include "common.tplvalues.render" (dict "value" .Values.landing.istio.virtualservice.destinationPort "context" $) }}
{{- end }}
{{- end }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/openg2p-social-registry/templates/odoo/gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- if .Values.odoo.enabled }}
{{- if .Values.odoo.istio.enabled }}
{{- if .Values.odoo.istio.gateway.enabled }}
{{- $istioGatewayHostname := include "common.tplvalues.render" (dict "value" .Values.odoo.istio.gateway.host "context" .Subcharts.odoo) }}
{{- $mainHostname := include "common.tplvalues.render" (dict "value" .Values.odoo.hostname "context" .Subcharts.odoo) }}
{{- $hostname := default $mainHostname $istioGatewayHostname }}
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: {{ include "common.names.fullname" .Subcharts.odoo }}
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.odoo.commonLabels "context" .Subcharts.odoo) | nindent 4 }}
{{- if .Values.odoo.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.odoo.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
selector:
{{ toYaml .Values.odoo.istio.gateway.ingressController | nindent 4 }}
servers:
{{- if .Values.odoo.istio.gateway.httpEnabled }}
- port:
name: http2
number: 8080
protocol: HTTP2
hosts:
- {{ $hostname | quote }}
{{- if .Values.odoo.istio.gateway.httpTlsRedirect }}
tls:
httpsRedirect: true
{{- end }}
{{- end }}
{{- if .Values.odoo.istio.gateway.httpsEnabled }}
- port:
name: https
number: 8443
protocol: HTTPS
hosts:
- {{ $hostname | quote }}
tls:
{{ toYaml (omit .Values.odoo.istio.gateway.tls "enabled") | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
40 changes: 40 additions & 0 deletions charts/openg2p-social-registry/templates/odoo/virtualservice.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.odoo.enabled }}
{{- if .Values.odoo.istio.enabled }}
{{- if .Values.odoo.istio.virtualservice.enabled }}
{{- $istioVsHostname := include "common.tplvalues.render" (dict "value" .Values.odoo.istio.virtualservice.host "context" .Subcharts.odoo) }}
{{- $mainHostname := include "common.tplvalues.render" (dict "value" .Values.odoo.hostname "context" .Subcharts.odoo) }}
{{- $hostname := default $mainHostname $istioVsHostname }}
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: {{ include "common.names.fullname" .Subcharts.odoo }}
labels: {{ include "common.labels.standard" (dict "customLabels" .Values.odoo.commonLabels "context" .Subcharts.odoo) | nindent 4 }}
{{- if .Values.odoo.commonAnnotations }}
annotations: {{ include "common.tplvalues.render" (dict "value" .Values.odoo.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
spec:
hosts:
- {{ $hostname | quote }}
gateways:
- {{ default (include "common.names.fullname" .) .Values.odoo.istio.virtualservice.gateway }}
http:
- headers:
request:
set:
x-forwarded-host: {{ $hostname | quote }}
x-forwarded-proto: https
match:
- uri:
prefix: {{ .Values.odoo.istio.virtualservice.prefix }}
{{- if .Values.odoo.istio.virtualservice.rewriteUri }}
rewrite:
uri: {{ .Values.odoo.istio.virtualservice.rewriteUri }}
{{- end }}
route:
- destination:
host: {{ include "common.tplvalues.render" (dict "value" .Values.odoo.istio.virtualservice.destination "context" .Subcharts.odoo) }}
port:
number: {{ include "common.tplvalues.render" (dict "value" .Values.odoo.istio.virtualservice.destinationPort "context" .Subcharts.odoo) }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ spec:
x-forwarded-proto: https
route:
- destination:
host: {{ include "common.tplvalues.render" (dict "value" .Values.superset.istio.virtualservice.destination "context" $) }}
host: {{ include "common.tplvalues.render" (dict "value" .Values.superset.istio.virtualservice.destination "context" .Subcharts.superset) }}
port:
number: {{ include "common.tplvalues.render" (dict "value" .Values.superset.istio.virtualservice.destinationPort "context" $) }}
number: {{ include "common.tplvalues.render" (dict "value" .Values.superset.istio.virtualservice.destinationPort "context" .Subcharts.superset) }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit df6875c

Please sign in to comment.