def dd_environment(): with kind_run(conditions=[setup_cert_manager]) as kubeconfig: with ExitStack() as stack: ip_ports_metrics = [ stack.enter_context( port_forward(kubeconfig, 'gatekeeper-system', 'gatekeeper-controller-manager', METRICS_PORT)) ] ip_ports_health = [ stack.enter_context( port_forward(kubeconfig, 'gatekeeper-system', 'gatekeeper-controller-manager', HEALTH_PORT)) ] instances = { 'instances': [ { 'prometheus_url': 'http://{}:{}/metrics'.format(*ip_ports_metrics[0]), 'gatekeeper_health_endpoint': 'http://{}:{}/'.format(*ip_ports_health[0]), }, ] } yield instances
def dd_environment(): with terraform_run(os.path.join(get_here(), 'terraform')) as outputs: kubeconfig = outputs['kubeconfig']['value'] with ExitStack() as stack: ip_ports = [ stack.enter_context( port_forward(kubeconfig, 'istio-system', deployment, port)) for (deployment, port) in DEPLOYMENTS ] instance = { 'citadel_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[0]), 'galley_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[1]), 'pilot_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[2]), 'mixer_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[3]), 'istio_mesh_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[4]), } page = 'http://{}:{}/productpage'.format(*ip_ports[5]) # Check a bit to make sure it's available CheckEndpoints([page], wait=5)() for _ in range(5): # Generate some traffic requests.get(page) yield instance
def dd_environment(): with terraform_run(os.path.join(HERE, 'terraform')) as outputs: kubeconfig = outputs['kubeconfig']['value'] with ExitStack() as stack: ip_ports = [ stack.enter_context( port_forward(kubeconfig, 'cilium', 'cilium-operator', port)) for port in PORTS ] instances = { 'instances': [ { 'agent_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[0]), 'metrics': ADDL_AGENT_METRICS + AGENT_DEFAULT_METRICS, }, { 'operator_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[1]), 'metrics': OPERATOR_METRICS + OPERATOR_AWS_METRICS, }, ] } yield instances
def dd_environment(): with kind_run(conditions=[setup_linkerd_cluster]) as kubeconfig: compose_file = os.path.join(HERE, "compose", "docker-compose.yaml") with docker_run( compose_file=compose_file, conditions=[ CheckDockerLogs(compose_file, 'LINKERD DEPLOY COMPLETE', wait=5, attempts=120) ], ): with ExitStack() as stack: ip, port = stack.enter_context( port_forward(kubeconfig, 'linkerd', 4191, 'deployment', 'linkerd-controller')) instance = { 'prometheus_url': 'http://{ip}:{port}/metrics'.format(ip=ip, port=port), 'metrics': [LINKERD_FIXTURE_METRICS], 'type_overrides': LINKERD_FIXTURE_TYPES, } yield instance
def dd_environment(): version = os.environ.get("ISTIO_VERSION") with terraform_run(os.path.join(HERE, 'terraform', version)) as outputs: kubeconfig = outputs['kubeconfig']['value'] with ExitStack() as stack: if version == '1.5.1': istiod_host, istiod_port = stack.enter_context( port_forward(kubeconfig, 'istio-system', 'istiod', 8080)) instance = { 'istiod_endpoint': 'http://{}:{}/metrics'.format(istiod_host, istiod_port) } yield instance else: ip_ports = [ stack.enter_context( port_forward(kubeconfig, 'istio-system', deployment, port)) for (deployment, port) in DEPLOYMENTS_LEGACY ] instance = { 'instances': [ { 'citadel_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[0]), 'galley_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[1]), 'pilot_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[2]), 'mixer_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[3]), }, { 'istio_mesh_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[4]) }, ] } page = 'http://{}:{}/productpage'.format(*ip_ports[5]) # Check a bit to make sure it's available CheckEndpoints([page], wait=5)() for _ in range(5): # Generate some traffic requests.get(page) yield instance
def dd_environment(): with terraform_run(os.path.join(get_here(), 'terraform')) as outputs: kubeconfig = to_native_string(outputs['kubeconfig']['value']) with port_forward(kubeconfig, 'linkerd', 'linkerd-controller', 4191) as (ip, port): instance = { 'prometheus_url': 'http://{}:{}/metrics'.format(ip, port), 'metrics': [LINKERD_FIXTURE_METRICS], 'type_overrides': LINKERD_FIXTURE_TYPES, } yield instance
def dd_environment(): with kind_run(conditions=[setup_cert_manager]) as kubeconfig: with ExitStack() as stack: ip_ports = [stack.enter_context(port_forward(kubeconfig, 'cert-manager', 'cert-manager', PORT))] instances = { 'instances': [ {'prometheus_url': 'http://{}:{}/metrics'.format(*ip_ports[0])}, ] } yield instances
def dd_environment(): with kind_run(conditions=[setup_cilium]) as kubeconfig: with ExitStack() as stack: ip_ports = [ stack.enter_context(port_forward(kubeconfig, 'cilium', 'cilium-operator', port)) for port in PORTS ] instances = { 'instances': [ {'agent_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[0])}, {'operator_endpoint': 'http://{}:{}/metrics'.format(*ip_ports[1])}, ] } yield instances
def dd_environment(): with kind_run(conditions=[setup_calico], kind_config=path.join(HERE, 'kind-calico.yaml')) as kubeconfig: with ExitStack() as stack: calico_host, calico_port = stack.enter_context( port_forward(kubeconfig, 'kube-system', 9091, 'service', 'felix-metrics-svc')) instance = { "openmetrics_endpoint": 'http://{}:{}/metrics'.format(calico_host, calico_port), "namespace": NAMESPACE, "extra_metrics": EXTRA_METRICS, } yield instance
def dd_environment(dd_save_state): with kind_run(conditions=[setup_istio]) as kubeconfig: with ExitStack() as stack: if VERSION == '1.13.3': istiod_host, istiod_port = stack.enter_context( port_forward(kubeconfig, 'istio-system', 15014, 'deployment', 'istiod')) istiod_endpoint = 'http://{}:{}/metrics'.format( istiod_host, istiod_port) instance = { 'istiod_endpoint': istiod_endpoint, 'use_openmetrics': 'false' } # save this instance to use for openmetrics_v2 instance, since the endpoint is different each run dd_save_state("istio_instance", instance) yield instance
def dd_environment(): use_openmetrics = CILIUM_LEGACY == 'false' kind_config = os.path.join(HERE, 'kind', 'kind-config.yaml') with TempDir('helm_dir') as helm_dir: with kind_run( conditions=[setup_cilium], kind_config=kind_config, env_vars={ "HELM_CACHE_HOME": path_join(helm_dir, 'Caches'), "HELM_CONFIG_HOME": path_join(helm_dir, 'Preferences'), }, ) as kubeconfig: with ExitStack() as stack: ip_ports = [ stack.enter_context( port_forward(kubeconfig, 'cilium', port, 'deployment', 'cilium-operator')) for port in PORTS ] instances = get_instances(ip_ports[0][0], ip_ports[0][1], ip_ports[1][0], ip_ports[1][1], use_openmetrics) yield instances