Skip to content

Commit

Permalink
feat: Rename helm chart and its resources (#1104)
Browse files Browse the repository at this point in the history
Signed-off-by: Milos Backonja <milos.backonja@iohk.io>
  • Loading branch information
milosbackonja committed May 27, 2024
1 parent 4ac7a2e commit 84c5cea
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 65 deletions.
4 changes: 2 additions & 2 deletions infrastructure/charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: prism-agent
description: A Helm chart for deploying prism-agent
name: cloud-agent
description: A Helm chart for deploying cloud-agent
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/charts/agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{- end }}
{{- end -}}
{{- define "labels.common" -}}
app.kubernetes.io/part-of: prism-agent
app.kubernetes.io/part-of: {{ .Chart.Name }}
{{- end -}}
{{- define "headers.security" }}
- name: response-rewrite
Expand Down
20 changes: 10 additions & 10 deletions infrastructure/charts/agent/templates/apisixroute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
{{- end }}
paths:
- /prism-agent/*
- /cloud-agent/*
- /{{ .Chart.Name }}/*
backends:
- serviceName: agent-server-tapir-service
servicePort: 8085
Expand All @@ -27,7 +27,7 @@ spec:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/(prism-agent|cloud-agent)/(.*)","/$2"]
regex_uri: ["^/(prism-agent|{{ .Chart.Name }})/(.*)","/$2"]
- name: uri-blocker
enable: true
config:
Expand Down Expand Up @@ -57,15 +57,15 @@ spec:
{{- end }}
paths:
- /prism-agent/didcomm*
- /cloud-agent/didcomm*
- /{{ .Chart.Name }}/didcomm*
backends:
- serviceName: agent-server-didcomm-service
servicePort: 8090
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/(prism-agent|cloud-agent)/didcomm(.*)", "/$2"]
regex_uri: ["^/(prism-agent|{{ .Chart.Name }})/didcomm(.*)", "/$2"]
{{ template "cors" . }}
{{ template "headers.requestId" . }}
{{ template "headers.security" . }}
Expand All @@ -89,7 +89,7 @@ spec:
{{- end }}
paths:
- /prism-agent/schema-registry/schemas/*
- /cloud-agent/schema-registry/schemas/*
- /{{ .Chart.Name }}/schema-registry/schemas/*
methods:
- GET
backends:
Expand All @@ -99,7 +99,7 @@ spec:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/(prism-agent|cloud-agent)/schema-registry/schemas/(.*)", "/schema-registry/schemas/$2"]
regex_uri: ["^/(prism-agent|{{ .Chart.Name }})/schema-registry/schemas/(.*)", "/schema-registry/schemas/$2"]
{{ template "cors" . }}
{{ template "headers.requestId" . }}
{{ template "headers.security" . }}
Expand All @@ -123,7 +123,7 @@ spec:
{{- end }}
paths:
- /prism-agent/credential-definition-registry/definitions/*
- /cloud-agent/credential-definition-registry/definitions/*
- /{{ .Chart.Name }}/credential-definition-registry/definitions/*
methods:
- GET
backends:
Expand All @@ -133,7 +133,7 @@ spec:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/(prism-agent|cloud-agent)/credential-definition-registry/definitions/(.*)", "/credential-definition-registry/definitions/$2"]
regex_uri: ["^/(prism-agent|{{ .Chart.Name }})/credential-definition-registry/definitions/(.*)", "/credential-definition-registry/definitions/$2"]
{{ template "cors" . }}
{{ template "headers.requestId" . }}
{{ template "headers.security" . }}
Expand All @@ -157,15 +157,15 @@ spec:
{{- end }}
paths:
- /prism-agent/docs/*
- /cloud-agent/docs/*
- /{{ .Chart.Name }}/docs/*
backends:
- serviceName: agent-server-tapir-service
servicePort: 8085
plugins:
- name: proxy-rewrite
enable: true
config:
regex_uri: ["^/(prism-agent|cloud-agent)/docs/(.*)","/docs/$2"]
regex_uri: ["^/(prism-agent|{{ .Chart.Name }})/docs/(.*)","/docs/$2"]
{{ template "cors" . }}
{{ template "headers.requestId" . }}
{{ template "headers.security" . }}
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/charts/agent/templates/apisixtls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apisix.apache.org/v2
kind: ApisixTls
metadata:
name: "prism-agent-base-path-tls"
name: "{{ .Chart.Name }}-base-path-tls"
namespace: "{{ .Release.Namespace }}"
labels:
{{ template "labels.common" . }}
Expand All @@ -12,6 +12,6 @@ spec:
- {{ . }}
{{- end }}
secret:
name: "prism-agent-base-path-secret"
name: "{{ .Chart.Name }}-base-path-secret"
namespace: "{{ .Release.Namespace }}"
{{- end }}
4 changes: 2 additions & 2 deletions infrastructure/charts/agent/templates/certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: "prism-agent-base-path-cert"
name: "{{ .Chart.Name }}-base-path-cert"
namespace: "{{ .Release.Namespace }}"
labels:
{{ template "labels.common" . }}
annotations:
argocd.argoproj.io/sync-wave: "-1"
spec:
secretName: "prism-agent-base-path-secret"
secretName: "{{ .Chart.Name }}-base-path-secret"
duration: 2160h0m0s # 90d
renewBefore: 360h0m0s # 15d
issuerRef:
Expand Down
14 changes: 7 additions & 7 deletions infrastructure/charts/agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ data:
KEYCLOAK_ADMIN_USER=$KEYCLOAK_ADMIN_USER
KEYCLOAK_ADMIN_PASSWORD=$KEYCLOAK_ADMIN_PASSWORD
REALM_NAME=$REALM_NAME
PRISM_AGENT_CLIENT_ID=$PRISM_AGENT_CLIENT_ID
PRISM_AGENT_CLIENT_SECRET=$PRISM_AGENT_CLIENT_SECRET
CLOUD_AGENT_CLIENT_ID=$CLOUD_AGENT_CLIENT_ID
CLOUD_AGENT_CLIENT_SECRET=$CLOUD_AGENT_CLIENT_SECRET
function get_admin_token() {
local response=$(
Expand Down Expand Up @@ -68,10 +68,10 @@ data:
echo "Getting admin access token ..."
ADMIN_ACCESS_TOKEN=$(get_admin_token)
CLIENT_EXIST=$(is_client_exists $ADMIN_ACCESS_TOKEN $PRISM_AGENT_CLIENT_ID)
CLIENT_EXIST=$(is_client_exists $ADMIN_ACCESS_TOKEN $CLOUD_AGENT_CLIENT_ID)
if [ $CLIENT_EXIST == "false" ]; then
echo "Creating a new $PRISM_AGENT_CLIENT_ID client ..."
create_client $ADMIN_ACCESS_TOKEN $PRISM_AGENT_CLIENT_ID $PRISM_AGENT_CLIENT_SECRET
echo "Creating a new $CLOUD_AGENT_CLIENT_ID client ..."
create_client $ADMIN_ACCESS_TOKEN $CLOUD_AGENT_CLIENT_ID $CLOUD_AGENT_CLIENT_SECRET
fi
{{- if .Values.keycloak.enabled }}
Expand All @@ -81,9 +81,9 @@ data:
apiVersion: v1
kind: ConfigMap
metadata:
name: prism-agent-realm-import
name: {{ .Chart.Name }}-realm-import
data:
prism-agent.json: |
{{ .Chart.Name }}.json: |
{
"realm": {{ .Values.server.keycloak.realm | quote }},
"enabled": true
Expand Down
48 changes: 24 additions & 24 deletions infrastructure/charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: prism-agent-server
name: {{ .Chart.Name }}-server
namespace: "{{ .Release.Namespace }}"
labels:
{{ template "labels.common" . }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: prism-agent-server
app.kubernetes.io/name: {{ .Chart.Name }}-server
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/name: prism-agent-server
app.kubernetes.io/name: {{ .Chart.Name }}-server
{{ template "labels.common" . }}
spec:
imagePullSecrets:
- name: atala-prism-dev-deployments-github-docker-registry-key
initContainers:
- name: wait-postgress-ready
image: busybox
command: ['sh', '-c', "until nc -z {{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.{{.Release.Namespace}} 5432; do echo waiting for postgress-operator; sleep 2; done;"]
command: ['sh', '-c', "until nc -z {{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.{{.Release.Namespace}} 5432; do echo waiting for postgress-operator; sleep 2; done;"]
{{- if .Values.server.keycloak.enabled }}
- name: wait-keycloak-ready
image: badouralix/curl-jq:ubuntu
Expand All @@ -40,9 +40,9 @@ spec:
{{- toYaml .Values.server.keycloak.admin.password | nindent 12 }}
- name: REALM_NAME
value: {{ .Values.server.keycloak.realm }}
- name: PRISM_AGENT_CLIENT_ID
- name: CLOUD_AGENT_CLIENT_ID
value: {{ .Values.server.keycloak.client.clientId }}
- name: PRISM_AGENT_CLIENT_SECRET
- name: CLOUD_AGENT_CLIENT_SECRET
valueFrom:
{{- toYaml .Values.server.keycloak.client.clientSecret | nindent 12 }}
volumeMounts:
Expand All @@ -52,7 +52,7 @@ spec:
{{- end }}
{{- end }}
containers:
- name: prism-agent-server
- name: {{ .Chart.Name }}-server
image: "{{ .Values.server.image.repository }}/{{ .Values.server.image.tag }}:{{ .Values.server.image.version | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
livenessProbe:
Expand All @@ -78,99 +78,99 @@ spec:
key: salt
optional: false
- name: POLLUX_DB_HOST
value: "{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.{{.Release.Namespace}}"
value: "{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.{{.Release.Namespace}}"
- name: POLLUX_DB_PORT
value: "5432"
- name: POLLUX_DB_NAME
value: pollux
- name: POLLUX_DB_USER
valueFrom:
secretKeyRef:
name: pollux-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: pollux-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: POLLUX_DB_PASSWORD
valueFrom:
secretKeyRef:
name: pollux-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: pollux-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: POLLUX_DB_APP_USER
valueFrom:
secretKeyRef:
name: pollux-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: pollux-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: POLLUX_DB_APP_PASSWORD
valueFrom:
secretKeyRef:
name: pollux-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: pollux-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: CONNECT_DB_HOST
value: "{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.{{.Release.Namespace}}"
value: "{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.{{.Release.Namespace}}"
- name: CONNECT_DB_PORT
value: "5432"
- name: CONNECT_DB_NAME
value: connect
- name: CONNECT_DB_USER
valueFrom:
secretKeyRef:
name: connect-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: connect-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: CONNECT_DB_PASSWORD
valueFrom:
secretKeyRef:
name: connect-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: connect-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: CONNECT_DB_APP_USER
valueFrom:
secretKeyRef:
name: connect-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: connect-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: CONNECT_DB_APP_PASSWORD
valueFrom:
secretKeyRef:
name: connect-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: connect-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: AGENT_DB_HOST
value: "{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.{{.Release.Namespace}}"
value: "{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.{{.Release.Namespace}}"
- name: AGENT_DB_PORT
value: "5432"
- name: AGENT_DB_NAME
value: agent
- name: AGENT_DB_USER
valueFrom:
secretKeyRef:
name: agent-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: agent-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: AGENT_DB_PASSWORD
valueFrom:
secretKeyRef:
name: agent-admin.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: agent-admin.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: AGENT_DB_APP_USER
valueFrom:
secretKeyRef:
name: agent-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: agent-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: username
optional: false
- name: AGENT_DB_APP_PASSWORD
valueFrom:
secretKeyRef:
name: agent-application-user.{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster.credentials.postgresql.acid.zalan.do
name: agent-application-user.{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster.credentials.postgresql.acid.zalan.do
key: password
optional: false
- name: DIDCOMM_SERVICE_URL
value: "https://{{ index .Values.ingress.applicationUrls 0 }}/cloud-agent/didcomm"
value: "https://{{ index .Values.ingress.applicationUrls 0 }}/{{ .Chart.Name }}/didcomm"
- name: REST_SERVICE_URL
value: "https://{{ index .Values.ingress.applicationUrls 0 }}/cloud-agent"
value: "https://{{ index .Values.ingress.applicationUrls 0 }}/{{ .Chart.Name }}"
- name: PRISM_NODE_HOST
value: {{ .Values.vdrManager.host | quote }}
- name: PRISM_NODE_PORT
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/charts/agent/templates/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: "acid.zalan.do/v1"
kind: postgresql
metadata:
name: "{{ .Values.database.postgres.managingTeam }}-prism-agent-postgres-cluster"
name: "{{ .Values.database.postgres.managingTeam }}-{{ .Chart.Name }}-postgres-cluster"
namespace: {{ .Release.Namespace }}
labels:
{{ template "labels.common" . }}
Expand Down
Loading

0 comments on commit 84c5cea

Please sign in to comment.