Sha256: 1d628e4691a9f7af943396c74d9dc21d478eb65694813d34b4bb2d7e10894983

Contents?: true

Size: 861 Bytes

Versions: 18

Compression:

Stored size: 861 Bytes

Contents

---
title: Kubes YAML
---

You can write your Kubernetes resources in YAML format.

    .kubes
    └── resources
        └── web
            ├── deployment.yaml
            └── service.yaml

## YAML and Templating

Kubes provides a little extra power for the YAML format. The YAML files are processed through an ERB templating language.  So you have dynamic control. Here's an example with `Kubes.env` and the `built_image` helper.

.kubes/resources/web/deployment.yaml

```yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-web
  labels:
    app: demo
  namespace: default
spec:
  replicas: <%= Kubes.env == "prod" ? 2 : 1 %>
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: demo-web
        image: <%= built_image %>
```

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
kubes-0.4.7 docs/_docs/yaml.md
kubes-0.4.6 docs/_docs/yaml.md
kubes-0.4.5 docs/_docs/yaml.md
kubes-0.4.4 docs/_docs/yaml.md
kubes-0.4.3 docs/_docs/yaml.md
kubes-0.4.2 docs/_docs/yaml.md
kubes-0.4.1 docs/_docs/yaml.md
kubes-0.4.0 docs/_docs/yaml.md
kubes-0.3.5 docs/_docs/yaml.md
kubes-0.3.4 docs/_docs/yaml.md
kubes-0.3.3 docs/_docs/yaml.md
kubes-0.3.2 docs/_docs/yaml.md
kubes-0.3.1 docs/_docs/yaml.md
kubes-0.3.0 docs/_docs/yaml.md
kubes-0.2.6 docs/_docs/yaml.md
kubes-0.2.5 docs/_docs/yaml.md
kubes-0.2.4 docs/_docs/yaml.md
kubes-0.2.3 docs/_docs/yaml.md