Skip to content

Add cluster config for kind create cluster command - #908

Merged
ChrsMark merged 10 commits into
elastic:masterfrom
ChrsMark:kind_cluster_config
Apr 15, 2021
Merged

Add cluster config for kind create cluster command#908
ChrsMark merged 10 commits into
elastic:masterfrom
ChrsMark:kind_cluster_config

Conversation

@ChrsMark

Copy link
Copy Markdown
Member

What does this PR do?

This PR changes how we start kind cluster for k8s tests so as to be able to expose kube-proxy's metrics.

Related to #886, elastic/elastic-package#322, https://github.com/elastic/elastic-package/tree/master/internal/install

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark added the Team:Integrations Label for the Integrations team label Apr 14, 2021
@ChrsMark
ChrsMark requested a review from mtojek April 14, 2021 08:08
@ChrsMark ChrsMark self-assigned this Apr 14, 2021
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/integrations (Team:Integrations)

@elasticmachine

elasticmachine commented Apr 14, 2021

Copy link
Copy Markdown

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #908 updated

  • Start Time: 2021-04-15T10:03:51.354+0000

  • Duration: 40 min 50 sec

  • Commit: fb6fc9a

Test stats 🧪

Test Results
Failed 0
Passed 1921
Skipped 3
Total 1924

Trends 🧪

Image of Build Times

Image of Tests

Steps errors 1

Expand to view the steps failures

Boot up the Elastic stack
  • Took 2 min 29 sec . View more details on here
  • Description: ../../build/elastic-package stack up -d -v

Log output

Expand to view the last 100 lines of log output

[2021-04-15T10:42:41.495Z] 2021/04/15 10:42:41 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:41.495Z] 2021/04/15 10:42:41 DEBUG Wait until the policy (ID: 44556a30-9dd7-11eb-9146-41044a7bb154, revision: 2) is assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:44.034Z] 2021/04/15 10:42:43 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:44.034Z] 2021/04/15 10:42:43 DEBUG Policy revision assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:44.035Z] 2021/04/15 10:42:43 DEBUG checking for expected data in data stream...
[2021-04-15T10:42:44.035Z] 2021/04/15 10:42:43 DEBUG found 0 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:44.603Z] 2021/04/15 10:42:44 DEBUG found 0 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:45.541Z] 2021/04/15 10:42:45 DEBUG found 0 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:46.922Z] 2021/04/15 10:42:46 DEBUG found 0 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:47.862Z] 2021/04/15 10:42:47 DEBUG found 0 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:48.800Z] 2021/04/15 10:42:48 DEBUG found 2 hits in metrics-kubernetes.volume-ep data stream
[2021-04-15T10:42:48.800Z] 2021/04/15 10:42:48 DEBUG reassigning original policy back to agent...
[2021-04-15T10:42:48.800Z] 2021/04/15 10:42:48 DEBUG PUT http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b/reassign
[2021-04-15T10:42:52.093Z] 2021/04/15 10:42:51 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:52.093Z] 2021/04/15 10:42:51 DEBUG Wait until the policy (ID: 27b166d0-9dd3-11eb-9146-41044a7bb154, revision: 1) is assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:53.474Z] 2021/04/15 10:42:53 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:53.474Z] 2021/04/15 10:42:53 DEBUG Wait until the policy (ID: 27b166d0-9dd3-11eb-9146-41044a7bb154, revision: 1) is assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:56.013Z] 2021/04/15 10:42:55 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:56.013Z] 2021/04/15 10:42:55 DEBUG Wait until the policy (ID: 27b166d0-9dd3-11eb-9146-41044a7bb154, revision: 1) is assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:57.921Z] 2021/04/15 10:42:57 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:57.921Z] 2021/04/15 10:42:57 DEBUG Wait until the policy (ID: 27b166d0-9dd3-11eb-9146-41044a7bb154, revision: 1) is assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:59.828Z] 2021/04/15 10:42:59 DEBUG GET http://127.0.0.1:5601/api/fleet/agents/43a69c5e-45a5-46aa-a122-cf77c7dbe79b
[2021-04-15T10:42:59.828Z] 2021/04/15 10:42:59 DEBUG Policy revision assigned to the agent (ID: 43a69c5e-45a5-46aa-a122-cf77c7dbe79b)...
[2021-04-15T10:42:59.828Z] 2021/04/15 10:42:59 DEBUG deleting test policy...
[2021-04-15T10:42:59.828Z] 2021/04/15 10:42:59 DEBUG POST http://127.0.0.1:5601/api/fleet/agent_policies/delete
[2021-04-15T10:43:02.366Z] 2021/04/15 10:43:02 DEBUG tearing down service...
[2021-04-15T10:43:02.366Z] 2021/04/15 10:43:02 DEBUG tearing down service using docker compose runner
[2021-04-15T10:43:02.366Z] 2021/04/15 10:43:02 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/src/github.com/elastic/integrations/packages/kubernetes/_dev/deploy/docker/docker-compose.yml -p elastic-package-service down
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_kubernetes_1         ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_kubelet_1            ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_apiserver_1          ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_kube-state-metrics_1 ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_proxy_1              ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_scheduler_1          ... 
[2021-04-15T10:43:02.936Z] Stopping elastic-package-service_controllermanager_1  ... 
[2021-04-15T10:43:16.513Z] 
Stopping elastic-package-service_kubernetes_1         ... done

