Org babel extension to apply kubectl to org babel source blocks.
- kubectl
Please refer to this page for more information on installing kubectl.
Recommended install via use-package and quelpa.
(use-package ob-kubectl
:ensure-system-package kubectl
:ensure t
:defer t
:quelpa ((ob-kubectl :fetcher github :repo "ifitzpat/ob-kubectl") :upgrade t)
:config
(add-to-list 'org-babel-load-languages '(kubectl . t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
)Calling C-c C-c on kubectl source blocks calls kubectl apply -f
on that block. To call delete instead use :action delete as
a header arg. To specify a particular context use :context your-context.
#+begin_src kubectl :action delete :context microk8s
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
name: autoscale-go
namespace: default
spec:
template:
metadata:
annotations:
# Knative concurrency-based autoscaling (default).
autoscaling.knative.dev/class: kpa.autoscaling.knative.dev
autoscaling.knative.dev/metric: concurrency
# Target 10 requests in-flight per pod.
autoscaling.knative.dev/target: "10"
# Disable scale to zero with a minScale of 1.
autoscaling.knative.dev/minScale: "1"
# Limit scaling to 100 pods.
autoscaling.knative.dev/maxScale: "100"
spec:
containers:
- image: gcr.io/knative-samples/autoscale-go:0.1
#+end_src
Example derived from: https://knative.dev/docs/serving/samples/autoscale-go/index.html
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are extremely appreciated.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m ‘Add some AmazingFeature’)
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Distributed under the GPLv3. See LICENSE for more information.
Dr. Ian FitzPatrick - @ifitzpat - ian@ianfitzpatrick.eu
Project Link: https://github.com/fitzpat/ob-kubectl