Skip to content
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

Add quick start section to contributor docs #1766

Merged
merged 2 commits into from
Sep 2, 2020
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 CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Unreleased

- Add quick start section to contributing docs (#1766) @seanmalloy
- Enhance pull request template @seanmalloy
- Improve errors context for AWS provider
- Scaleway Provider (#1643) @Sh4d1
Expand Down
27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,34 +155,11 @@ The following tutorials are provided:

### Running Locally

#### Technical Requirements

Make sure you have the following prerequisites:
* A local Go 1.11+ development environment.
* Access to a Google/AWS account with the DNS API enabled.
* Access to a Kubernetes cluster that supports exposing Services, e.g. GKE.
See the [contributor guide](docs/contributing/getting-started.md) for details on compiling
from source.

#### Setup Steps

First, get ExternalDNS:

```console
$ git clone https://github.com/kubernetes-sigs/external-dns.git && cd external-dns
```

**This project uses [Go modules](https://github.com/golang/go/wiki/Modules) as
introduced in Go 1.11 therefore you need Go >=1.11 installed in order to build.**
If using Go 1.11 you also need to [activate Module
support](https://github.com/golang/go/wiki/Modules#installing-and-activating-module-support).

Assuming Go has been setup with module support it can be built simply by running:

```console
$ make
```

This will create external-dns in the build directory directly from the default branch.

Next, run an application and expose it via a Kubernetes Service:

```console
Expand Down
39 changes: 31 additions & 8 deletions docs/contributing/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# Project structure

### Building

You can build ExternalDNS for your platform with `make build`, you may have to install the necessary dependencies with `make dep`. The binary will land at `build/external-dns`.

### Design
# Quick Start

- [Git](https://git-scm.com/downloads)
- [Go 1.14+](https://golang.org/dl/)
- [Go modules](https://github.com/golang/go/wiki/Modules)
- [golangci-lint](https://github.com/golangci/golangci-lint)
- [Docker](https://docs.docker.com/install/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl)

Compile and run locally against a remote k8s cluster.
```
git clone https://github.com/kubernetes-sigs/external-dns.git && cd external-dns
make build
# login to remote k8s cluster
./build/external-dns --source=service --provider=inmemory --once
```

Run linting, unit tests, and coverage report.
```
make lint
make test
make cover-html
```

Build container image.
```
make build.docker
```

# Design

ExternalDNS's sources of DNS records live in package [source](../../source). They implement the `Source` interface that has a single method `Endpoints` which returns the represented source's objects converted to `Endpoints`. Endpoints are just a tuple of DNS name and target where target can be an IP or another hostname.

Expand All @@ -20,7 +43,7 @@ The orchestration between the different components is controlled by the [control

You can pick which `Source` and `Provider` to use at runtime via the `--source` and `--provider` flags, respectively.

### Adding a DNS provider
# Adding a DNS Provider

A typical way to start on, e.g. a CoreDNS provider, would be to add a `coredns.go` to the providers package and implement the interface methods. Then you would have to register your provider under a name in `main.go`, e.g. `coredns`, and would be able to trigger it's functions via setting `--provider=coredns`.

Expand Down