This script aims at resolving issues with one-click-integration in Kyma's certificate retrieval flow.
The script requires only minimal input and automates token fetch, csr generation and http calls to the Connector Service.
In order to run the script following command line tools must be available:
- curl
- openssl
- jq
- base64
- kubectl
Script now has a brew formula! Simply run:
brew tap janmedrek/one-click-integration
brew install one-click-integration
After the installation it's accessible via:
one-click-integration.sh
No need to remember where you've put that pesky file anymore!
Otherwise you can set up the script with the following command:
curl https://raw.githubusercontent.com/janmedrek/one-click-integration-script/master/one-click-integration.sh > one-click-integration.sh && chmod +x ./one-click-integration.sh
This script can fetch certificate info in two different ways:
- using provided url (containing token)
- using kubeconfig file
Please not that the options are mutually exclusive!
Following parameters are available:
- url fetch:
- -u | --url - url with a token generated by connector-service
- -k | --key - (optional) path to the key file
- kubeconfig fetch:
- -c | --config - path to the kubeconfig file
- -r | --remoteenv - name of remote environment
- No key file provided:
one-click-integration.sh --url "https://connector-service.kyma.dev.com/v1/remoteenvironments/ec-default/info?token=J0RpZCBoZSBmaXJlIHNpeCBzaG90cyBvciBvbmx5IGZpdmUnPyBXZWxsIHRvIHRlbGwgeW91IHRoZSB0cnV0aCwgaW4gYWxsIHRoaXMgZXhjaXRlbWVudCwgaSBraW5kIG9mIGxvc3QgdHJhY2sgbXlzZWxmLg=="
- Using existing key file:
one-click-integration.sh --key certificate.key --url "https://connector-service.kyma.dev.com/v1/remoteenvironments/ec-default/info?token=QnV0IGJlaW5nIHRoYXQgdGhpcyBpcyBhIC40NCBNYWdudW0sIHRoZSBtb3N0IHBvd2VyZnVsIGhhbmRndW4gaW4gdGhlIHdvcmxkLCBhbmQgd291bGQgYmxvdyB5b3VyIGhlYWQgY2xlYW4gb2ZmLCB5b3UndmUgZ290IHRvIGFzayB5b3Vyc2VsZiBvbmUgcXVlc3Rpb246ICdEbyBJIGZlZWwgbHVja3k/JyBXZWxsIGRvIHlhLCBwdW5rPw=="
- No key file provided:
one-click-integration.sh --config "/Users/username/kubeconfigdir/kubeconfig" -r "re-name"
- Using existing key file:
one-click-integration.sh --config "/Users/username/kubeconfigdir/kubeconfig" -r "re-name" --key certificate.key
There is a nice auto-completion script which can be added for increasing the user experience: Auto-completion for one-click-integration.
Simply add the following command to your profile script:
source ./one-click-integration-script-completion.bash