diff --git a/smardigo/templates/connect/deployment.yml b/smardigo/templates/connect/deployment.yml index 26c93c2..2196ab1 100644 --- a/smardigo/templates/connect/deployment.yml +++ b/smardigo/templates/connect/deployment.yml @@ -132,5 +132,15 @@ spec: value: "true" ports: - containerPort: 8080 + initContainers: + - name: init-iam + image: busybox:1.28 + command: ['sh', '-c', "until nslookup iam; do echo waiting for iam; sleep 2; done"] + - name: init-postgres + image: busybox:1.28 + command: ['sh', '-c', "until nslookup {{ .Values.connect.datasource.host }}; do echo waiting for postgres; sleep 2; done"] + - name: init-elasticsearch + image: busybox:1.28 + command: ['sh', '-c', "until nslookup {{ .Values.connect.elastic.host }}; do echo waiting for elastic; sleep 2; done"] imagePullSecrets: - name: "{{ .Values.harbor.pull_secret }}" diff --git a/smardigo/templates/elastic/external-elastic-service.yml b/smardigo/templates/elastic/external-elastic-service.yml new file mode 100644 index 0000000..3736534 --- /dev/null +++ b/smardigo/templates/elastic/external-elastic-service.yml @@ -0,0 +1,60 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.sharedService.elastic.host01.name }}" +spec: + ports: + - protocol: TCP + port: 9200 + targetPort: 9200 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: "{{ .Values.sharedService.elastic.host01.name }}" +subsets: + - addresses: + - ip: {{ .Values.sharedService.elastic.host01.ip }} + ports: + - port: 9200 +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.sharedService.elastic.host02.name }}" +spec: + ports: + - protocol: TCP + port: 9200 + targetPort: 9200 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: "{{ .Values.sharedService.elastic.host02.name }}" +subsets: + - addresses: + - ip: {{ .Values.sharedService.elastic.host02.ip }} + ports: + - port: 9200 +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.sharedService.elastic.host03.name }}" +spec: + ports: + - protocol: TCP + port: 9200 + targetPort: 9200 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: "{{ .Values.sharedService.elastic.host03.name }}" +subsets: + - addresses: + - ip: {{ .Values.sharedService.elastic.host03.ip }} + ports: + - port: 9200 \ No newline at end of file diff --git a/smardigo/templates/maria/external-maria-service.yml b/smardigo/templates/maria/external-maria-service.yml new file mode 100644 index 0000000..c13112a --- /dev/null +++ b/smardigo/templates/maria/external-maria-service.yml @@ -0,0 +1,20 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.sharedService.maria.host.name }}" +spec: + ports: + - protocol: TCP + port: 3306 + targetPort: 3306 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: "{{ .Values.sharedService.maria.host.name }}" +subsets: + - addresses: + - ip: {{ .Values.sharedService.maria.host.ip }} + ports: + - port: 3306 \ No newline at end of file diff --git a/smardigo/templates/postgres/external-postgres-service.yml b/smardigo/templates/postgres/external-postgres-service.yml new file mode 100644 index 0000000..0ebda96 --- /dev/null +++ b/smardigo/templates/postgres/external-postgres-service.yml @@ -0,0 +1,20 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ .Values.sharedService.postgres.host.name }}" +spec: + ports: + - protocol: TCP + port: 5432 + targetPort: 5432 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: "{{ .Values.sharedService.postgres.host.name }}" +subsets: + - addresses: + - ip: {{ .Values.sharedService.postgres.host.ip }} + ports: + - port: 5432 diff --git a/smardigo/templates/wordpress/deployment.yml b/smardigo/templates/wordpress/deployment.yml index ba4fc13..692b3ba 100644 --- a/smardigo/templates/wordpress/deployment.yml +++ b/smardigo/templates/wordpress/deployment.yml @@ -16,10 +16,10 @@ spec: # runAsUser: 33 # runAsGroup: 33 # fsGroup: 33 -# volumes: -# - name: wordpress-content -# persistentVolumeClaim: -# claimName: wordpress-content-pvc + volumes: + - name: wordpress-content + persistentVolumeClaim: + claimName: wordpress-content-pvc hostAliases: - ip: "{{ .Values.sharedService.keycloak.host.ip }}" hostnames: @@ -88,8 +88,12 @@ spec: key: AUTH_TOKEN ports: - containerPort: 80 -# volumeMounts: -# - name: wordpress-content -# mountPath: /var/www/html/wp-content + initContainers: + - name: init-maria + image: busybox:1.28 + command: ['sh', '-c', "until nslookup {{ .Values.wordpress.database.host }}; do echo waiting for maria; sleep 2; done"] + volumeMounts: + - name: wordpress-content + mountPath: /var/www/html/wp-content imagePullSecrets: - name: "{{ .Values.harbor.pull_secret }}" diff --git a/smardigo/values.yaml b/smardigo/values.yaml index a80013c..b3f1b71 100644 --- a/smardigo/values.yaml +++ b/smardigo/values.yaml @@ -14,7 +14,7 @@ connect: username: "connect-admin" password: "connect-admin" database: - host: "10.0.0.19" + host: "dev-postgres-01" port: "5432" name: "dev_mobene_nsodev_connect" username: "dev_mobene_nsodev_connect" @@ -56,7 +56,7 @@ wordpress: version: "latest" name: "smardigo/wordpress" database: - host: "10.0.0.16" + host: "dev-maria-01" port: "3306" username: "dev_mobene_nsodev_connect_wordpress" password: "connect-wordpress-maria-admin"