Planted .
To create custom resources:
- Create a CRD.
- Apply using
kubectl apply -f - You can check existing CRDs using
kubectl get crd - Create a new resource file.
apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
name: my-new-cron-object
spec:
cronSpec: "* * * * */5"
image: my-awesome-cron-image
- Apply using
kubectl apply -f - Then you can get that custom resource using
kubectl get <resourcename>
So, if you did not create the CRD yourself, you can do this:
- Get the crd, example:
kubectl get crd globals.traffic.controller -o yaml - Create the resource file:
apiVersion: traffic.controller/v1
kind: Global
metadata:
name: datacenter
spec:
dataField: 2
access: true
- And then apply