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

Support helm-less install #466

Merged
merged 10 commits into from
May 13, 2020
Merged

Support helm-less install #466

merged 10 commits into from
May 13, 2020

Conversation

cwen0
Copy link
Member

@cwen0 cwen0 commented May 6, 2020

Signed-off-by: cwen0 cwenyin0@gmail.com

What problem does this PR solve?

#431

What is changed and how does it work?

  • remove helm dependency from install.sh
  • support helm-less install
# install chaos mesh
curl -sSL https://raw.githubusercontent.com/cwen0/chaos-mesh/add_dry_run/install.sh | sh 

# install chaos-mesh with kubectl 
curl -sSL https://raw.githubusercontent.com/cwen0/chaos-mesh/add_dry_run/install.sh | sh -s -- --dry-run  | kubectl apply -f -  

# install kind cluster and chaos mesh
curl -sSL https://raw.githubusercontent.com/cwen0/chaos-mesh/add_dry_run/install.sh | sh -s -- -l kind

Check List

Tests

  • Manual test (add detailed scripts or steps below)

cwen0 added 5 commits May 6, 2020 23:01
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
Signed-off-by: cwen0 <cwenyin0@gmail.com>
install.sh Outdated
OPTIONS:
-v, --version Version of chaos-mesh, default value: latest
-l, --local [kind] Choose a way to run a local kubernetes cluster, supported value: kind,
If this value is not set and the Kubernetes is not installed, this script will exit with 1.
-n, --name Name of Kubernetes cluster, default value: kind
-c --crd The URL of the crd files, default value: https://raw.githubusercontent.com/pingcap/chaos-mesh/master/manifests/crd.yaml
-r --runc Runtime specifies which container runtime to use. Currently we only supports docker and containerd. default value: docker
Copy link
Contributor

Choose a reason for hiding this comment

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

What about --runtime, runc is not that appropriate here

OPTIONS:
-v, --version Version of chaos-mesh, default value: latest
-l, --local [kind] Choose a way to run a local kubernetes cluster, supported value: kind,
If this value is not set and the Kubernetes is not installed, this script will exit with 1.
-n, --name Name of Kubernetes cluster, default value: kind
-c --crd The URL of the crd files, default value: https://raw.githubusercontent.com/pingcap/chaos-mesh/master/manifests/crd.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the use case that we need to expose this flag? Does it need to be configurable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Using a relative path is enough here?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we use a relative path, we must use exec this script in specific directory.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but we have to. It is not appropriate to use /master in such script. If we want to run this script in the release branch, then what is the value of crd? Do we have to update to https://raw.githubusercontent.com/pingcap/chaos-mesh/<tag>/manifests/crd.yaml every time?

Copy link
Member Author

Choose a reason for hiding this comment

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

When we need to release, we also need to change the image to install, so I think we also need to update this, or we add a flag to define the version of chaos-mesh.

Copy link
Contributor

Choose a reason for hiding this comment

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

I still think it is better to use relative path. If using master, then how to test each PR in CI? We have to update the path to each PR's CRD?

Copy link
Member Author

Choose a reason for hiding this comment

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

this pr has no relation to CI. Why need to use this pr in CI?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I mean not CI, just in each branch. If we are in different branches and run this script, then we have to still update the crd url every time? I don't think it is reasonable

Copy link
Member Author

@cwen0 cwen0 May 12, 2020

Choose a reason for hiding this comment

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

Maybe we can support to set a relative path and use the URL as a default value.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

CA_BUNDLE=$(openssl base64 -A -in ${tmpdir}/ca.crt)

cat <<EOF
---
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to not copy all these yaml templates in this script? It would be a pain that we have to update both this script and the helm templates when there is a change.

Copy link
Member

Choose a reason for hiding this comment

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

agree

Copy link
Member Author

Choose a reason for hiding this comment

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

I just want to provide a more convenient installation method and do not rely on helm, Do you have any other good solutions?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we can add a hack script to help use us update this.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe a hack script can be executed after make yaml and checked by CI

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

- --runtime
- ${runc}
- --http-port
- !!str 31766
Copy link
Contributor

Choose a reason for hiding this comment

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

!!str is not needed

Copy link
Member Author

Choose a reason for hiding this comment

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

If we delete !!str, the program will report an error.

Error from server (BadRequest): error when creating "STDIN": DaemonSet in version "v1" cannot be handled as a DaemonSet: v1.DaemonSet.Spec: v1.DaemonSetSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Command: []string: ReadString: expects " or n, but found 3, error found in #10 byte of ...|tp-port",31766,"--gr|..., bigger context ...|s-daemon","--runtime","containerd","--http-port",31766,"--grpc-port",31767],"image":"pingcap/chaos-d|...

- --http-port
- !!str 31766
- --grpc-port
- !!str 31767
Copy link
Contributor

Choose a reason for hiding this comment

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

!!str is not needed

Signed-off-by: cwen0 <cwenyin0@gmail.com>
@cwen0
Copy link
Member Author

cwen0 commented May 12, 2020

@Gallardot @yeya24 @fewdan PTAL again! Thanks!

Copy link
Member

@fewdan fewdan left a comment

Choose a reason for hiding this comment

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

LGTM

@Gallardot
Copy link
Member

who and when need to execute the ‘make update-install-script’ ?

Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Great work! LGTM

@cwen0
Copy link
Member Author

cwen0 commented May 13, 2020

who and when need to execute the ‘make update-install-script’ ?

when we update helm charts, we need run make update-install-script to update install.sh. helm --dry-run requires a Kubernetes environment, so we can't add it at CI at present.

@cwen0
Copy link
Member Author

cwen0 commented May 13, 2020

/merge

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

Your auto merge job has been accepted, waiting for:

  • 478

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

/run-all-tests

@sre-bot
Copy link
Contributor

sre-bot commented May 13, 2020

@cwen0 merge failed.

@cwen0 cwen0 merged commit 4198785 into chaos-mesh:master May 13, 2020
@cwen0 cwen0 deleted the add_dry_run branch May 13, 2020 04:21
@cwen0 cwen0 mentioned this pull request May 13, 2020
sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants