title: kubernetes - kubectl run vs create and apply
body: <p>I'm just getting started with kubernetes and setting up a cluster on AWS using kops.  In many of the examples I read (and try), there will be commands like:</p>
  
  <pre><code>kubectl run my-app --image=mycompany/myapp:latest --replicas=1 --port=8080
  
  kubectl expose deployment my=app --port=80 --type=LoadBalancer
  </code></pre>
  
  <p>This seems to do several things behind the scenes, and I can view the manifest files created using <code>kubectl edit deployment</code>, and so forth  However, i see many examples where people are creating the manifest files by hand, and using commands like <code>kubectl create -f</code> or <code>kubectl apply -f</code></p>
  
  <p>Am I correct in assuming that both approaches accomplish the same goals, but that by creating the manifest files yourself, you have a finer grain of control?</p>
  
  <p>Would I then have to be creating Service, ReplicationController, and Pod specs myself?</p>
  
  <p>Lastly, if you create the manifest files yourself, how do people generally structure their projects as far as storing these files?  Are they simply in a directory alongside the project they are deploying?</p>