Skip to content

Commit 66c6e62

Browse files
committed
Moved full site from lauralorenz/sig-multicluster-site-proposal
Signed-off-by: Nicolas Pintaux <[email protected]>
1 parent 9e8bd87 commit 66c6e62

30 files changed

+881
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv/

README.md

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
# Kubernetes Template Project
1+
# SIG-Multicluster website
22

3-
The Kubernetes Template Project is a template for starting new projects in the GitHub organizations owned by Kubernetes. All Kubernetes projects, at minimum, must have the following files:
4-
5-
- a `README.md` outlining the project goals, sponsoring sig, and community contact information
6-
- an `OWNERS` with the project leads listed as approvers ([docs on `OWNERS` files][owners])
7-
- a `CONTRIBUTING.md` outlining how to contribute to the project
8-
- an unmodified copy of `code-of-conduct.md` from this repo, which outlines community behavior and the consequences of breaking the code
9-
- a `LICENSE` which must be Apache 2.0 for code projects, or [Creative Commons 4.0] for documentation repositories, without any custom content
10-
- a `SECURITY_CONTACTS` with the contact points for the Product Security Team
11-
to reach out to for triaging and handling of incoming issues. They must agree to abide by the
12-
[Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy)
13-
and will be removed and replaced if they violate that agreement.
3+
This repo holds and hosts the site for SIG-Multicluster, a special interest group of the Kubernetes project.
144

155
## Community, discussion, contribution, and support
166

