이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 13. Configuring Skupper sites using YAML
Using YAML files to configure Skupper allows you to use source control to track and manage Skupper network changes.
13.1. Creating a Skupper site using YAML 링크 복사링크가 클립보드에 복사되었습니다!
Using YAML files to create Skupper sites allows you to use source control to track and manage Skupper network changes.
Prerequisites
- Skupper is installed in the cluster or namespace you want to target.
- You are logged into the cluster.
Procedure
Create a YAML file to define the site, for example,
my-site.yaml
:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The YAML creates a site with a console and you can create tokens from this site.
To create a site that has no ingress:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the YAML file to your cluster:
kubectl apply -f ~/my-site.yml
kubectl apply -f ~/my-site.yml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
See the Section 13.3, “Site ConfigMap YAML reference” section for more reference.
13.2. Configuring services using annotations 링크 복사링크가 클립보드에 복사되었습니다!
After creating and linking sites, you can use Kubernetes annotations to control which services are available on the service network.
13.2.1. Exposing simple services on a service network using annotations 링크 복사링크가 클립보드에 복사되었습니다!
This section provides an alternative to the skupper expose
command, allowing you to annotate existing resources to expose simple services on the service network.
Prerequisites
- A site with a service you want to expose
Procedure
- Log into the namespace in your cluster that is configured as a site.
Create a deployment, some pods, or a service in one of your sites, for example:
kubectl create deployment hello-world-backend --image quay.io/skupper/hello-world-backend
$ kubectl create deployment hello-world-backend --image quay.io/skupper/hello-world-backend
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This step is not Skupper-specific, that is, this process is unchanged from standard processes for your cluster.
Annotate the kubernetes resource to create a service that can communicate on the service network, for example:
kubectl annotate deployment backend "skupper.io/address=backend" "skupper.io/port=8080" "skupper.io/proxy=tcp"
$ kubectl annotate deployment backend "skupper.io/address=backend" "skupper.io/port=8080" "skupper.io/proxy=tcp"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The annotations include:
-
skupper.io/proxy
- the protocol you want to use,tcp
,http
orhttp2
. This is the only annotation that is required. For example, if you annotate a simple deployment namedbackend
withskupper.io/proxy=tcp
, the service is exposed asbackend
and thecontainerPort
value of the deployment is used as the port number. -
skupper.io/address
- the name of the service on the service network. -
skupper.io/port
- one or more ports for the service on the service network.
NoteWhen exposing services, rather than other resources like deployments, you can use the
skupper.io/target
annotation to avoid modifying the original service. For example, if you want to expose thebackend
service:kubectl annotate service backend "skupper.io/address=van-backend" "skupper.io/port=8080" \ "skupper.io/proxy=tcp" "skupper.io/target=backend"
$ kubectl annotate service backend "skupper.io/address=van-backend" "skupper.io/port=8080" \ "skupper.io/proxy=tcp" "skupper.io/target=backend"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow This allows you to delete and recreate the
backend
service without having to apply the annotation again.-
Check that you have exposed the service:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe related targets for services are only displayed when the target is available on the current cluster.
13.2.2. Understanding Skupper annotations 링크 복사링크가 클립보드에 복사되었습니다!
Annotations allow you to expose services on the service network. This section provides details on the scope of those annotations
- skupper.io/address
The name of the service on the service network. Applies to:
- Deployments
- StatefulSets
- DaemonSets
- Services
- skupper.io/port
The port for the service on the service network. Applies to:
- Deployments
- StatefulSets
- DaemonSets
- skupper.io/proxy
The protocol you want to use,
tcp
,http
orhttp2
. Applies to:- Deployments
- StatefulSets
- DaemonSets
- Services
- skupper.io/target
The name of the target service you want to expose. Applies to:
- Services
- skupper.io/service-labels
A comma separated list of label keys and values for the exposed service. You can use this annotation to set up labels for monitoring exposed services. Applies to:
- Deployments
- DaemonSets
- Services
13.3. Site ConfigMap YAML reference 링크 복사링크가 클립보드에 복사되었습니다!
Using YAML files to configure Skupper requires that you understand all the fields so that you provision the site you require.
The following YAML defines a Skupper site:
- name
- Specifies the site name.
- console
Enables the skupper console, defaults to
false
.NoteYou must enable
console
andflow-collector
for the console to function.- flow-collector
-
Enables the flow collector, defaults to
false
. - console-authentication
-
Specifies the skupper console authentication method. The options are
openshift
,internal
,unsecured
. - console-user
-
Username for the
internal
authentication option. - console-password
-
Password for the
internal
authentication option. - cluster-local
-
Only accept connections from within the local cluster, defaults to
false
. - edge
-
Specifies whether an edge site is created, defaults to
false
. - service-sync
-
Specifies whether the services are synchronized across the service network, defaults to
true
. - ingress
- Specifies whether the site supports ingress. If you do not specify a value, the default ingress ('loadbalancer' on Kubernetes, 'route' on OpenShift) is enabled. This allows you to create tokens usable from remote sites.
All ingress types are supported using the same parameters as the skupper
CLI.