Stopping elastic-package-service_scheduler_1          ... done

Stopping elastic-package-service_kube-state-metrics_1 ... done

Stopping elastic-package-service_controllermanager_1  ... done

Stopping elastic-package-service_apiserver_1          ... done

Stopping elastic-package-service_proxy_1              ... done

Stopping elastic-package-service_kubelet_1            ... done
Removing elastic-package-service_kubernetes_is_ready_1 ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_kubernetes_1          ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_kubelet_1             ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_apiserver_1           ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_kube-state-metrics_1  ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_proxy_1               ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_scheduler_1           ... 
[2021-04-15T10:43:16.513Z] Removing elastic-package-service_controllermanager_1   ... 
[2021-04-15T10:43:16.513Z] 
Removing elastic-package-service_apiserver_1           ... done

Removing elastic-package-service_kubernetes_is_ready_1 ... done

Removing elastic-package-service_kubelet_1             ... done

Removing elastic-package-service_proxy_1               ... done

Removing elastic-package-service_scheduler_1           ... done

Removing elastic-package-service_kube-state-metrics_1  ... done

Removing elastic-package-service_controllermanager_1   ... done

Removing elastic-package-service_kubernetes_1          ... done
Removing network elastic-package-service_default
[2021-04-15T10:43:16.513Z] 2021/04/15 10:43:16 DEBUG deleting data in data stream...
[2021-04-15T10:43:16.827Z] + kind delete cluster
[2021-04-15T10:43:16.827Z] Deleting cluster "kind" ...
[2021-04-15T10:43:18.782Z] Running in /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/src/github.com/elastic/integrations
[2021-04-15T10:43:18.798Z] Archiving artifacts
[2021-04-15T10:43:19.018Z] Recording test results
[2021-04-15T10:43:19.386Z] [Checks API] No suitable checks publisher found.
[2021-04-15T10:43:19.673Z] + build/elastic-package stack dump -v --output build/elastic-stack-dump/latest/kubernetes
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG Enable verbose logging
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG Dump Elastic stack data
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG Dump stack logs
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG Recreate the output location (path: build/elastic-stack-dump/latest/kubernetes)
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG Dump stack logs for elasticsearch
[2021-04-15T10:43:19.673Z] 2021/04/15 10:43:19 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack logs elasticsearch
[2021-04-15T10:43:20.612Z] 2021/04/15 10:43:20 DEBUG Dump stack logs for elastic-agent
[2021-04-15T10:43:20.612Z] 2021/04/15 10:43:20 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack logs elastic-agent
[2021-04-15T10:43:21.553Z] 2021/04/15 10:43:21 DEBUG Dump stack logs for fleet-server
[2021-04-15T10:43:21.553Z] 2021/04/15 10:43:21 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack logs fleet-server
[2021-04-15T10:43:22.495Z] 2021/04/15 10:43:22 DEBUG Dump stack logs for kibana
[2021-04-15T10:43:22.495Z] 2021/04/15 10:43:22 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack logs kibana
[2021-04-15T10:43:23.881Z] 2021/04/15 10:43:23 DEBUG Dump stack logs for package-registry
[2021-04-15T10:43:23.881Z] 2021/04/15 10:43:23 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack logs package-registry
[2021-04-15T10:43:25.268Z] Path to stack dump: build/elastic-stack-dump/latest/kubernetes
[2021-04-15T10:43:25.268Z] Done
[2021-04-15T10:43:25.287Z] Archiving artifacts
[2021-04-15T10:43:25.675Z] + build/elastic-package stack down -v
[2021-04-15T10:43:25.675Z] 2021/04/15 10:43:25 DEBUG Enable verbose logging
[2021-04-15T10:43:25.675Z] Take down the Elastic stack
[2021-04-15T10:43:25.675Z] 2021/04/15 10:43:25 DEBUG running command: /usr/local/bin/docker-compose -f /var/lib/jenkins/workspace/gest-manager_integrations_PR-908/.elastic-package/stack/snapshot.yml -p elastic-package-stack down
[2021-04-15T10:43:26.245Z] The ELASTICSEARCH_IMAGE_REF variable is not set. Defaulting to a blank string.
[2021-04-15T10:43:26.245Z] The KIBANA_IMAGE_REF variable is not set. Defaulting to a blank string.
[2021-04-15T10:43:26.245Z] The ELASTIC_AGENT_IMAGE_REF variable is not set. Defaulting to a blank string.
[2021-04-15T10:43:26.245Z] Stopping elastic-package-stack_elastic-agent_1    ... 
[2021-04-15T10:43:26.245Z] Stopping elastic-package-stack_fleet-server_1     ... 
[2021-04-15T10:43:26.245Z] Stopping elastic-package-stack_kibana_1           ... 
[2021-04-15T10:43:26.245Z] Stopping elastic-package-stack_elasticsearch_1    ... 
[2021-04-15T10:43:26.245Z] Stopping elastic-package-stack_package-registry_1 ... 
[2021-04-15T10:43:39.678Z] 
Stopping elastic-package-stack_elastic-agent_1    ... done

