Skip to content

Commit e1fa65a

Browse files
authored
feat: add kubectl-ai to cloudshell (#317)
Signed-off-by: Sertac Ozercan <[email protected]>
1 parent 69a5c8c commit e1fa65a

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

linux/tools.Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# IMAGE_LOCATION refers to a Microsoft-internal container registry which stores a cached version
2-
# of the image built from base.Dockerfile. If you are building this file outside Microsoft, you
2+
# of the image built from base.Dockerfile. If you are building this file outside Microsoft, you
33
# won't be able to reach this location, but don't worry!
44

55
# To build yourself locally, override this location with a local image tag. See README.md for more detail
@@ -33,6 +33,15 @@ RUN az aks install-cli \
3333
&& chmod +x /usr/local/bin/kubectl \
3434
&& chmod +x /usr/local/bin/kubelogin
3535

36+
# Install kubectl-ai
37+
RUN curl -LO https://github.com/sozercan/kubectl-ai/releases/latest/download/kubectl-ai_linux_amd64.tar.gz && \
38+
curl -LO https://github.com/sozercan/kubectl-ai/releases/latest/download/kubectl-ai_checksums.txt && \
39+
CHECKSUM=$(grep kubectl-ai_linux_amd64.tar.gz kubectl-ai_checksums.txt | awk '{print $1}') && \
40+
echo "$CHECKSUM kubectl-ai_linux_amd64.tar.gz" | sha256sum -c - && \
41+
tar xzf kubectl-ai_linux_amd64.tar.gz && \
42+
mv kubectl-ai /usr/local/bin/kubectl-ai && \
43+
rm -rf kubectl-ai_linux_amd64.tar.gz kubectl-ai_checksums.txt
44+
3645
# Remove after base image gets updated
3746
RUN bash ./tdnfinstall.sh postgresql-devel
3847
RUN bash ./tdnfinstall.sh terraform
@@ -52,8 +61,8 @@ RUN curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep
5261

5362
# Temp: fix ansible modules. Proper fix is to update base layer to use regular python for Ansible.
5463
RUN wget -nv -q https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt \
55-
&& /opt/ansible/bin/python -m pip install -r /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
56-
64+
&& /opt/ansible/bin/python -m pip install -r /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements-azure.txt
65+
5766
# Copy and run script to Install powershell modules and setup Powershell machine profile
5867
COPY ./linux/powershell/PSCloudShellUtility/ /usr/local/share/powershell/Modules/PSCloudShellUtility/
5968
COPY ./linux/powershell/ powershell
@@ -62,13 +71,9 @@ RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Top && rm -rf ./
6271
# install powershell warmup script
6372
COPY ./linux/powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1
6473

65-
66-
67-
# Remove su so users don't have su access by default.
74+
# Remove su so users don't have su access by default.
6875
RUN rm -f ./linux/Dockerfile && rm -f /bin/su
6976

70-
71-
7277
#Add soft links
7378
RUN ln -s /usr/bin/python3 /usr/bin/python
7479
RUN ln -s /usr/bin/node /usr/bin/nodejs
@@ -78,5 +83,5 @@ RUN ln -s /usr/bin/node /usr/bin/nodejs
7883
# Add dotnet tools to PATH so users can install a tool using dotnet tools and can execute that command from any directory
7984
ENV PATH ~/.local/bin:~/bin:~/.dotnet/tools:$PATH
8085

81-
# Set AZUREPS_HOST_ENVIRONMENT
86+
# Set AZUREPS_HOST_ENVIRONMENT
8287
ENV AZUREPS_HOST_ENVIRONMENT cloud-shell/1.0

tests/command_list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ ksba-config
636636
kswitch
637637
ktutil
638638
kubectl
639+
kubectl-ai
639640
kubelogin
640641
kvno
641642
last

0 commit comments

Comments
 (0)