Skip to content

Commit 3082f4f

Browse files
MitchyBAwesomechristopherhein
authored andcommitted
Fix to kubectl bash-completion (aws-samples#355)
* fix bash-completion for kubectl Fixing bash-completion for kubectl, including installing bash-completion into the cloud9 IDE, appending to bashrc and reloading bashrc as part of the build script. * Fixing typo in bash-completion install * removing sourcing bashrc Looks like the IDE will need to be restarted for the for the bash-completion to work. * Fixing instructions to include IDE restart. Updating to include a step to restart the Cloud9 IDE terminal to ensure that kubectl completion is fully enabled.
1 parent 80f35bf commit 3082f4f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

01-path-basics/101-start-here/readme.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ image:cloud9-run-script.png[Running the script in Cloud9 Terminal]
7777
[NOTE]
7878
All shell commands _(starting with "$")_ throughout the rest of the workshop should be run in this tab. You may want to resize it upwards to make it larger.
7979

80+
At this point you can restart the Cloud9 IDE terminal session to ensure that the kublectl completion is enabled. Once a new terminal window is opened, type $ kubectl get nodes.
81+
8082
One last step is required so that the Cloud9 IDE uses the assigned IAM Instance profile. Open the "AWS Cloud9" menu, go to "Preferences", go to "AWS Settings", and disable "AWS managed temporary credentials" as depicted in the diagram here:
8183

8284
image:cloud9-disable-temp-credentials.png[]

01-path-basics/101-start-here/scripts/lab-ide-build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
# Install jq
1212
sudo yum -y install jq
1313

14+
# Install bash-completion
15+
sudo yum install bash-completion -y
16+
1417
# Install kubectl
1518
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
1619
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
17-
source <(kubectl completion bash)
20+
echo "source <(kubectl completion bash)" >> ~/.bashrc
1821

1922
# Install kops
2023
curl -LO https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64

0 commit comments

Comments
 (0)