TW-1024: Add the name resolution for tip.jfrog.io in the initcontainer's

/etc/hosts only when the deployment is running on MAC, since the pods running in
kubernetes cluster on MAC cannot reach the DNS Server for resolving hostnames.
This commit is contained in:
Rahul Sharma
2020-08-11 12:40:00 -04:00
parent d21ece966c
commit 72aad7e18f
9 changed files with 60 additions and 19 deletions

View File

@@ -4,6 +4,7 @@
{{- $mqtt := include "mqtt.service" . -}}
{{- $ns := include "common.namespace" . -}}
{{- $file_store_path := include "filestore.dir.name" . -}}
{{- $cloudeployment := .Values.global.isCloudDeployment -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -72,7 +73,11 @@ spec:
- sh
- -c
- |
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apk add curl
url=https://{{ $icc }}/ping
counter=0
@@ -100,7 +105,11 @@ spec:
- sh
- -c
- |
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apk add curl
url=https://{{ $prov }}/ping
counter=0
@@ -127,7 +136,11 @@ spec:
- sh
- -c
- |
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apk add curl
url=https://{{ $ssc }}/ping
counter=0

View File

@@ -1,6 +1,7 @@
{{- if .Values.global.integratedDeployment }}
{{- $pg := include "postgresql.service" . -}}
{{- $ns := include "common.namespace" . -}}
{{- $cloudeployment := .Values.global.isCloudDeployment -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -54,15 +55,19 @@ spec:
- sh
- -c
- |
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "34.214.79.168 tip.jfrog.io" >> /etc/hosts
echo "151.101.128.204 security.debian.org" >> /etc/hosts
echo "151.101.126.133 deb.debian.org" >> /etc/hosts
echo "147.75.85.69 apt.postgresql.org" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "34.215.47.158 tip-tip-wlan-cloud-docker-repo.jfrog.io" >> /etc/hosts
echo "151.101.128.204 security.debian.org" >> /etc/hosts
echo "151.101.126.133 deb.debian.org" >> /etc/hosts
echo "147.75.85.69 apt.postgresql.org" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apt update
apt -y install curl
echo "***** Fetching cloud-sdk-schema-postgresql.sql from JFrog *****"
curl -u$SCHEMA_REPO_USER:$SCHEMA_REPO_PASSWORD -O "https://tip.jfrog.io/artifactory/tip-wlan-cloud-schemas/0.0.1-SNAPSHOT/sql/cloud-sdk-schema-postgresql.sql"
curl -u$SCHEMA_REPO_USER:$SCHEMA_REPO_PASSWORD -O "https://tip-tip-wlan-cloud-docker-repo.jfrog.io/artifactory/tip-wlan-cloud-schemas/0.0.1-SNAPSHOT/sql/cloud-sdk-schema-postgresql.sql"
echo "***** Now executing cloud-sdk-schema-postgresql.sql and creating/updating schema on Postgres instance *****"
PGPASSWORD=$POSTGRES_PASSWORD psql -h tip-wlan-postgresql-headless -U postgres -f cloud-sdk-schema-postgresql.sql
exit

View File

@@ -1,5 +1,6 @@
{{- $pg := include "postgresql.service" . -}}
{{- $ns := include "common.namespace" . -}}
{{- $cloudeployment := .Values.global.isCloudDeployment -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -57,11 +58,15 @@ spec:
- sh
- -c
- |
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "34.223.150.107 tip-tip-wlan-cloud-docker-repo.jfrog.io" >> /etc/hosts
echo "151.101.128.204 security.debian.org" >> /etc/hosts
echo "151.101.126.133 deb.debian.org" >> /etc/hosts
echo "147.75.85.69 apt.postgresql.org" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "151.101.112.249 dl-cdn.alpinelinux.org" >> /etc/hosts
echo "34.215.47.158 tip-tip-wlan-cloud-docker-repo.jfrog.io" >> /etc/hosts
echo "151.101.128.204 security.debian.org" >> /etc/hosts
echo "151.101.126.133 deb.debian.org" >> /etc/hosts
echo "147.75.85.69 apt.postgresql.org" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apt update
apt -y install curl
echo "***** Fetching latest cloud-sdk-schema-postgresql for DB and Tables sql from JFrog *****"

View File

@@ -1,6 +1,7 @@
{{- $kafka := include "kafka.service" . -}}
{{- $cassandra := include "cassandra.service" . -}}
{{- $ns := include "common.namespace" . -}}
{{- $cloudeployment := .Values.global.isCloudDeployment -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -52,9 +53,13 @@ spec:
- sh
- -c
- |
echo "91.189.88.152 security.ubuntu.com" >> /etc/hosts
echo "34.223.150.107 tip-tip-wlan-cloud-docker-repo.jfrog.io" >> /etc/hosts
echo "91.189.88.142 archive.ubuntu.com" >> /etc/hosts
if [ {{ $cloudeployment }} = false ]
then
echo "91.189.88.152 security.ubuntu.com" >> /etc/hosts
echo "34.215.47.158 tip-tip-wlan-cloud-docker-repo.jfrog.io" >> /etc/hosts
echo "91.189.88.142 archive.ubuntu.com" >> /etc/hosts
echo "Added name-resolution for local deployments"
fi
apt update
apt -y install curl
echo "***** Fetching cloud-sdk-schema-cassandra.cql from JFrog *****"

View File

@@ -30,7 +30,8 @@ global:
# Integrated Deployment which deploys Prov Service, Portal Service and
# SSC Service in a single docker image
integratedDeployment: true
# Is the Cluster deployed in Cloud
isCloudDeployment: false
# Annotations for namespace
annotations: {
"helm.sh/resource-policy": keep

View File

@@ -25,6 +25,9 @@ global:
# flag to enable debugging - application support required
debugEnabled: true
# Is the Cluster deployed in Cloud
isCloudDeployment: false
# Annotations for namespace
annotations: {
"helm.sh/resource-policy": keep

View File

@@ -27,6 +27,9 @@ global:
# flag to enable debugging - application support required
debugEnabled: true
# Is the Cluster deployed in Cloud
isCloudDeployment: false
# Annotations for namespace
annotations: {
"helm.sh/resource-policy": keep

View File

@@ -29,6 +29,9 @@ global:
# flag to enable debugging - application support required
debugEnabled: true
# Is the Cluster deployed in Cloud
isCloudDeployment: false
createReleaseNamespace: false
createDockerRegistrySecret: false

View File

@@ -31,7 +31,10 @@ global:
# Integrated Deployment which deploys Prov Service, Portal Service and
# SSC Service in a single docker image
integratedDeployment: false
integratedDeployment: false
# Is the Cluster deployed in Cloud
isCloudDeployment: true
# Namespace related
createReleaseNamespace: true