Examples Red Hat Service Interconnect 1.8 Service network tutorials with the CLI and YAML

Commands:
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-west Enter your provider-specific login command create namespace west config set-context --current --namespace west
export KUBECONFIG=~/.kube/config-east Enter your provider-specific login command create namespace east config set-context --current --namespace east
create deployment frontend --image quay.io/skupper/hello-world-frontend
create deployment backend --image quay.io/skupper/hello-world-backend --replicas 3
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'west'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "west". It is not connected to any other sites. It has no exposed services.
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'east'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "east". It is not connected to any other sites. It has no exposed services.
skupper token create ~/secret.token
skupper token create ~/secret.token Token written to ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-04421a4c5042 (name=link1) Check the status of the link using 'skupper link status'.
skupper expose deployment/backend --port 8080
skupper expose deployment/backend --port 8080 deployment backend exposed as backend
port-forward deployment/frontend 8080:8080
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public Enter your provider-specific login command create namespace public config set-context --current --namespace public
export KUBECONFIG=~/.kube/config-private Enter your provider-specific login command create namespace private config set-context --current --namespace private
apply -f server
kubectl apply -f server deployment.apps/broker created
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'public'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "public". It is not connected to any other sites. It has no exposed services.
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'private'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "private". It is not connected to any other sites. It has no exposed services.
skupper token create ~/secret.token
skupper token create ~/secret.token Token written to ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-04421a4c5042 (name=link1) Check the status of the link using 'skupper link status'.
skupper expose deployment/broker --port 5672
skupper expose deployment/broker --port 5672 deployment broker exposed as broker
get service/broker
kubectl get service/broker NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE broker ClusterIP 10.100.58.95 <none> 5672/TCP 2s
run client --attach --rm --restart Never --image quay.io/skupper/activemq-example-client --env SERVER=broker
kubectl run client --attach --rm --restart Never --image quay.io/skupper/activemq-example-client --env SERVER=broker ____ __ _____ ___ __ ____ ____ --/ __ \/ / / / _ | / _ \/ //_/ / / / / -/ /_/ / /_/ / __ |/ , / ,< / // /\ --\___\_\____/_/ |_/_/|_/_/|_|\____/_/ 2022-05-27 11:19:07,149 INFO [io.sma.rea.mes.amqp] (main) SRMSG16201: AMQP broker configured to broker:5672 for channel incoming-messages 2022-05-27 11:19:07,170 INFO [io.sma.rea.mes.amqp] (main) SRMSG16201: AMQP broker configured to broker:5672 for channel outgoing-messages 2022-05-27 11:19:07,198 INFO [io.sma.rea.mes.amqp] (main) SRMSG16212: Establishing connection with AMQP broker 2022-05-27 11:19:07,212 INFO [io.sma.rea.mes.amqp] (main) SRMSG16212: Establishing connection with AMQP broker 2022-05-27 11:19:07,215 INFO [io.quarkus] (main) client 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.9.2.Final) started in 0.397s. 2022-05-27 11:19:07,215 INFO [io.quarkus] (main) Profile prod activated. 2022-05-27 11:19:07,215 INFO [io.quarkus] (main) Installed features: [cdi, smallrye-context-propagation, smallrye-reactive-messaging, smallrye-reactive-messaging-amqp, vertx] Sent message 1 Sent message 2 Sent message 3 Sent message 4 Sent message 5 Sent message 6 Sent message 7 Sent message 8 Sent message 9 Sent message 10 2022-05-27 11:19:07,434 INFO [io.sma.rea.mes.amqp] (vert.x-eventloop-thread-0) SRMSG16213: Connection with AMQP broker established 2022-05-27 11:19:07,442 INFO [io.sma.rea.mes.amqp] (vert.x-eventloop-thread-0) SRMSG16213: Connection with AMQP broker established 2022-05-27 11:19:07,468 INFO [io.sma.rea.mes.amqp] (vert.x-eventloop-thread-0) SRMSG16203: AMQP Receiver listening address notifications Received message 1 Received message 2 Received message 3 Received message 4 Received message 5 Received message 6 Received message 7 Received message 8 Received message 9 Received message 10 Result: OK
kamel install
export KUBECONFIG=~/.kube/config-private1
export KUBECONFIG=~/.kube/config-public1
export KUBECONFIG=~/.kube/config-public2
create namespace private1 config set-context --current --namespace private1
create namespace public1 config set-context --current --namespace public1
create namespace public2 config set-context --current --namespace public2
skupper init
skupper init
skupper init
skupper status
skupper status
skupper status
Skupper is enabled for namespace "<namespace>" in interior mode. It is not connected to any other sites. It has no exposed services. The site console url is: http://<address>:8080 The credentials for internal console-auth mode are held in secret: 'skupper-console-users'
skupper token create ~/public1.token --uses 2
skupper link create ~/public1.token skupper link status --wait 30 skupper token create ~/public2.token
skupper link create ~/public1.token skupper link create ~/public2.token skupper link status --wait 30
create -f src/main/resources/database/postgres-svc.yaml skupper expose deployment postgres --address postgres --port 5432 -n private1
run pg-shell -i --tty --image quay.io/skupper/simple-pg --env="PGUSER=postgresadmin" --env="PGPASSWORD=admin123" --env="PGHOST=USD(kubectl get service postgres -o=jsonpath='{.spec.clusterIP}')" -- bash psql --dbname=postgresdb CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE TABLE tw_feedback (id uuid DEFAULT uuid_generatev4 (),sigthning VARCHAR(255),created TIMESTAMP default CURRENTTIMESTAMP,PRIMARY KEY(id));
src/main/resources/scripts/setUpPublic1Cluster.sh
src/main/resources/scripts/setUpPublic2Cluster.sh
attach pg-shell -c pg-shell -i -t psql --dbname=postgresdb SELECT * FROM twfeedback;
id | sigthning | created --------------------------------------+-----------------+---------------------------- 95655229-747a-4787-8133-923ef0a1b2ca | Testing skupper | 2022-03-10 19:35:08.412542
kamel logs twitter-route
"[1] 2022-03-10 19:35:08,397 INFO [postgresql-sink-1] (Camel (camel-1) thread #0 - twitter-search://skupper) Testing skupper"
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public Enter your provider-specific login command create namespace public config set-context --current --namespace public
export KUBECONFIG=~/.kube/config-private Enter your provider-specific login command create namespace private config set-context --current --namespace private
apply -f server
kubectl apply -f server deployment.apps/ftp-server created
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'public'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "public". It is not connected to any other sites. It has no exposed services.
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'private'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "private". It is not connected to any other sites. It has no exposed services.
skupper token create ~/secret.token
skupper token create ~/secret.token Token written to ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-04421a4c5042 (name=link1) Check the status of the link using 'skupper link status'.
skupper expose deployment/ftp-server --port 21100 --port 21
skupper expose deployment/ftp-server --port 21100 --port 21 deployment ftp-server exposed as ftp-server
echo "Hello!" | kubectl run ftp-client --stdin --rm --image=docker.io/curlimages/curl --restart=Never -- -s -T - ftp://example:example@ftp-server/greeting run ftp-client --attach --rm --image=docker.io/curlimages/curl --restart=Never -- -s ftp://example:example@ftp-server/greeting
echo "Hello!" | kubectl run ftp-client --stdin --rm --image=docker.io/curlimages/curl --restart=Never -- -s -T - ftp://example:example@ftp-server/greeting pod "ftp-client" deleted kubectl run ftp-client --attach --rm --image=docker.io/curlimages/curl --restart=Never -- -s ftp://example:example@ftp-server/greeting Hello! pod "ftp-client" deleted
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public1
export KUBECONFIG=~/.kube/config-public2
export KUBECONFIG=~/.kube/config-private1
create namespace public1 config set-context --current --namespace public1
create namespace public2 config set-context --current --namespace public2
create namespace private1 config set-context --current --namespace private1
skupper init --enable-console --enable-flow-collector
skupper init
skupper init
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace '<namespace>'. Use 'skupper status' to get more information.
skupper status
skupper status
skupper status
Skupper is enabled for namespace "<namespace>" in interior mode. It is connected to 1 other site. It has 1 exposed service. The site console url is: <console-url> The credentials for internal console-auth mode are held in secret: 'skupper-console-users'
skupper token create ~/private1-to-public1-token.yaml skupper token create ~/public2-to-public1-token.yaml
skupper token create ~/private1-to-public2-token.yaml skupper link create ~/public2-to-public1-token.yaml skupper link status --wait 60
skupper link create ~/private1-to-public1-token.yaml skupper link create ~/private1-to-public2-token.yaml skupper link status --wait 60
apply -f deployment-iperf3-a.yaml
apply -f deployment-iperf3-b.yaml
apply -f deployment-iperf3-c.yaml
skupper expose deployment/iperf3-server-a --port 5201
skupper expose deployment/iperf3-server-b --port 5201
skupper expose deployment/iperf3-server-c --port 5201
exec USD(kubectl get pod -l application=iperf3-server-a -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-a exec USD(kubectl get pod -l application=iperf3-server-a -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-b exec USD(kubectl get pod -l application=iperf3-server-a -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-c
exec USD(kubectl get pod -l application=iperf3-server-b -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-a exec USD(kubectl get pod -l application=iperf3-server-b -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-b exec USD(kubectl get pod -l application=iperf3-server-b -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-c
exec USD(kubectl get pod -l application=iperf3-server-c -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-a exec USD(kubectl get pod -l application=iperf3-server-c -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-b exec USD(kubectl get pod -l application=iperf3-server-c -o=jsonpath='{.items[0].metadata.name}') -- iperf3 -c iperf3-server-c
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public Enter your provider-specific login command create namespace public config set-context --current --namespace public
export KUBECONFIG=~/.kube/config-private Enter your provider-specific login command create namespace private config set-context --current --namespace private
create -f server/strimzi.yaml apply -f server/cluster1.yaml wait --for condition=ready --timeout 900s kafka/cluster1
kubectl create -f server/strimzi.yaml customresourcedefinition.apiextensions.k8s.io/kafkas.kafka.strimzi.io created rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-entity-operator-delegation created clusterrolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator created rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-topic-operator-delegation created customresourcedefinition.apiextensions.k8s.io/kafkausers.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkarebalances.kafka.strimzi.io created deployment.apps/strimzi-cluster-operator created customresourcedefinition.apiextensions.k8s.io/kafkamirrormaker2s.kafka.strimzi.io created clusterrole.rbac.authorization.k8s.io/strimzi-entity-operator created clusterrole.rbac.authorization.k8s.io/strimzi-cluster-operator-global created clusterrolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-kafka-broker-delegation created rolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator created clusterrole.rbac.authorization.k8s.io/strimzi-cluster-operator-namespaced created clusterrole.rbac.authorization.k8s.io/strimzi-topic-operator created clusterrolebinding.rbac.authorization.k8s.io/strimzi-cluster-operator-kafka-client-delegation created clusterrole.rbac.authorization.k8s.io/strimzi-kafka-client created serviceaccount/strimzi-cluster-operator created clusterrole.rbac.authorization.k8s.io/strimzi-kafka-broker created customresourcedefinition.apiextensions.k8s.io/kafkatopics.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkabridges.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkaconnectors.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkaconnects2is.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkaconnects.kafka.strimzi.io created customresourcedefinition.apiextensions.k8s.io/kafkamirrormakers.kafka.strimzi.io created configmap/strimzi-cluster-operator created kubectl apply -f server/cluster1.yaml kafka.kafka.strimzi.io/cluster1 created kafkatopic.kafka.strimzi.io/topic1 created kubectl wait --for condition=ready --timeout 900s kafka/cluster1 kafka.kafka.strimzi.io/cluster1 condition met
spec: kafka: listeners: - name: plain port: 9092 type: internal tls: false configuration: brokers: - broker: 0 advertisedHost: cluster1-kafka-0.cluster1-kafka-brokers
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'public'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "public". It is not connected to any other sites. It has no exposed services.
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'private'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "private". It is not connected to any other sites. It has no exposed services.
skupper token create ~/secret.token
skupper token create ~/secret.token Token written to ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-04421a4c5042 (name=link1) Check the status of the link using 'skupper link status'.
skupper expose statefulset/cluster1-kafka --headless --port 9092
skupper expose statefulset/cluster1-kafka --headless --port 9092 statefulset cluster1-kafka exposed as cluster1-kafka-brokers
get service/cluster1-kafka-brokers
kubectl get service/cluster1-kafka-brokers NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE cluster1-kafka-brokers ClusterIP None <none> 9092/TCP 2s
run client --attach --rm --restart Never --image quay.io/skupper/kafka-example-client --env BOOTSTRAPSERVERS=cluster1-kafka-brokers:9092
kubectl run client --attach --rm --restart Never --image quay.io/skupper/kafka-example-client --env BOOTSTRAPSERVERS=cluster1-kafka-brokers:9092 [...] Received message 1 Received message 2 Received message 3 Received message 4 Received message 5 Received message 6 Received message 7 Received message 8 Received message 9 Received message 10 Result: OK [...]
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public Enter your provider-specific login command create namespace public config set-context --current --namespace public
export KUBECONFIG=~/.kube/config-private Enter your provider-specific login command create namespace private config set-context --current --namespace private
export SKUPPERPLATFORM=podman network create skupper systemctl --user enable --now podman.socket
system service --time=0 unix://USDXDGRUNTIMEDIR/podman/podman.sock &
apply -f frontend/kubernetes.yaml
apply -f payment-processor/kubernetes.yaml
run --name database-target --network skupper --detach --rm -p 5432:5432 quay.io/skupper/patient-portal-database
skupper init
skupper init --ingress none
skupper init --ingress none
skupper token create --uses 2 ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token
skupper expose deployment/payment-processor --port 8080
skupper service create database 5432 skupper service bind database host database-target --target-port 5432
skupper service create database 5432
expose deployment/frontend --port 8080 --type LoadBalancer get service/frontend curl http://<external-ip>:8080/api/health
kubectl expose deployment/frontend --port 8080 --type LoadBalancer service/frontend exposed kubectl get service/frontend NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE frontend LoadBalancer 10.103.232.28 <external-ip> 8080:30407/TCP 15s curl http://<external-ip>:8080/api/health OK
sudo dnf install skupper-cli
export KUBECONFIG=~/.kube/config-public Enter your provider-specific login command create namespace public config set-context --current --namespace public
export KUBECONFIG=~/.kube/config-private Enter your provider-specific login command create namespace private config set-context --current --namespace private
create -f kafka-cluster/strimzi.yaml apply -f kafka-cluster/cluster1.yaml wait --for condition=ready --timeout 900s kafka/cluster1
spec: kafka: listeners: - name: plain port: 9092 type: internal tls: false configuration: brokers: - broker: 0 advertisedHost: cluster1-kafka-0.cluster1-kafka-brokers
apply -f order-processor/kubernetes.yaml apply -f market-data/kubernetes.yaml apply -f frontend/kubernetes.yaml
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'public'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "public". It is not connected to any other sites. It has no exposed services.
skupper init skupper status
skupper init Waiting for LoadBalancer IP or hostname Waiting for status Skupper is now installed in namespace 'private'. Use 'skupper status' to get more information. skupper status Skupper is enabled for namespace "private". It is not connected to any other sites. It has no exposed services.
skupper token create ~/secret.token
skupper token create ~/secret.token Token written to ~/secret.token
skupper link create ~/secret.token
skupper link create ~/secret.token Site configured to link to https://10.105.193.154:8081/ed9c37f6-d78a-11ec-a8c7-04421a4c5042 (name=link1) Check the status of the link using 'skupper link status'.
skupper expose statefulset/cluster1-kafka --headless --port 9092
get service/cluster1-kafka-brokers
expose deployment/frontend --port 8080 --type LoadBalancer get service/frontend curl http://<external-ip>:8080/api/health
kubectl expose deployment/frontend --port 8080 --type LoadBalancer service/frontend exposed kubectl get service/frontend NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE frontend LoadBalancer 10.103.232.28 <external-ip> 8080:30407/TCP 15s curl http://<external-ip>:8080/api/health OK