forked from skupperproject/skupper-example-patient-portal
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathskewer.yaml
101 lines (94 loc) · 4.34 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
title: Patient Portal
subtitle: A simple database-backed web application that runs in the public cloud but keeps its data in a private database
github_actions_url: https://github.com/skupperproject/skupper-example-patient-portal/actions/workflows/main.yaml
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.
This example uses two Kubernetes namespaces, "private" and "public",
to represent the private Kubernetes cluster and the public cloud.
sites:
public:
kubeconfig: ~/.kube/config-public
namespace: public
private:
kubeconfig: ~/.kube/config-private
namespace: private
steps:
- standard: install_the_skupper_command_line_tool
- standard: configure_separate_console_sessions
- standard: access_your_clusters
- standard: set_up_your_namespaces
- standard: install_skupper_in_your_namespaces
- standard: check_the_status_of_your_namespaces
- standard: link_your_namespaces
- title: Deploy and expose the database
preamble: |
Use `docker` to run the database service on your local machine.
In the public namespace, use the `skupper gateway expose`
command to expose the database on the Skupper network.
Use `kubectl get service/database` to ensure the database
service is available.
commands:
public:
- run: docker run --name database --detach --rm -p 5432:5432 quay.io/skupper/patient-portal-database
- run: skupper gateway expose database localhost 5432 --type docker
output: 2022/05/19 16:37:00 CREATE io.skupper.router.tcpConnector fancypants-jross-egress-database:5432 map[address:database:5432 host:localhost name:fancypants-jross-egress-database:5432 port:5432 siteId:0e7b70cf-1931-4c93-9614-0ecb3d0d6522]
- await: service/database
- run: kubectl get service/database
output: |
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
database ClusterIP 10.104.77.32 <none> 5432/TCP 15s
- title: Deploy and expose the payment processor
preamble: |
In the private namespace, use the `kubectl apply` command to
deploy the payment processor service. Use the `skupper expose`
command to expose the service on the Skupper network.
In the public namespace, use `kubectl get service/payment-processor` to
check that the `payment-processor` service appears after a
moment.
commands:
private:
- run: kubectl apply -f payment-processor/kubernetes.yaml
output: deployment.apps/payment-processor created
- await: deployment/payment-processor
- run: skupper expose deployment/payment-processor --port 8080
output: deployment payment-processor exposed as payment-processor
public:
- await: service/payment-processor
- run: kubectl get service/payment-processor
output: |
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
payment-processor ClusterIP 10.103.227.109 <none> 8080/TCP 1s
- title: Deploy and expose the frontend
preamble: |
In the public namespace, use the `kubectl apply` command to
deploy the frontend service. This also sets up an external load
balancer for the frontend.
commands:
public:
- run: kubectl apply -f frontend/kubernetes.yaml
output: |
deployment.apps/frontend created
service/frontend created
- await: [deployment/frontend, service/frontend]
- standard: test_the_application
- standard: cleaning_up
commands:
public:
- run: docker stop database
- run: skupper gateway delete
- run: skupper delete
- run: kubectl delete service/frontend
- run: kubectl delete deployment/frontend
private:
- run: skupper delete
- run: kubectl delete deployment/payment-processor