Sha256: 94f2ff15423f2e2ec8802d4cae7c2fbdf79cd17c8f984729cf96676743bf34da
Contents?: true
Size: 819 Bytes
Versions: 8
Compression:
Stored size: 819 Bytes
Contents
--- title: Custom Helpers --- Kubes ships with several built-in helpers. On top of this, you can define your own custom helpers. This allows you to define new methods and customize Kubes further. ## Example You define custom helpers in the `.kubes/helpers` folder. .kubes/helpers/my_helpers.rb ```ruby module MyHelpers def database_endpoint case Kubes.env when "dev" "dev-db.cbuqdmc3nqvb.us-west-2.rds.amazonaws.com" when "prod" "prod-db.cbuqdmc3nqvb.us-west-2.rds.amazonaws.com" end end end ``` The `database_endpoint` will be available to use in the `.kubes/resources` YAML files. IE: .kubes/helpers/resources/shared/config_map.yaml ```yaml apiVersion: v1 kind: ConfigMap metadata: name: demo labels: app: demo data: DATABASE_ENDPOINT: <%= database_endpoint %> ```
Version data entries
8 entries across 8 versions & 1 rubygems