@@ -27,3 +17,34 @@ Participation in the Kubernetes community is governed by the [Kubernetes Code of
2717

2818
[owners]: https://git.k8s.io/community/contributors/guide/owners.md
2919
[Creative Commons 4.0]: https://git.k8s.io/website/LICENSE
20+
21+
# Contributors
22+
23+
## Install and run
24+
25+
Install Python and the requirements.
26+
27+
```
28+
python3 -m venv venv/
29+
source venv/bin/activate
30+
pip install -r requirements.txt
31+
```
32+
33+
Install the mkdocs plugins
34+
35+
```
36+
pip install mkdocs-awesome-pages-plugin
37+
pip install mkdocs-macros-plugin
38+
pip install mkdocs-redirects
39+
```
40+
Use the mkdocs CLI to serve a development version of the site.
41+
42+
```mkdocs serve```
43+
44+
Navigate to localhost:8000 to see the site.
45+
46+
## Build and deploy
47+
48+
Use the mkdocs CLI to deploy to the `gh-pages` branch of the repo.
49+
50+
```mkdocs gh-deploy```

apis/doc.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright 2020 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package apis

apis/service_export.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package apis
2+
3+
// ServiceExport declares that the associated service should be exported to
4+
// other clusters.
5+
type ServiceExport struct {
6+
metav1.TypeMeta `json:",inline"`
7+
// +optional
8+
metav1.ObjectMeta `json:"metadata,omitempty"`
9+
// +optional
10+
Status ServiceExportStatus `json:"status,omitempty"`
11+
}
12+
13+
// ServiceExportStatus contains the current status of an export.
14+
type ServiceExportStatus struct {
15+
// +optional
16+
// +patchStrategy=merge
17+
// +patchMergeKey=type
18+
// +listType=map
19+
// +listMapKey=type
20+
Conditions []ServiceExportCondition `json:"conditions,omitempty"`
21+
}
22+
23+
// ServiceExportConditionType identifies a specific condition.
24+
type ServiceExportConditionType string
25+
26+
const {
27+
// ServiceExportValid means that the service referenced by this
28+
// service export has been recognized as valid by an mcs-controller.
29+
// This will be false if the service is found to be unexportable
30+
// (ExternalName, not found).
31+
ServiceExportValid ServiceExportConditionType = "Valid"
32+
// ServiceExportConflict means that there is a conflict between two
33+
// exports for the same Service. When "True", the condition message
34+
// should contain enough information to diagnose the conflict:
35+
// field(s) under contention, which cluster won, and why.
36+
// Users should not expect detailed per-cluster information in the
37+
// conflict message.
38+
ServiceExportConflict ServiceExportConditionType = "Conflict"
39+
}
40+
41+
// ServiceExportCondition contains details for the current condition of this
42+
// service export.
43+
//
44+
// Once KEP-1623 (sig-api-machinery/1623-standardize-conditions) is
45+
// implemented, this will be replaced by metav1.Condition.
46+
type ServiceExportCondition struct {
47+
Type ServiceExportConditionType `json:"type"`
48+
// Status is one of {"True", "False", "Unknown"}
49+
Status corev1.ConditionStatus `json:"status"`
50+
// +optional
51+
LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
52+
// +optional
53+
Reason *string `json:"reason,omitempty"`
54+
// +optional
55+
Message *string `json:"message,omitempty"`
56+
}

apis/service_import.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package apis
2+
3+
// ServiceImport describes a service imported from clusters in a clusterset.
4+
type ServiceImport struct {
5+
metav1.TypeMeta `json:",inline"`
6+
// +optional
7+
metav1.ObjectMeta `json:"metadata,omitempty"`
8+
// +optional
9+
Spec ServiceImportSpec `json:"spec,omitempty"`
10+
// +optional
11+
Status ServiceImportStatus `json:"status,omitempty"`
12+
}
13+
14+
// ServiceImportType designates the type of a ServiceImport
15+
type ServiceImportType string
16+
17+
const (
18+
// ClusterSetIP are only accessible via the ClusterSet IP.
19+
ClusterSetIP ServiceImportType = "ClusterSetIP"
20+
// Headless services allow backend pods to be addressed directly.
21+
Headless ServiceImportType = "Headless"
22+
)
23+
24+
// ServiceImportSpec describes an imported service and the information necessary to consume it.
25+
type ServiceImportSpec struct {
26+
// +listType=atomic
27+
Ports []ServicePort `json:"ports"`
28+
// +kubebuilder:validation:MaxItems:=1
29+
// +optional
30+
IPs []string `json:"ips,omitempty"`
31+
// +optional
32+
Type ServiceImportType `json:"type"`
33+
// +optional
34+
SessionAffinity corev1.ServiceAffinity `json:"sessionAffinity"`
35+
// +optional
36+
SessionAffinityConfig *corev1.SessionAffinityConfig `json:"sessionAffinityConfig"`
37+
}
38+
39+
// ServicePort represents the port on which the service is exposed
40+
type ServicePort struct {
41+
// The name of this port within the service. This must be a DNS_LABEL.
42+
// All ports within a ServiceSpec must have unique names. When considering
43+
// the endpoints for a Service, this must match the 'name' field in the
44+
// EndpointPort.
45+
// Optional if only one ServicePort is defined on this service.
46+
// +optional
47+
Name string `json:"name,omitempty"`
48+
49+
// The IP protocol for this port. Supports "TCP", "UDP", and "SCTP".
50+
// Default is TCP.
51+
// +optional
52+
Protocol Protocol `json:"protocol,omitempty"`
53+
54+
// The application protocol for this port.
55+
// This field follows standard Kubernetes label syntax.
56+
// Un-prefixed names are reserved for IANA standard service names (as per
57+
// RFC-6335 and http://www.iana.org/assignments/service-names).
58+
// Non-standard protocols should use prefixed names such as
59+
// mycompany.com/my-custom-protocol.
60+
// Field can be enabled with ServiceAppProtocol feature gate.
61+
// +optional
62+
AppProtocol *string `json:"appProtocol,omitempty"`
63+
64+
// The port that will be exposed by this service.
65+
Port int32 `json:"port"`
66+
}
67+
68+
// ServiceImportStatus describes derived state of an imported service.
69+
type ServiceImportStatus struct {
70+
// +optional
71+
// +patchStrategy=merge
72+
// +patchMergeKey=cluster
73+
// +listType=map
74+
// +listMapKey=cluster
75+
Clusters []ClusterStatus `json:"clusters"`
76+
}
77+
78+
// ClusterStatus contains service configuration mapped to a specific source cluster
79+
type ClusterStatus struct {
80+
Cluster string `json:"cluster"`
81+
}

docs/index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Welcome to MkDocs
2+
3+
For full documentation visit [mkdocs.org](https://www.mkdocs.org).
4+
5+
## Commands
6+
7+
* `mkdocs new [dir-name]` - Create a new project.
8+
* `mkdocs serve` - Start the live-reloading docs server.
9+
* `mkdocs build` - Build the documentation site.
10+
* `mkdocs -h` - Print help message and exit.
11+
12+
## Project layout
13+
14+
mkdocs.yml # The configuration file.
15+
docs/
16+
index.md # The documentation homepage.
17+
... # Other markdown pages, images and other files.

mkdocs.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
site_name: SIG Multicluster
2+
repo_url: https://github.com/kubernetes-sigs/sig-multicluster-site
3+
repo_name: kubernetes-sigs/sig-multicluster-site
4+
site_dir: site
5+
docs_dir: site-src
6+
theme:
7+
name: material
8+
icon:
9+
repo: fontawesome/brands/git-alt
10+
logo: images/k8s-favicon.png
11+
favicon: images/k8s-favicon.png
12+
features:
13+
- search.highlight
14+
- navigation.tabs
15+
- navigation.top
16+
edit_uri: edit/main/site-src/
17+
plugins:
18+
- search
19+
- awesome-pages
20+
- redirects:
21+
redirect_maps:
22+
'guides/getting-started.md': 'guides/index.md'
23+
'contributing/community.md': 'contributing/index.md'
24+
markdown_extensions:
25+
- admonition
26+
- meta
27+
- pymdownx.emoji:
28+
emoji_index: !!python/name:materialx.emoji.twemoji
29+
emoji_generator: !!python/name:materialx.emoji.to_svg
30+
- pymdownx.highlight
31+
- pymdownx.inlinehilite
32+
- pymdownx.superfences
33+
- pymdownx.snippets
34+
- toc:
35+
permalink: true
36+
nav:
37+
- Overview:
38+
Introduction: index.md
39+
About API Overview: concepts/about-api.md
40+
Multicluster Services API Overview: concepts/multicluster-services-api.md
41+
Work API Overview: concepts/work-api.md
42+
- Guides:
43+
- Index: guides/index.md
44+
- Implementation Guidelines: guides/guidelines.md
45+
- Reference:
46+
- Namespace Sameness: concepts/namespace-sameness.md
47+
- ClusterSet: api-types/cluster-set.md
48+
- ServiceExport: api-types/service-export.md
49+
- ServiceImport: api-types/service-import.md
50+
- API specification: references/spec.md
51+
- Contributing:
52+
- How to Get Involved: contributing/index.md
53+
- FAQ: contributing/faq.md
54+
- Announcements:
55+
- Index: blog/index.md
56+
- 2022:
57+
- Archiving Kubefed on Jan 3rd, 2023: blog/2022/2022-11-16_archiving-kubefed-on-Jan-3-2023.md

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mkdocs-material

site-src/api-types/cluster-set.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ClusterSet
2+
3+
ClusterSet represents a specific pattern implemented by various organizations. A ClusterSet is typically:
4+
5+
- A group of clusters governed by a single authority.
6+
- There is usually a high degree of trust within the set of clusters.
7+
- [Namespace Sameness](../concepts/namespace-sameness.md) applies to clusters in the set:
8+
- Permissions and characteristics are consistent across clusters for a given namespace.
9+
- Namespaces don't have to exist in every cluster, but behave the same across those in which they do.
10+
11+
!!!note
12+
The early definition of the ClusterSet was described in [KEP-2149](https://github.com/kubernetes/enhancements/tree/master/keps/sig-multicluster/2149-clusterid). It is now part of the [About API](https://sigs.k8s.io/about-api).
13+
14+
A cluster's ClusterSet membership is stored in the about.k8s.io/ClusterProperty `clusterset.k8s.io`.
15+
16+
## Cluster Metadata
17+
The ClusterSet is a Cluster-scoped ClusterProperty CRD (Customer Resource Definition), that stores a name and a value.
18+
19+
This property can be used to:
20+
21+
- uniquely identify clusters using a clusterID
22+
23+
```
24+
apiVersion: about.k8s.io/v1
25+
kind: ClusterProperty
26+
metadata:
27+
name: cluster.clusterset.k8s.io
28+
spec:
29+
value: cluster-1
30+
```
31+
32+
- uniquely identify the membership of a cluster in a ClusterSet for the lifetime of the membership.
33+
34+
```
35+
apiVersion: about.k8s.io/v1
36+
kind: ClusterProperty
37+
metadata:
38+
name: clusterset.k8s.io
39+
spec:
40+
value: mycoolclusterset
41+
```
42+
43+
- Provide a reference point for multi-cluster tooling to build on within a cluster set, for example for DNS labels, for logging and tracing, etc.
44+
45+
- Provide extra metadata space to store other cluster properties that might otherwise be implemented as ad-hoc annotations on semantically adjacent objects.
46+
47+
```
48+
apiVersion: about.k8s.io/v1
49+
kind: ClusterProperty
50+
metadata:
51+
name: fingerprint.mycoolimplementation.com
52+
spec:
53+
value: '{"major": "1","minor": "18","gitVersion": "v1.18.2","gitCommit": "52c56ce7a8272c798dbc29846288d7cd9fbae032","gitTreeState": "clean","buildDate": "2020-04-30T20:19:45Z","goVersion": "go1.13.9","compiler": "gc","platform": "linux/amd64"}'
54+
```
55+
56+
57+
58+
59+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ServiceExport
2+
3+
## Resource Definition
4+
A ServiceExport is a Customer Resource Definition used to specify which Kubernetes Services should be exported within a cluster.
5+
6+
A ServiceExport resource is created with the cluster and namespace that a given Service resides in, and is name-mapped to the service for export. In other words, the ServiceExport is referenced with the same name as the export.
7+
8+
If multiple clusters export a Service with the same namespaced name, they will be recognized as a single combined service.
9+
10+
## DNS
11+
When a ServiceExport is created, this will cause a domain name for the multi-cluster service to become accessible from within the ClusterSet. The domain name will be `<service-export-name>.<service-export-namespace>.svc.clusterset.local`.
12+
13+
## EndPointSlice
14+
When a ServiceExport is created, this will cause EndpointSlice objects for the underlying Service to be created in each cluster within the ClusterSet. One or more EndpointSlice resources will exist for each cluster that exported the Service, with each EndpointSlice containing only endpoints from its source cluster. These EndpointSlice objects are marked as managed by the ClusterSet service controller, so that the endpoint slice controller doesn’t delete them.

0 commit comments

Comments
 (0)