-
Notifications
You must be signed in to change notification settings - Fork 9
/
skewer.yaml
121 lines (110 loc) · 4.06 KB
/
skewer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
title: Patient Portal
subtitle: A simple database-backed web application that runs in the public cloud but keeps its data in a private database
workflow: null
overview: |
This example is a simple database-backed web application that shows
how you can use Skupper to access a database at a remote site
without exposing it to the public internet.
It contains three services:
* A PostgreSQL database running on a bare-metal or virtual
machine in a private data center.
* A payment-processing service running on Kubernetes in a private
data center.
* A web frontend service running on Kubernetes in the public
cloud. It uses the PostgreSQL database and the
payment-processing service.
The example uses two Kubernetes namespaces, `private` and `public`,
to represent the Kubernetes cluster in the private data center and
the cluster in the public cloud. It uses Podman to run the
database.
<img src="diagram.png" width="640"/>
sites:
public:
title: Public
platform: kubernetes
namespace: public
env:
KUBECONFIG: ~/.kube/config-public
private:
title: Private
platform: kubernetes
namespace: private
env:
KUBECONFIG: ~/.kube/config-private
podman:
title: Podman
platform: podman
env:
SKUPPER_PLATFORM: podman
steps:
- standard: install_the_skupper_command_line_tool
- standard: kubernetes/set_up_your_namespaces
title: Set up your Kubernetes namespaces
- standard: podman/set_up_your_podman_network
- title: Deploy the application
preamble: |
Use `kubectl apply` to deploy the frontend and payment processor
on Kubernetes. Use `podman run` to start the database on your
local machine.
**Note:** It is important to name your running container using
`--name` to avoid a collision with the container that Skupper
creates for accessing the service.
**Note:** You must use `--network skupper` with the `podman run`
command.
commands:
public:
- run: kubectl apply -f frontend/kubernetes.yaml
- await_resource: deployment/frontend
private:
- run: kubectl apply -f payment-processor/kubernetes.yaml
- await_resource: deployment/payment-processor
podman:
- run: podman run --name database-target --network skupper --detach --rm -p 5432:5432 quay.io/skupper/patient-portal-database
- title: Create your sites
commands:
public:
- run: skupper init
private:
- run: skupper init --ingress none
podman:
- run: skupper init --ingress none
- standard: link_your_sites
commands:
public:
- run: skupper token create --uses 2 ~/secret.token
private:
- run: skupper link create ~/secret.token
podman:
- run: skupper link create ~/secret.token
- title: Expose application services
preamble: |
In Private, use `skupper expose` to expose the payment processor
service.
In Podman, use `skupper service create` and `skupper service
bind` to expose the database on the Skupper network.
Then, in Public, use `skupper service create` to make it
available.
**Note:** Podman sites do not automatically replicate services
to remote sites. You need to use `skupper service create` on
each site where you wish to make a service available.
commands:
private:
- run: skupper expose deployment/payment-processor --port 8080
podman:
- run: skupper service create database 5432
- run: skupper service bind database host database-target --target-port 5432
public:
- run: skupper service create database 5432
- standard: hello_world/access_the_frontend
- standard: cleaning_up
commands:
public:
- run: skupper delete
- run: kubectl delete service/frontend
- run: kubectl delete deployment/frontend
private:
- run: skupper delete
- run: kubectl delete deployment/payment-processor
podman:
- run: skupper delete
- run: podman stop database-target