-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
FROM rancher/cli:v2.0.4 | ||
|
||
# install dependencies | ||
RUN apk add --no-cache curl | ||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
ca-certificates \ | ||
curl | ||
|
||
# install kubectl | ||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kubectl \ | ||
&& chmod +x ./kubectl \ | ||
&& mv ./kubectl /usr/local/bin/kubectl | ||
|
||
# add rancher-redeploy script | ||
COPY bin/rancher-redeploy /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/rancher-redeploy | ||
# add helper scripts | ||
COPY bin/ /usr/local/bin/ | ||
|
||
## make all binaries executable | ||
RUN chmod +x /usr/local/bin/* | ||
|
||
# reset entrypoint | ||
ENTRYPOINT [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
POD=$(rancher kubectl get pod -l workload.user.cattle.io/workloadselector=deployment-$1-$2 -n $1 -o jsonpath="{.items[0].metadata.name}") | ||
echo "INFO: executing '$3' in pod '$POD'\n" | ||
rancher kubectl exec $POD -n $1 $3 |