<p>I want to deploy ghost (blog) on  Kubernetes  with email configuration in google cloud.
ghost is running fine in k8s. But, I'm not able to fix my SMTP setting in deployment file </p>

<p>my .yaml file</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: blog
  labels:
    app: blog
spec:
  replicas: 1
  selector:
    matchLabels:
      app: blog
  template:
    metadata:
      labels:
        app: blog
    spec:
      containers:
      - name: blog
        image: ghost:2.6-alpine
        imagePullPolicy: Always
        ports:
        - containerPort: 2368
        env:
        - name: url
          value: http://my-blog.com
   environment:
      url: http://my-blog.com
      mail__transport: 2525
      mail__options__service: {Sendgrid}
      mail__options__auth__user: "gurpreet004"
      mail__options__auth__pass: "Server@1234"
</code></pre>

<p>it showing an error :</p>

<pre><code>error: error validating "deployment.yaml": error validating data: ValidationError(Deployment.spec.template): unknown field "environment" in io.k8s.api.core.v1.PodTemplateSpec; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>

<p>please provide any solution </p>

Gurpreet
<p>The <code>environment</code> field doesn't exist. If you want these values as environment variables in the container, you can do like this:</p>

<pre><code>apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: blog
  labels:
    app: blog
spec:
  replicas: 1
  selector:
    matchLabels:
      app: blog
  template:
    metadata:
      labels:
        app: blog
    spec:
      containers:
      - name: blog
        image: ghost:2.6-alpine
        imagePullPolicy: Always
        ports:
        - containerPort: 2368
        env:
        - name: url
          value: http://my-blog.com
        - name: mail__transport
          value: SMTP
        - name: mail__options__service
          value: Sendgrid
        - name: mail__options__auth__user
          value: gurpreet004
        - name: mail__options__auth__pass
          value: Server@1234
</code></pre>
