cnat

module
v0.0.0-...-27f8ddb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2020 License: Apache-2.0

README

cnat

The cnat (cloud native at) command extends Kubernetes to run a command at a certain point in time in the future, akin to the Linux at command.

Let's say you want to execute echo YAY at 2am on 3rd July 2019. Here's what you would do (given the cnat CRD has been registered and the according operator is running):

$ cat runat.yaml
apiVersion: cnat.programming-kubernetes.info/v1alpha1
kind: At
metadata:
  name: example-at
spec:
  schedule: "2019-07-03T02:00:00Z"
  command: "echo YAY"


$ kubectl apply -f runat.yaml
cnat.programming-kubernetes.info/example-at created

$ kubectl get at
NAME               AGE
example-at         20s

$ kubectl logs example-at-pod
YAY

Note that the execution time (schedule) is given in UTC.

In order to use the cnat custom resource, you have to run the respective custom controller, implemented here in three different ways:

Directories

Path Synopsis
cnat-kubebuilder
pkg/apis
Package apis contains Kubernetes API groups.
Package apis contains Kubernetes API groups.
pkg/apis/cnat
Package cnat contains cnat API versions
Package cnat contains cnat API versions
pkg/apis/cnat/v1alpha1
Package v1alpha1 contains the cnat v1alpha1 API group +k8s:deepcopy-gen=package +groupName=cnat.programming-kubernetes.info Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/programming-kubernetes/cnat/cnat-kubebuilder/pkg/apis/cnat +k8s:defaulter-gen=TypeMeta +groupName=cnat.programming-kubernetes.info
Package v1alpha1 contains the cnat v1alpha1 API group +k8s:deepcopy-gen=package +groupName=cnat.programming-kubernetes.info Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/programming-kubernetes/cnat/cnat-kubebuilder/pkg/apis/cnat +k8s:defaulter-gen=TypeMeta +groupName=cnat.programming-kubernetes.info
cnat-operator
pkg/apis/cnat/v1alpha1
Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=cnat.programming-kubernetes.info Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=cnat.programming-kubernetes.info
Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=cnat.programming-kubernetes.info Package v1alpha1 contains API Schema definitions for the cnat v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=cnat.programming-kubernetes.info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL