Skip to content

Instantly share code, notes, and snippets.

@Sancer
Forked from troyharvey/deployment.yml
Created October 16, 2019 09:17
Show Gist options
  • Select an option

  • Save Sancer/5e9bdb71fd0a202d403f2458b3a6fdf5 to your computer and use it in GitHub Desktop.

Select an option

Save Sancer/5e9bdb71fd0a202d403f2458b3a6fdf5 to your computer and use it in GitHub Desktop.

Revisions

  1. @troyharvey troyharvey revised this gist Dec 16, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion env-secrets.yml
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Use secrets for things which are actually secret like API keys, credentials, etc
    # pbpaste | base64 | pbcopy
    # Base64 encode the values stored in a Kubernetes Secret: $ pbpaste | base64 | pbcopy
    # The --decode flag is convenient: $ pbpaste | base64 --decode

    apiVersion: v1
    kind: Secret
  2. @troyharvey troyharvey revised this gist Nov 29, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deployment.yml
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,4 @@ spec:
    - configMapRef:
    name: env-configmap
    - secretRef:
    name: env-secret
    name: env-secrets
  3. @troyharvey troyharvey created this gist Nov 4, 2017.
    29 changes: 29 additions & 0 deletions deployment.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    # Use envFrom to load Secrets and ConfigMaps into environment variables

    apiVersion: apps/v1beta2
    kind: Deployment
    metadata:
    name: mans-not-hot
    labels:
    app: mans-not-hot
    spec:
    replicas: 1
    selector:
    matchLabels:
    app: mans-not-hot
    template:
    metadata:
    labels:
    app: mans-not-hot
    spec:
    containers:
    - name: app
    image: gcr.io/mans-not-hot/app:bed1f9d4
    imagePullPolicy: Always
    ports:
    - containerPort: 80
    envFrom:
    - configMapRef:
    name: env-configmap
    - secretRef:
    name: env-secret
    9 changes: 9 additions & 0 deletions env-configmap.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # Use config map for not-secret configuration data

    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: env-configmap
    data:
    APP_NAME: Mans Not Hot
    APP_ENV: production
    11 changes: 11 additions & 0 deletions env-secrets.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # Use secrets for things which are actually secret like API keys, credentials, etc
    # pbpaste | base64 | pbcopy

    apiVersion: v1
    kind: Secret
    metadata:
    name: env-secrets
    type: Opaque
    data:
    DB_PASSWORD: cDZbUGVXeU5e0ZW
    REDIS_PASSWORD: AAZbUGVXeU5e0ZB