Stopping elastic-package-stack_fleet-server_1     ... done

Stopping elastic-package-stack_kibana_1           ... done

Stopping elastic-package-stack_package-registry_1 ... done

Stopping elastic-package-stack_elasticsearch_1    ... done
Removing elastic-package-stack_elastic-agent_is_ready_1    ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_elastic-agent_1             ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_fleet-server_1              ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_kibana_is_ready_1           ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_elasticsearch_is_ready_1    ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_kibana_1                    ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_package-registry_is_ready_1 ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_elasticsearch_1             ... 
[2021-04-15T10:43:39.678Z] Removing elastic-package-stack_package-registry_1          ... 
[2021-04-15T10:43:39.678Z] 
Removing elastic-package-stack_kibana_is_ready_1           ... done

Removing elastic-package-stack_kibana_1                    ... done

Removing elastic-package-stack_elasticsearch_is_ready_1    ... done

Removing elastic-package-stack_elastic-agent_is_ready_1    ... done

Removing elastic-package-stack_package-registry_1          ... done

Removing elastic-package-stack_package-registry_is_ready_1 ... done

Removing elastic-package-stack_elasticsearch_1             ... done

Removing elastic-package-stack_elastic-agent_1             ... done

Removing elastic-package-stack_fleet-server_1              ... done
Removing network elastic-package-stack_default
[2021-04-15T10:43:40.253Z] Done
[2021-04-15T10:43:40.956Z] Running on Jenkins in /var/lib/jenkins/workspace/gest-manager_integrations_PR-908
[2021-04-15T10:43:40.994Z] [INFO] getVaultSecret: Getting secrets
[2021-04-15T10:43:41.089Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-04-15T10:43:41.706Z] + chmod 755 generate-build-data.sh
[2021-04-15T10:43:41.706Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Ingest-manager/integrations/PR-908/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Ingest-manager/integrations/PR-908/runs/14 FAILURE 2390091
[2021-04-15T10:43:42.257Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Ingest-manager/integrations/PR-908/runs/14/steps/?limit=10000 -o steps-info.json
[2021-04-15T10:43:44.131Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Ingest-manager/integrations/PR-908/runs/14/tests/?status=FAILED -o tests-errors.json
[2021-04-15T10:43:44.382Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Ingest-manager/integrations/PR-908/runs/14/log/ -o pipeline-log.txt

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Comment thread .ci/Jenkinsfile Outdated
kubectl version --client
''') }
sh(label: "Create kind cluster", script: 'kind create cluster')
sh(label: "Create kind cluster", script: 'kind create cluster --config - $PWD/../../testing/environments/kubernetes/kind-config.yaml')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I totally forgot about that directory. Actually I should remove it totally...

As this is a config file, maybe we could keep just at the root as this one: https://github.com/elastic/integrations/blob/master/config.yml

WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok! I can move it there!

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>

@mtojek mtojek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the CI is happy, please consider this PR as approved :)

Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
ChrsMark force-pushed the kind_cluster_config branch from 5307d96 to 3612109 Compare April 15, 2021 10:00
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@ChrsMark
ChrsMark force-pushed the kind_cluster_config branch from 3612109 to fb6fc9a Compare April 15, 2021 10:03
Comment thread .ci/Jenkinsfile
kubectl version --client
''') }
sh(label: "Create kind cluster", script: 'kind create cluster')
sh(label: "Create kind cluster", script: 'kind create cluster --config ../../kind-config.yaml')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this config is in the root of the project, try with BASE_DIR

Suggested change
sh(label: "Create kind cluster", script: 'kind create cluster --config ../../kind-config.yaml')
sh(label: "Create kind cluster", script: 'kind create cluster --config ${BASE_DIR}/kind-config.yaml')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to pass with ../../kind-config.yaml 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team:Integrations Label for the Integrations team

4 participants