> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/admin-guide/33/deployment-patterns/automated-deployment.md).

# Automated deployment

The following is an example of Infrastructure as Code (IaC) for the automated deployment of a Console and Defenders within a Kubernetes cluster using an Ansible playbook. This requires a docker host, Prisma Cloud Compute license and kubectl administrative access to the Kubernetes cluster. The Ansible playbook must run on a host that is able to route to the Console service’s ClusterIP address to perform the required API calls to configure the Console. Use of this Ansible playbook does not imply any rights to Palo Alto Networks products and/or services.

## Requirements

This sample IaC deployment runs on a unix based host with the following requirements:

* [docker](https://docs.docker.com/engine/install/)
* [Ansible](https://www.ansible.com/)
* [Prisma Cloud Compute license](https://www.paloaltonetworks.com/prisma/cloud)
* kubectl access to Kubernetes cluster with [permissions](/admin-guide/33/install/deploy-console/console-on-kubernetes.md) to deploy Prisma Cloud Compute.
* Ability to pull images from registry-auth.twistlock.com
* [K8s-Console-Defender-deployment-ansible.yaml](https://github.com/twistlock/sample-code/tree/master/automated-deployments/K8s-Console-Defender-deployment-ansible.yaml) Ansible playbook

## Process

<figure><img src="/files/ocw8CevMAWAVkr0R1KQo" alt="automated deployment"><figcaption></figcaption></figure>

## Ansible playbook

Pull the Ansible playbook from [here](https://github.com/twistlock/sample-code/tree/master/automated-deployments/K8s-Console-Defender-deployment-ansible.yaml). Update the variables in the `vars:` section in [*K8s-Console-Defender-deployment-ansible.yaml.*](https://github.com/twistlock/sample-code/tree/master/automated-deployments/K8s-Console-Defender-deployment-ansible.yaml)

* twistlock\_registry\_token: \<license\_token>
* twistlock\_license: \<license>
* twistlock\_install\_version: [\<version\_to\_deploy, e.g. "21\_04\_421">](https://docs.prismacloudcompute.com/docs/releases/release-information/latest.html)
* user: \<first\_admin\_username>
* password: \<first\_admin\_password>
* storage\_class: \<k8s\_storage\_class\_for\_dynamic\_persistent\_volume>
* namespace: \<namespace>

## Execution

On the unix host, sudo to root and run the command **ansible-playbook K8s-Console-Defender-deployment-ansible.yaml**

The supporting files will be written to the `/root/twistlock` directory.

## Post execution

Once the playbook has successfully completed, establish communications to the twistlock-console service’s management-port-https port (default 8083/TCP) using a [Kubernetes LoadBalancer](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/) or your organization’s approved cluster ingress technology.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.prismacloud.io/admin-guide/33/deployment-patterns/automated-deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
