first commit
This commit is contained in:
commit
2034d92090
14
.drone.yml
Normal file
14
.drone.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
kind: template
|
||||
load: multiarch-container.yaml
|
||||
data:
|
||||
repo: examples/kubectl
|
||||
build_args:
|
||||
- KUBERNETES_RELEASE=v1.24.2
|
||||
tags:
|
||||
- "1.24.2"
|
||||
- "1.24"
|
||||
- "1"
|
||||
platforms:
|
||||
- os: linux
|
||||
arch: arm64
|
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
FROM alpine:3.17
|
||||
|
||||
ARG OS
|
||||
ARG ARCH
|
||||
ARG KUBERNETES_RELEASE
|
||||
|
||||
RUN apk --no-cache add --update curl ca-certificates bash
|
||||
|
||||
RUN curl -Lo /usr/local/bin/kubectl \
|
||||
https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_RELEASE}/bin/${OS}/${ARCH}/kubectl
|
||||
|
||||
RUN chmod +x /usr/local/bin/kubectl
|
||||
|
||||
COPY kubectl-setup /bin/
|
||||
RUN chmod +x /bin/kubectl-setup
|
||||
|
||||
CMD [ "/bin/kubectl-setup" ]
|
||||
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]
|
27
readme.md
Normal file
27
readme.md
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
## `kubectl` image
|
||||
|
||||
An `alpine` image with `kubectl` installed
|
||||
|
||||
See https://blog.jbrumond.me/post/raspberry-pi-cluster-part-4:-gitea-and-drone for more info
|
||||
|
||||
|
||||
|
||||
### Drone CI Usage
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: deploy
|
||||
image: gitea.internal.example.com/examples/kubectl:1.24
|
||||
environment:
|
||||
KUBERNETES_SERVER: https://k8s-cluster-api.example:6443
|
||||
KUBERNETES_TOKEN:
|
||||
from_secret: kubernetes-service-account-token
|
||||
KUBERNETES_CERT:
|
||||
from_secret: kubernetes-service-account-cert
|
||||
commands:
|
||||
- /bin/kubectl-setup
|
||||
- kubectl set image "deployment/example-deployment" "example-container=gitea.internal.example.com/images/example-image"
|
||||
- kubectl rollout restart "deployment/example-deployment"
|
||||
- kubectl rollout status "deployment/example-deployment"
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user