Git Product home page Git Product logo

helm-cm-n-secrets's Introduction

ConfigMap And Secrets Helm Chart

latest_vesion: 0.0.14

HELM

This is a HELM Chart repo for a chart that creates a configMaps and Secrets from an array in the value file

  • support multiline string date with user defrined file name.
  • support Key & Value for environment variables.
  • support all K8S secret type by changing the secretType for each secret.
  • support adding common labels and annotations to all configmaps and secrets

to add this HELM repo to you HELM client run the following:

helm repo add configmap-n-secrets https://tal-hason.github.io/helm-cm-n-secrets/

to pull the chart run:

helm pull configmap-n-secrets/configMapSecrets

Value file structure

commonLables:
  this-is-a-label: "some label"

commonAnnotations: 
  this-is-an-annotaion: "some annotation"

configMaps: # an array of configmaps with their details and values
  - name: app-properties # the name of the configMap
    enabled: true # this will enable the creation of the configMap
    type: string # the type of the configmap, 2 types are available 1, string(file style) 2, Key & values(environment variables)
    fileName: application.properties # the name of the file/key in the config map
    data: | # this is the Key that will store the data of the configmap to both types
      some file content
      with details of the application
  - name: some-files # the name of the configMap
    enabled: true # this will enable the creation of the configMap
    type: string # the type of the configmap, 2 types are available 1, string(file style) 2, Key & values(environment variables)
    fileName: files1 # the name of the file/key in the config map
    data: | # this is the Key that will store the data of the configmap to both types
      '12334455666777888'
  - name: env-details # the name of the configMap
    enabled: true # this will enable the creation of the configMap
    type: keyValues # the type of the configmap, 2 types are available 1, string(file style) 2, Key & values(environment variables)
    data: # this is the Key that will store the data of the configmap to both types
      HOST: localhost # Key & Values 1
      PORT: "8080" # Key & Values 2
      ENV: develop # Key & Values 3

secrets: # an array of configmaps with their details and values will be Base64 encoded
  - name: app-properties # the name of the configMap
    enabled: true # this will enable the creation of the configMap
    type: string # the type of the configmap, 2 types are available 1, string(file style) 2, Key & values(environment variables)
    fileName: dbstring # the name of the file/key in the secret
    secretType: Opaque # k8s secret type (Opaque, kubernetes.io/service-account-token, kubernetes.io/dockercfg, kubernetes.io/dockerconfigjson, kubernetes.io/basic-auth, kubernetes.io/ssh-auth, kubernetes.io/tls, bootstrap.kubernetes.io/token)
    data: | # this is the Key that will store the data of the configmap to both types
      some file content
      with details of the application
  - name: env-details # the name of the configMap
    enabled: true # this will enable the creation of the configMap
    type: keyValues # the type of the configmap, 2 types are available 1, string(file style) 2, Key & values(environment variables)
    secretType: Opaque # k8s secret type (Opaque, kubernetes.io/service-account-token, kubernetes.io/dockercfg, kubernetes.io/dockerconfigjson, kubernetes.io/basic-auth, kubernetes.io/ssh-auth, kubernetes.io/tls, bootstrap.kubernetes.io/token)
    data: # this is the Key that will store the data of the configmap to both types
      HOST: localhost # Key & Values 1
      PORT: "8080" # Key & Values 2
      ENV: develop # Key & Values 3

the output will be

for configMaps:

---
# Source: configMapSecrets/templates/configMap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-properties
  labels:
    helm-chart/release-name: demo
    helm.sh/chart: 'configMapSecrets-0.0.12'
    this-is-a-label: "some label" 
  annotations:
    helm-chart/release-version: 0.0.12
    this-is-an-annotaion: "some annotation" 
data:
  application.properties: |
    some file content
    with details of the application
---
# Source: configMapSecrets/templates/configMap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: some-files
  labels:
    helm-chart/release-name: demo
    helm.sh/chart: 'configMapSecrets-0.0.12'
    this-is-a-label: "some label" 
  annotations:
    helm-chart/release-version: 0.0.12
    this-is-an-annotaion: "some annotation" 
data:
  files1: |
    '12334455666777888'
---
# Source: configMapSecrets/templates/configMap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: env-details
  labels:
    helm-chart/release-name: demo
    helm.sh/chart: 'configMapSecrets-0.0.12'
    this-is-a-label: "some label" 
  annotations:
    helm-chart/release-version: 0.0.12
    this-is-an-annotaion: "some annotation" 
data:
  ENV: "develop"
  HOST: "localhost"
  PORT: "8080"

For secrets:

---
# Source: configMapSecrets/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: app-properties
  labels:
    helm-chart/release-name: demo
    helm.sh/chart: 'configMapSecrets-0.0.12'
    this-is-a-label: "some label" 
  annotations:
    helm-chart/release-version: 0.0.12
    this-is-an-annotaion: "some annotation" 
type: Opaque
data:
  dbstring: "ICAgIHNvbWUgZmlsZSBjb250ZW50CiAgICB3aXRoIGRldGFpbHMgb2YgdGhlIGFwcGxpY2F0aW9uCiAgICA="
---
# Source: configMapSecrets/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
  name: env-details
  labels:
    helm-chart/release-name: demo
    helm.sh/chart: 'configMapSecrets-0.0.12'
    this-is-a-label: "some label" 
  annotations:
    helm-chart/release-version: 0.0.12
    this-is-an-annotaion: "some annotation" 
type: Opaque
data:
  ENV: ImRldmVsb3Ai
  HOST: ImxvY2FsaG9zdCI=
  PORT: IjgwODAi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.