コード例 #1
0
    def run_bootstrap(self, request, kubernetes, k8s_version,
                      use_docker_for_e2e):
        cert_path = os.path.dirname(kubernetes["api-cert"])
        docker_args = use_docker_for_e2e(
            request, cert_path, "bootstrap", k8s_version, get_unbound_port(),
            kubernetes['container-to-container-server-ip'])
        server = kubernetes[
            'container-to-container-server'] if docker_args else kubernetes[
                "host-to-container-server"]
        args = [
            "fiaas-deploy-daemon-bootstrap",
            "--debug",
            "--api-server",
            server,
            "--api-cert",
            kubernetes["api-cert"],
            "--client-cert",
            kubernetes["client-cert"],
            "--client-key",
            kubernetes["client-key"],
        ]
        if crd_supported(k8s_version):
            args.append("--enable-crd-support")

        args = docker_args + args
        bootstrap = subprocess.Popen(args,
                                     stdout=sys.stderr,
                                     env=merge_dicts(os.environ,
                                                     {"NAMESPACE": "default"}))
        return bootstrap.wait()
コード例 #2
0
    def run_bootstrap(self, kubernetes, k8s_version, use_docker_for_e2e):
        args = [
            "fiaas-deploy-daemon-bootstrap",
            "--debug",
            "--api-server",
            kubernetes["server"],
            "--api-cert",
            kubernetes["api-cert"],
            "--client-cert",
            kubernetes["client-cert"],
            "--client-key",
            kubernetes["client-key"],
        ]
        if tpr_supported(k8s_version):
            args.append("--enable-tpr-support")
        if crd_supported(k8s_version):
            args.append("--enable-crd-support")
        cert_path = os.path.dirname(kubernetes["api-cert"])
        args = use_docker_for_e2e(cert_path, "bootstrap", k8s_version,
                                  get_unbound_port()) + args

        bootstrap = subprocess.Popen(args,
                                     stdout=sys.stderr,
                                     env=merge_dicts(os.environ,
                                                     {"NAMESPACE": "default"}))
        return bootstrap.wait()
コード例 #3
0
    def fdd(self, request, kubernetes, service_type, k8s_version, use_docker_for_e2e):
        port = get_unbound_port()
        cert_path = os.path.dirname(kubernetes["api-cert"])
        docker_args = use_docker_for_e2e(request, cert_path, service_type, k8s_version, port,
                                         kubernetes['container-to-container-server-ip'])
        server = kubernetes['container-to-container-server'] if docker_args else kubernetes["host-to-container-server"]
        args = [
            "fiaas-deploy-daemon",
            "--port", str(port),
            "--api-server", server,
            "--api-cert", kubernetes["api-cert"],
            "--client-cert", kubernetes["client-cert"],
            "--client-key", kubernetes["client-key"],
            "--service-type", service_type,
            "--ingress-suffix", "svc.test.example.com",
            "--environment", "test",
            "--datadog-container-image", "DATADOG_IMAGE:tag",
            "--strongbox-init-container-image", "STRONGBOX_IMAGE",
            "--secret-init-containers", "parameter-store=PARAM_STORE_IMAGE",
            "--use-ingress-tls", "default_off",
        ]
        if crd_supported(k8s_version):
            args.append("--enable-crd-support")
        args = docker_args + args
        fdd = subprocess.Popen(args, stdout=sys.stderr, env=merge_dicts(os.environ, {"NAMESPACE": "default"}))
        time.sleep(1)
        if fdd.poll() is not None:
            pytest.fail("fiaas-deploy-daemon has crashed after startup, inspect logs")

        def ready():
            resp = requests.get("http://localhost:{}/healthz".format(port), timeout=TIMEOUT)
            resp.raise_for_status()

        try:
            wait_until(ready, "web-interface healthy", RuntimeError, patience=PATIENCE)
            if crd_supported(k8s_version):
                wait_until(crd_available(kubernetes, timeout=TIMEOUT), "CRD available", RuntimeError, patience=PATIENCE)
            yield "http://localhost:{}/fiaas".format(port)
        finally:
            self._end_popen(fdd)