Sha256: 6eb849d5754899088879e53fd7a16a3dc1be18b301ced4397b124f19823bcbc8

Contents?: true

Size: 851 Bytes

Versions: 58

Compression:

Stored size: 851 Bytes

Contents

---
title: Generic
categories: dsl
---

The generic DSL allows you to create any Kubernetes resource kind with the Kubes DSL. It is useful for resources with no pretty Kubes DSL wrappers yet.  It still has some pretty powerful helper methods.

## Example 1

Here's an example of an example of a make-believe SomeKind resource.

.kubes/resources/web/some_kind.rb

```ruby
name "some-kind"
labels(role: "web")
spec(
  spec1: "v1"
)
field(:data,
  k1: "v1",
  k2: "v2"
)
```

Produces:

.kubes/output/web/some_kind.yaml

```yaml
data:
  k1: v1
  k2: v2
kind: SomeKind
metadata:
  name: some-kind
  labels:
    role: web
spec:
  spec1: v1
```

## DSL Methods

Here's a list of common methods:

Top-level and special fields:

* apiVersion
* kind
* metadata
* resource
* spec
* annotations
* labels
* namespace

{% include dsl/methods.md name="resource" %}

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
kubes-0.9.3 docs/_docs/dsl/resources/generic.md
kubes-0.9.2 docs/_docs/dsl/resources/generic.md
kubes-0.9.1 docs/_docs/dsl/resources/generic.md
kubes-0.9.0 docs/_docs/dsl/resources/generic.md
kubes-0.8.10 docs/_docs/dsl/resources/generic.md
kubes-0.8.9 docs/_docs/dsl/resources/generic.md
kubes-0.8.8 docs/_docs/dsl/resources/generic.md
kubes-0.8.7 docs/_docs/dsl/resources/generic.md
kubes-0.8.6 docs/_docs/dsl/resources/generic.md
kubes-0.8.5 docs/_docs/dsl/resources/generic.md
kubes-0.8.4 docs/_docs/dsl/resources/generic.md
kubes-0.8.3 docs/_docs/dsl/resources/generic.md
kubes-0.8.2 docs/_docs/dsl/resources/generic.md
kubes-0.8.1 docs/_docs/dsl/resources/generic.md
kubes-0.8.0 docs/_docs/dsl/resources/generic.md
kubes-0.7.10 docs/_docs/dsl/resources/generic.md
kubes-0.7.9 docs/_docs/dsl/resources/generic.md
kubes-0.7.8 docs/_docs/dsl/resources/generic.md
kubes-0.7.7 docs/_docs/dsl/resources/generic.md
kubes-0.7.6 docs/_docs/dsl/resources/generic.md