2023-06-16 14:10:53 -07:00
|
|
|
---
|
|
|
|
title_tag: Deploy the Changes | Kubernetes
|
|
|
|
meta_desc: This page provides an overview of how deploy changes to a Kubernetes project.
|
|
|
|
title: Deploy changes
|
|
|
|
h1: "Pulumi & Kubernetes: Deploy changes"
|
|
|
|
weight: 7
|
|
|
|
menu:
|
|
|
|
clouds:
|
|
|
|
parent: kubernetes-get-started
|
|
|
|
identifier: kubernetes-deploy-changes
|
|
|
|
|
|
|
|
aliases:
|
|
|
|
- /docs/quickstart/kubernetes/deploy-changes/
|
|
|
|
- /docs/get-started/kubernetes/deploy-changes/
|
|
|
|
---
|
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
Deploy the stack changes.
|
2023-06-16 14:10:53 -07:00
|
|
|
|
|
|
|
```bash
|
|
|
|
$ pulumi up
|
|
|
|
```
|
|
|
|
|
|
|
|
Pulumi computes the minimally disruptive change to achieve the desired state described by the program.
|
|
|
|
|
2023-09-29 12:31:30 -05:00
|
|
|
```
|
2023-09-28 12:56:20 -05:00
|
|
|
Previewing update (dev)
|
|
|
|
|
|
|
|
Type Name Plan
|
|
|
|
pulumi:pulumi:Stack quickstart-dev
|
|
|
|
+ ├─ kubernetes:apps/v1:Deployment nginx create
|
|
|
|
+ ├─ kubernetes:core/v1:Service nginx create
|
|
|
|
- └─ kubernetes:apps/v1:Deployment app-dep delete
|
2023-06-16 14:10:53 -07:00
|
|
|
|
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
Outputs:
|
|
|
|
+ ip : "10.96.0.0"
|
|
|
|
- name: "app-dep-b7413dae"
|
2023-06-16 14:10:53 -07:00
|
|
|
|
|
|
|
Resources:
|
2023-09-28 12:56:20 -05:00
|
|
|
+ 2 to create
|
|
|
|
- 1 to delete
|
|
|
|
3 changes. 1 unchanged
|
2023-06-16 14:10:53 -07:00
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
Do you want to perform this update? [Use arrows to move, type to filter]
|
2023-06-16 14:10:53 -07:00
|
|
|
yes
|
|
|
|
> no
|
|
|
|
details
|
|
|
|
```
|
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
Select `yes` using the arrows and hit enter to update the resources in Kubernetes.
|
|
|
|
|
2023-06-16 14:10:53 -07:00
|
|
|
Pulumi will create the service since it is now defined in the program.
|
|
|
|
|
2023-09-29 12:31:30 -05:00
|
|
|
```
|
2023-06-16 14:10:53 -07:00
|
|
|
Do you want to perform this update? yes
|
2023-09-28 12:56:20 -05:00
|
|
|
Updating (dev)
|
|
|
|
|
|
|
|
Type Name Status
|
|
|
|
pulumi:pulumi:Stack quickstart-dev
|
|
|
|
+ ├─ kubernetes:apps/v1:Deployment nginx created (3s)
|
|
|
|
+ ├─ kubernetes:core/v1:Service nginx created (10s)
|
|
|
|
- └─ kubernetes:apps/v1:Deployment app-dep deleted (1s)
|
2023-06-16 14:10:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
Outputs:
|
2023-09-28 12:56:20 -05:00
|
|
|
+ ip : "10.103.199.118"
|
|
|
|
- name: "app-dep-b7413dae"
|
2023-06-16 14:10:53 -07:00
|
|
|
|
|
|
|
Resources:
|
2023-09-28 12:56:20 -05:00
|
|
|
+ 2 created
|
|
|
|
- 1 deleted
|
|
|
|
3 changes. 1 unchanged
|
2023-06-16 14:10:53 -07:00
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
Duration: 23s
|
2023-06-16 14:10:53 -07:00
|
|
|
```
|
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
View the `ip` [stack output](/docs/concepts/stack#outputs) from the nginx service.
|
2023-06-16 14:10:53 -07:00
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
```bash
|
|
|
|
$ pulumi stack output ip
|
|
|
|
```
|
|
|
|
|
2023-09-29 09:15:58 -05:00
|
|
|
> **If using Minikube:** Minikube does not support type `LoadBalancer`. Instead, forward the nginx service:
|
2023-06-16 14:10:53 -07:00
|
|
|
>
|
|
|
|
> ```bash
|
|
|
|
> $ kubectl get service
|
2023-09-28 12:56:20 -05:00
|
|
|
> NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|
|
|
> kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 44h
|
|
|
|
> nginx-9e5d5cd4 ClusterIP 10.103.199.118 <none> 80/TCP 6m47s
|
2023-06-16 14:10:53 -07:00
|
|
|
> ```
|
|
|
|
>
|
2023-09-29 09:26:39 -05:00
|
|
|
> Note: The assigned name for this particular nginx service is `nginx-9e5d5cd4`; yours will be different. In a new terminal window, run:
|
2023-09-28 12:56:20 -05:00
|
|
|
>
|
2023-06-16 14:10:53 -07:00
|
|
|
> ```bash
|
2023-09-28 12:56:20 -05:00
|
|
|
> $ kubectl port-forward service/nginx-9e5d5cd4 8080:80
|
|
|
|
> Forwarding from 127.0.0.1:8080 -> 80
|
|
|
|
> Forwarding from [::1]:8080 -> 80
|
2023-06-16 14:10:53 -07:00
|
|
|
> ```
|
|
|
|
|
2023-09-29 09:26:20 -05:00
|
|
|
Curl nginx to verify it is running.
|
2023-09-28 12:56:20 -05:00
|
|
|
|
2023-06-16 14:10:53 -07:00
|
|
|
```bash
|
2023-09-28 12:56:20 -05:00
|
|
|
$ $(pulumi config get isMinikube) && curl "http://localhost:8080" || curl $(pulumi stack output ip)
|
2023-06-16 14:10:53 -07:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Welcome to nginx!</title>
|
|
|
|
<style>
|
2023-09-28 12:56:20 -05:00
|
|
|
html { color-scheme: light dark; }
|
|
|
|
body { width: 35em; margin: 0 auto;
|
|
|
|
font-family: Tahoma, Verdana, Arial, sans-serif; }
|
2023-06-16 14:10:53 -07:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Welcome to nginx!</h1>
|
|
|
|
<p>If you see this page, the nginx web server is successfully installed and
|
|
|
|
working. Further configuration is required.</p>
|
|
|
|
|
2023-09-28 12:56:20 -05:00
|
|
|
<p>For online documentation and support please refer to
|
2023-06-16 14:10:53 -07:00
|
|
|
<a href="http://nginx.org/">nginx.org</a>.<br/>
|
|
|
|
Commercial support is available at
|
|
|
|
<a href="http://nginx.com/">nginx.com</a>.</p>
|
|
|
|
|
|
|
|
<p><em>Thank you for using nginx.</em></p>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
```
|
|
|
|
|
|
|
|
Next, we'll destroy the stack.
|
|
|
|
|
|
|
|
{{< get-started-stepper >}}
|