yaml
type: "io.kestra.plugin.kubernetes.kubectl.apply"
yaml
id: create_or_replace_deployment
namespace: company.team

tasks:
  - id: apply
    type: io.kestra.plugin.kubernetes.kubectl.Apply
    namespace: default
    spec: |-
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: mypod

yaml
id: create_or_replace_deployment
namespace: company.team

tasks:
  - id: apply
    type: io.kestra.plugin.kubernetes.kubectl.Apply
    namespaceFiles:
      enabled: true
    namespace: default
    spec: "{{ read('deployment.yaml') }}"

yaml
id: k8s
namespace: company.name

tasks:
  - id: apply
    type: io.kestra.plugin.kubernetes.kubectl.Apply
    namespace: default
    spec: |-
      apiVersion: apiextensions.k8s.io/v1
      kind: CustomResourceDefinition
      metadata:
        name: shirts.stable.example.com
      spec:
        group: stable.example.com
        scope: Namespaced
        names:
          plural: shirts
          singular: shirt
          kind: Shirt
        versions:
        - name: v1
          served: true
          storage: true
          schema:
            openAPIV3Schema:
              type: object
              properties:
                apiVersion:
                  type: string
                kind:
                  type: string
                metadata:
                  type: object
                spec:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true # Allows any fields in spec
                  properties:
                    # You should define your actual Shirt properties here later
                    # For example:
                    # color:
                    #   type: string
                    # size:
                    #   type: string
                    #   enum: ["S", "M", "L", "XL"]
                status:
                  type: object
                  x-kubernetes-preserve-unknown-fields: true # Allows any fields in status
                  properties:
                    # Define your status properties here
                    # message:
                    #   type: string
Properties
Default { "image": "busybox" }
SubType string
SubType string
Default PT1H
Format duration
Default PT10M
Format duration
SubType
Default v1
Default RSA
Default https://kubernetes.default.svc
SubType string
Format date-time
Format date-time
SubType string
SubType string
Default busybox