How to see VS 2019 YAML Template Output generation

11/25/2019

I have yaml template in VS 2019 with variables like below.

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ template "kubernetes1.fullname" . }}
  labels:
    app: {{ template "kubernetes1.name" . }}
    chart: {{ template "kubernetes1.chart" . }}
    draft: {{ .Values.draft | default "draft-app" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
etc.....

Now I want to see the output of fully generated yaml by filling those variable values. Is there a way?

-- Jaish Mathews
deployment
kubernetes
visual-studio-2019
yaml

1 Answer

11/25/2019

If I understand you correctly, what you are looking for is kubectl flag --dry-run.

Here is a link to the documentation references for this kubectl create.

If you use the dry-run flag this will take your yaml and create it without applying it to the cluster.

Also if you want to see the output of that yaml you should use -o yaml, which redirects the output to yaml format.

-- Crou
Source: StackOverflow