1. Docs
  2. Infrastructure as Code
  3. Get Started
  4. Kubernetes
  5. Deploy to Kubernetes

Get started with Pulumi and Kubernetes

    Deploy to Kubernetes

    Now run pulumi up to start deploying your NGINX deployment:

    $ pulumi up
    
    > pulumi up
    

    This command first shows you a preview of the changes that will be made:

    Previewing update (dev):
    
         Type                              Name            Plan
     +   pulumi:pulumi:Stack               quickstart-dev  create
     +   └─ kubernetes:apps/v1:Deployment  nginx           create
    
    Resources:
        + 2 to create
    
    Do you want to perform this update?
    > yes
      no
      details
    

    No changes have been made yet. You may decline to proceed by selecting no or choose details to see more information about the proposed update like your deployment’s properties.

    Performing the update

    To proceed and deploy your NGINX deployment, select yes. This begins an update:

    Do you want to perform this update? yes
    Updating (dev):
    
         Type                              Name            Status
     +   pulumi:pulumi:Stack               quickstart-dev  created (3s)
     +   └─ kubernetes:apps/v1:Deployment  nginx           created (2s)
    
    Outputs:
        name: "nginx-bec13562"
    
    Resources:
        + 2 created
    
    Duration: 4s
    

    Updates can take some time since they wait for the Kubernetes resources to finish being created. The deployment will finish in just a few seconds.

    The extra characters you see tacked onto the deployment name (-bec13562) are the result of auto-naming, a feature that lets you use the same resource names across multiple stacks without naming collisions. You can disable or fine-tune this. To learn how, read more about auto-naming.

    If you get the error configured Kubernetes cluster is unreachable or unable to load schema information from the API server, verify your cluster access:

    1. Check your kubeconfig: kubectl config view
    2. Test cluster connectivity: kubectl cluster-info
    3. Verify authentication: kubectl auth can-i get pods

    If these commands fail, return to the Configure access step to set up your Kubernetes cluster and kubectl.

    View your update on Pulumi Cloud

    If you are logged into Pulumi Cloud, you’ll see “View Live” hyperlinks in the CLI output during your update. These go to a page with detailed information about your stack including resources, configuration, a full history of updates, and more. Navigate to it to review the details of your update:

    A stack update with console output, as shown in the Pulumi Service

    Now that the NGINX deployment has been provisioned, you’ll update it to do something more interesting.

      Neo just got smarter about infrastructure policy automation