Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enable k8s specific validations #19

Merged
merged 12 commits into from
Feb 1, 2022
Merged

Conversation

v1v
Copy link
Member

@v1v v1v commented Jan 27, 2022

What

As requested, let's enable the k8s specific builds in the CI

Actions

  • Delete the Jenkinfile.yml file
  • What's the list of supported versions to be tested? (At the moment only one for simplicity)
  • When to run (at the moment always)?
  • Copy the required scripts from .ci/scripts (.ci/scripts/kind-setup.sh, .ci/scripts/install-kind.sh and .ci/scripts/install-kubectl.sh)

@narph , can you help with the above actions?

Follow ups

  • Support when to run to be based on the change-set?
  • Shared library step in the Jenkins to configure kind and kubectl?

@v1v v1v requested a review from narph January 27, 2022 12:27
@v1v v1v changed the base branch from main to kube-ci January 27, 2022 12:29
@narph
Copy link
Contributor

narph commented Jan 27, 2022

What's the list of supported versions to be tested? (At the moment only one for simplicity)

I see in the old config there are a few k8sTest: "v1.23.0,v1.22.0,v1.21.1,v1.20.7,v1.19.11,v1.18.19", can we pick a few of those?

…c into feature/support-k8s

* 'feature/support-k8s' of github.com:v1v/elastic-agent-poc:
  ci: use the rigth when
  ci: enable k8s specific validations
…c into feature/support-k8s

* 'feature/support-k8s' of github.com:v1v/elastic-agent-poc:
  script: enable execution permissions
  ci: use the rigth when
  ci: enable k8s specific validations
  ci: use the rigth when
  ci: enable k8s specific validations
.ci/Jenkinsfile Outdated Show resolved Hide resolved
@v1v
Copy link
Member Author

v1v commented Jan 27, 2022

@narph , it works but there are failures with the project:

[2022-01-27T16:41:20.613Z] + make -C deploy/kubernetes test
[2022-01-27T16:41:20.613Z] make: Entering directory '/var/lib/jenkins/workspace/gent_elastic-agent-poc-mbp_PR-19/src/github.com/elastic/elastic-agent-poc/deploy/kubernetes'
[2022-01-27T16:41:20.613Z] Generating elastic-agent-standalone-kubernetes.yaml
[2022-01-27T16:41:20.613Z] Generating elastic-agent-managed-kubernetes.yaml
[2022-01-27T16:41:20.613Z] for FILE in elastic-agent-managed-kubernetes.yaml elastic-agent-standalone-kubernetes.yaml; do \
[2022-01-27T16:41:20.613Z] 	BEAT=$(echo $FILE | cut -d \- -f 1); \
[2022-01-27T16:41:20.613Z] 	kubectl create -f $FILE; \
[2022-01-27T16:41:20.613Z] done
[2022-01-27T16:41:20.874Z] daemonset.apps/elastic-agent created
[2022-01-27T16:41:20.874Z] clusterrolebinding.rbac.authorization.k8s.io/elastic-agent created
[2022-01-27T16:41:20.874Z] rolebinding.rbac.authorization.k8s.io/elastic-agent created
[2022-01-27T16:41:20.874Z] rolebinding.rbac.authorization.k8s.io/elastic-agent-kubeadm-config created
[2022-01-27T16:41:20.875Z] clusterrole.rbac.authorization.k8s.io/elastic-agent created
[2022-01-27T16:41:20.875Z] role.rbac.authorization.k8s.io/elastic-agent created
[2022-01-27T16:41:20.875Z] role.rbac.authorization.k8s.io/elastic-agent-kubeadm-config created
[2022-01-27T16:41:20.875Z] serviceaccount/elastic-agent created
[2022-01-27T16:41:21.137Z] configmap/agent-node-datastreams created
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": daemonsets.apps "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": clusterrolebindings.rbac.authorization.k8s.io "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": rolebindings.rbac.authorization.k8s.io "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": rolebindings.rbac.authorization.k8s.io "elastic-agent-kubeadm-config" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": clusterroles.rbac.authorization.k8s.io "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": roles.rbac.authorization.k8s.io "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": roles.rbac.authorization.k8s.io "elastic-agent-kubeadm-config" already exists
[2022-01-27T16:41:21.137Z] Error from server (AlreadyExists): error when creating "elastic-agent-standalone-kubernetes.yaml": serviceaccounts "elastic-agent" already exists
[2022-01-27T16:41:21.137Z] make: *** [Makefile:9: test] Error 1

[2022-01-27T16:41:21.137Z] make: Leaving directory '/var/lib/jenkins/workspace/gent_elastic-agent-poc-mbp_PR-19/src/github.com/elastic/elastic-agent-poc/deploy/kubernetes'

script returned exit code 2

I assume those errors are not related to this particular change but the source code.

@narph narph merged commit 0e13da7 into elastic:kube-ci Feb 1, 2022
@narph narph deleted the feature/support-k8s branch February 1, 2022 16:18
narph added a commit that referenced this pull request Feb 15, 2022
* fix docs

* add scripts

* script: enable execution permissions

* ci: enable k8s specific validations (#19)

* ci: enable k8s specific validations

* add scripts

* ci: use the rigth when

* ci: enable k8s specific validations

* ci: use the rigth when

* script: enable execution permissions

* script: enable execution permissions

* ci: enable k8s specific validations

* ci: use the rigth when

* Update .ci/Jenkinsfile

Co-authored-by: narph <mariana@elastic.co>

* delete cluster

* test

* add delete

* ci: more resilience when installing kind

See elastic/beats#21857

* ci: argument in the signature is not needed

* remove duplicate

* ci: simplify kind/kubectl environment (#22)

* revert aarch64 changes (#21)

* revert aarch64

* fmt

* rename

* rename

* rename

* ci: run k8s validation for different versions (#25)

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
narph referenced this pull request in narph/elastic-agent-temp Feb 21, 2022
* fix docs

* add scripts

* script: enable execution permissions

* ci: enable k8s specific validations (#19)

* ci: enable k8s specific validations

* add scripts

* ci: use the rigth when

* ci: enable k8s specific validations

* ci: use the rigth when

* script: enable execution permissions

* script: enable execution permissions

* ci: enable k8s specific validations

* ci: use the rigth when

* Update .ci/Jenkinsfile

Co-authored-by: narph <mariana@elastic.co>

* delete cluster

* test

* add delete

* ci: more resilience when installing kind

See elastic/beats#21857

* ci: argument in the signature is not needed

* remove duplicate

* ci: simplify kind/kubectl environment (#22)

* revert aarch64 changes (#21)

* revert aarch64

* fmt

* rename

* rename

* rename

* ci: run k8s validation for different versions (#25)

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
narph added a commit that referenced this pull request Mar 3, 2022
* fix docs

* add scripts

* script: enable execution permissions

* ci: enable k8s specific validations (#19)

* ci: enable k8s specific validations

* add scripts

* ci: use the rigth when

* ci: enable k8s specific validations

* ci: use the rigth when

* script: enable execution permissions

* script: enable execution permissions

* ci: enable k8s specific validations

* ci: use the rigth when

* Update .ci/Jenkinsfile

Co-authored-by: narph <mariana@elastic.co>

* delete cluster

* test

* add delete

* ci: more resilience when installing kind

See elastic/beats#21857

* ci: argument in the signature is not needed

* remove duplicate

* ci: simplify kind/kubectl environment (#22)

* revert aarch64 changes (#21)

* revert aarch64

* fmt

* rename

* rename

* rename

* ci: run k8s validation for different versions (#25)

Co-authored-by: Victor Martinez <VictorMartinezRubio@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants