Skip to content

disable service sync with yaml and consume service remotely #257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/no-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ metadata:
data:
name: my-site
ingress: "none"
service-sync: "false"
40 changes: 40 additions & 0 deletions yaml/annotations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,43 @@ Applies to:
// Applies to:
// * StatefulSets


// Type: procedure
[id="service-yaml"]
= Creating a service when service-sync is disabled

If you set `service-sync: "false"` when creating a site and you want to consume a service exposed on another site:

. Create `backend.yaml` similar to the following:
+
--
[source, yaml]
----
apiVersion: v1
kind: Service
metadata:
name: backend
annotations:
skupper.io/proxy: tcp
skupper.io/address: backend
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be interesting to mention that this needs to match the name of the service created on the other side, as that will be the main alteration the user will do on this file.

skupper.io/port: "8080"
skupper.io/ingress-only: "true"
spec:
ports:
- name: http
protocol: TCP
port: 8080
targetPort: 8080
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three places where 'port' is set; it might be interesting to explain what's the role of each of them, especially given that one of them will be overwritten by Skupper.

----

NOTE: The `skupper.io/address` annotation must match the service name you have previously exposed on another site.
--

. Apply that yaml in the context of the site where `service-sync` is disabled:
+
[source, yaml]
----
$ kubectl apply -f backend.yaml
----

. Test the service.
8 changes: 5 additions & 3 deletions yaml/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,16 @@ include::../examples/my-site.yaml[]
----
The YAML creates a site with a console and you can create tokens from this site.

To create a site that has no ingress:
To create a site that has no ingress and with `service-sync` disabled:

----
include::../examples/no-ingress.yaml[]
----

NOTE: By default, `service-sync` is enabled and if you create a service on one site, {skupper-name} creates a matching service on all sites.
If `service-sync` is set to false for a site, you need to create the service on that site as described in xref:service-yaml[].


--
. Apply the YAML file to your cluster:
+
Expand Down Expand Up @@ -171,8 +175,6 @@ A future release of Skupper will provide an alternative declarative method to cr

include::annotations.adoc[leveloffset=+1]



// Type: reference
[id="site-config-reference"]
[appendix]
Expand Down