Skip to content

How to Run and Deploy IATs

hnandiwada edited this page Aug 16, 2019 · 2 revisions

Here are our findings:

bosh -n deploy <(bosh manifest) \
  -o ~/workspace/capi-ci/cf-deployment-operations/use-created-capi.yml \
  -o ~/workspace/istio-release/deploy/cf-deployment-operations/add-istio.yml \
  -v capi_release_dir="$HOME/workspace/capi-release" \
  -v system_domain=$BOSH_LITE_DOMAIN
  • The first time we tried that, it failed like this:
Task 156 | 21:41:20 | Updating instance database: database/779de088-9e39-420a-a1f4-90a7699afff9 (0) (canary) (00:00:56)
                    L Error: Action Failed get_task: Task 991094bd-d8fc-4163-485e-b59a157d322e result: 1 of 3 pre-start scripts failed. Failed Jobs: pxc-mysql. Successful Jobs: bpm, bosh-dns.
Task 156 | 21:42:16 | Error: Action Failed get_task: Task 991094bd-d8fc-4163-485e-b59a157d322e result: 1 of 3 pre-start scripts failed. Failed Jobs: pxc-mysql. Successful Jobs: bpm, bosh-dns.

Task 156 Started  Fri Jun 28 21:31:14 UTC 2019
Task 156 Finished Fri Jun 28 21:42:16 UTC 2019
Task 156 Duration 00:11:02
Task 156 error

Updating deployment:
  Expected task '156' to succeed but state is 'error'

Exit code 1

Error: Instance group 'istio-control' references an unknown vm type 'medium'

  • We changed istio-control vm-type from "medium" to "small" in the add-istio.yml ops file.

  • Then, we tried the same thing again after some time, and it succeeded!


Steps taken on 7/3

  • Asked networking team for an environment with Istio already set up

  • Deployed new CAPI:

    • Download bosh manifest: bosh -d manifest > /tmp/cf-manifest.yml
    • Update /tmp/cf-manifest.yml /releases/capi/version to be "latest"
    • In capi-release: bosh create-release --force --version=1.83.4+something1
    • In capi-release: bosh upload-release
    • bosh -d cf deploy /tmp/cf-manifest.yml --no-redact
  • Got CF admin password from credhub:

    • Search for credential: credhub g -n cf_admin_password
    • With the credential name: credhub g -n /bosh-tealtries/cf/cf_admin_password
  • Following README for IATs: https://github.com/cloudfoundry/istio-acceptance-tests

    • Made a config.json file:
cat << EOF > "${PWD}/config.json"
{
	"cf_system_domain": "bosh-lite.com",
	"cf_admin_user": "admin",
	"cf_admin_password": <admin password>,
	"cf_internal_apps_domain": "apps.internal",
	"cf_internal_istio_domain": "istio.apps.internal",
	"cf_istio_domain": "istio.<system-domain>",
	"product_page_docker_tag": "cfrouting/examples-bookinfo-productpage-v1:latest",
	"reviews_docker_tag": "cfrouting/examples-bookinfo-reviews-v3:latest",
	"ratings_docker_tag": "istio/examples-bookinfo-ratings-v1:1.5.0",
	"details_docker_tag": "istio/examples-bookinfo-details-v1:1.5.0",
	"wildcard_ca": "<envoy_wildcard_ca.ca>"
}
EOF
  • Filled in cf_admin_password, plus domains found in bosh-manifest.yml

  • Tried to run CONFIG="$PWD/config.json" scripts/test, but had to fix the following to make it work:

func CfWithCustomReporter(cmdStarter Starter, reporter Reporter, args ...string) *gexec.Session {
	request, err := cmdStarter.Start(reporter, "cf6", args...)
	if err != nil {
		panic(err)
	}

	return request
}

At this point, the IATs were able to run successfully.

We then tweaked weighted_routing_test to use the new route destinations API endpoint:

func mapWeightedRoute(routeGuid, appGuid1, appGuid2 string) {
	Expect(cf.Cf(
		"curl",
		fmt.Sprintf("/v3/routes/%s/destinations", routeGuid),
		"-H", "Content-type: application/json",
		"-X", "PATCH",
		"-d", fmt.Sprintf(`{
					"destinations": [{
        "app": {
          "guid": "%s"
        },
        "weight": 10
      },
      {
        "app": {
          "guid": "%s"
        },
        "weight": 90
      }
                    ]
				}`, appGuid1, appGuid2),
	).Wait(defaultTimeout)).To(Exit(0))
}

Then it worked!

Clone this wiki locally