title: Kubernetes operator create Deployment using yaml template
body: <p>I am trying my hands on creating my own kubernetes operator by following this <a href="https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/" rel="nofollow noreferrer">link</a>. In the Reconcile function, I need to create multiple Deployments and each will vary in some attributes (like name for e.g.) and the configuration is huge. Instead of creating the deployment by using appsv1.Deployment and creating each attributes within it (like below code), is there a way wherein I can provide a yaml template file and read this file to obtain the appsv1.Deployment object?</p>
  <pre><code>    dep := &amp;appsv1.Deployment{
          ObjectMeta: metav1.ObjectMeta{
              Name:      customName,
              Namespace: m.Namespace,
          },
          Spec: appsv1.DeploymentSpec{
              Strategy: appsv1.DeploymentStrategy{
                  Type: &quot;RollingUpdate&quot;,
              },
          ... and so on
  </code></pre>
  <p>Instead of above, can something like below possible with some handy util functions?</p>
  <pre><code>dep := utils.parseYaml(deploymentYamlFile)
  </code></pre>