Skip to content

Commit 08a2549

Browse files
author
Ben Du
authored
Add ability to install from release version + doc updates (#29)
* Add instructions for installing from release * Development and instllation updates * more updates * add more quotes * Add usage section
1 parent 7a8d6ed commit 08a2549

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ kind delete cluster --name my-cluster
9696

9797
### Deploying to a cluster
9898

99-
You must first push a Docker image containing the changes to a Docker repository like ECR.
99+
You must first push a Docker image containing the changes to a Docker repository like ECR, Github packages, or DockerHub. The repo is configured to use Github Actions to automatically publish the docker image upon push to `main` branch. The image URI will be `ghcr.io/[Your forked repo name here]` You can enable this for forked repos by enabling Github actions on your forked repo in the "Actions" tab of forked repo.
100+
101+
If you are deploying to cluster using kustomize templates from the `config` directory, you will need to override the image URI away from `ghcr.io/aws/aws-cloud-map-mcs-controller-for-k8s` in order to use your own docker images.
100102

101103
### Build and push docker image to ECR
102104

README.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,79 @@
1010
## Introduction
1111
AWS Cloud Map multi-cluster service discovery for Kubernetes (K8s) is a controller that implements existing multi-cluster services API that allows services to communicate across multiple clusters. The implementation relies on [AWS Cloud Map](https://aws.amazon.com/cloud-map/) for enabling cross-cluster service discovery.
1212

13+
## Usage
14+
> **There must exist network connectivity (i.e. VPC peering, security group rules, ACLs, etc.) between clusters**: Undefined behavior may occur if controller is set up without network connectivity between clusters.
15+
16+
### Setup clusters
17+
18+
First, install the controller with latest release on at least 2 AWS EKS clusters. Nodes must have sufficient IAM permissions to perform CloudMap operations.
19+
20+
```sh
21+
kubectl apply -k "github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_release"
22+
```
23+
24+
> 📌 See [Releases](#Releases) section for details on how to install other versions.
25+
26+
### Export services
27+
28+
Then assuming you already have a Service installed, apply a `ServiceExport` yaml to the cluster in which you want to export a service. This can be done for each service you want to export.
29+
30+
```yaml
31+
kind: ServiceExport
32+
apiVersion: multicluster.x-k8s.io/v1alpha1
33+
metadata:
34+
namespace: [Your service namespace here]
35+
name: [Your service name]
36+
```
37+
38+
**Example:** This will export a service with name *my-amazing-service* in namespace *hello*
39+
```yaml
40+
kind: ServiceExport
41+
apiVersion: multicluster.x-k8s.io/v1alpha1
42+
metadata:
43+
namespace: hello
44+
name: my-amazing-service
45+
```
46+
47+
*See the `samples` directory for a set of example yaml files to set up a service and export it. To apply the sample files run*
48+
```sh
49+
kubectl create namespace demo
50+
kubectl apply -f https://raw.githubusercontent.com/aws/aws-cloud-map-mcs-controller-for-k8s/main/samples/demo-deployment.yaml
51+
kubectl apply -f https://raw.githubusercontent.com/aws/aws-cloud-map-mcs-controller-for-k8s/main/samples/demo-service.yaml
52+
kubectl apply -f https://raw.githubusercontent.com/aws/aws-cloud-map-mcs-controller-for-k8s/main/samples/demo-export.yaml
53+
```
54+
55+
### Import services
56+
57+
In your other cluster, the controller will automatically sync services registered in AWS CloudMap by applying the appropriate `ServiceImport`. To list them all, run
58+
```sh
59+
kubectl get ServiceImport -A
60+
```
61+
1362
## Releases
1463

1564
AWS Cloud Map MCS Controller for K8s adheres to the [SemVer](https://semver.org/) specification. Each release updates the major version tag (eg. `vX`), a major/minor version tag (eg. `vX.Y`) and a major/minor/patch version tag (eg. `vX.Y.Z`). To see a full list of all releases, refer to our [Github releases page](https://github.com/aws/aws-cloud-map-mcs-controller-for-k8s/releases).
1665

66+
To install from a release run
67+
```sh
68+
kubectl apply -k "github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_release[?ref=*git version tag*]"
69+
```
70+
71+
Example to install latest release
72+
```sh
73+
kubectl apply -k "github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_release"
74+
```
75+
76+
Example to install v0.1.0
77+
```sh
78+
kubectl apply -k "github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_release?ref=v0.1.0"
79+
```
80+
1781
We also maintain a `latest` tag, which is updated to stay in line with the `main` branch. We **do not** recommend installing this on any production cluster, as any new major versions updated on the `main` branch will introduce breaking changes.
1882

1983
To install from `latest` tag run
2084
```sh
21-
kubectl apply -k github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_latest
85+
kubectl apply -k "github.com/aws/aws-cloud-map-mcs-controller-for-k8s/config/controller_install_latest"
2286
```
2387

2488
## Contributing
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bases:
2+
- ../default
3+
4+
images:
5+
- name: controller
6+
newName: ghcr.io/aws/aws-cloud-map-mcs-controller-for-k8s
7+
newTag: v0.1.0

0 commit comments

Comments
 (0)