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

Change example domain to example.com #27

Merged
merged 1 commit into from
Jan 16, 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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dns-tools:

.PHONY: dns-smoke-test
dns-smoke-test:
kubectl -n ohmyglb run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools --command -- /usr/bin/dig @ohmyglb-coredns app3.cloud.absa.internal
kubectl -n ohmyglb run -it --rm --restart=Never --image=infoblox/dnstools:latest dnstools --command -- /usr/bin/dig @ohmyglb-coredns app3.cloud.example.com

.PHONY: deploy-local-cluster
deploy-local-cluster:
Expand Down
2 changes: 1 addition & 1 deletion chart/ohmyglb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ global:
ohmyglb:
image: ytsarev/ohmyglb:v0.2.1
ingressNamespace: "ohmyglb"
dnsZone: &dnsZone "absa.internal"
dnsZone: &dnsZone "example.com"

externaldns:
image: registry.opensource.zalan.do/teapot/external-dns:latest
Expand Down
6 changes: 3 additions & 3 deletions deploy/crds/ohmyglb.absa.oss_v1beta1_gslb_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ metadata:
spec:
ingress:
rules:
- host: app1.cloud.absa.internal # This is the GSLB enabled host that clients would use
- host: app1.cloud.example.com # This is the GSLB enabled host that clients would use
http: # This section mirrors the same structure as that of an Ingress resource and will be used verbatim when creating the corresponding Ingress resource that will match the GSLB host
paths:
- backend:
serviceName: non-existing-app
servicePort: http
path: /
- host: app2.cloud.absa.internal
- host: app2.cloud.example.com
http:
paths:
- backend:
serviceName: unhealthy-app
servicePort: http
path: /
- host: app3.cloud.absa.internal
- host: app3.cloud.example.com
http:
paths:
- backend:
Expand Down
8 changes: 0 additions & 8 deletions deploy/ingress/README.md

This file was deleted.

145 changes: 0 additions & 145 deletions deploy/ingress/coredns-values.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions deploy/ingress/etcd-operator-values.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions deploy/ingress/external-dns.yaml

This file was deleted.

2 changes: 2 additions & 0 deletions deploy/ingress/udp-services.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Standalone ConfigMap to expose coredns in Rancher
# without any other ingress contoller reconfiguration
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ kind: Gslb
metadata:
name: app
spec:
host: app.cloud.absa.internal # This is the GSLB enabled host that clients would use
host: app.cloud.example.com # This is the GSLB enabled host that clients would use
http: # This section mirrors the same structure as that of an Ingress resource and will be used verbatim when creating the corresponding Ingress resource that will match the GSLB host
paths:
- backend:
Expand All @@ -68,22 +68,22 @@ spec:

On creating this `Gslb` resource, the Oh My GLB controller watching the cluster where this resource is created, will:

1. Create a new `Ingress` resource that will allow requests with the GSLB host (`app.cloud.absa.internal`) to be handled by the cluster's Ingress controller
1. Create a new `Ingress` resource that will allow requests with the GSLB host (`app.cloud.example.com`) to be handled by the cluster's Ingress controller
2. Configure a health check strategy on the underlying `app` Pods. The Pods here are the Pods matched by the Service configured by `serviceName`
3. Based on the health (see [Service health](#service-health)) of those Pods, if at least one of the Pods is healthy, add DNS records with the external addresses of the cluster's nodes running the Ingress controllers

#### 1.2 Client

In the use case above, the following would describe a client request:

1. Client makes a request to <https://app.cloud.absa.internal>
2. In resolving the IP for `app.cloud.absa.internal`, the Recursive Resolver forwards the requests to one of the instances of Oh My GLB
1. Client makes a request to <https://app.cloud.example.com>
2. In resolving the IP for `app.cloud.example.com`, the Recursive Resolver forwards the requests to one of the instances of Oh My GLB
3. One of the cluster Ingress node IPs is returned to the client. E.g. `10.0.100.20`
4. The client, using the resolved IP of `10.0.100.20` now makes a connection and proceeds with the request. The request will be handled by one of the cluster's Ingress controllers and via the created GSLB Ingress resource, the request is proxied through to one of the available Pods as per the usual Kubernetes Ingress mechanics

#### 1.3 Outcome

In this use case, only _Kubernetes cluster X_ would be eligible to handle ingress traffic for `https://app.cloud.absa.internal` as there was no `Gslb` resource created in _Kubernetes cluster Y_.
In this use case, only _Kubernetes cluster X_ would be eligible to handle ingress traffic for `https://app.cloud.example.com` as there was no `Gslb` resource created in _Kubernetes cluster Y_.

### 2. Basic - Multi cluster

Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/gslb/gslb_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestGslbController(t *testing.T) {
t.Fatalf("Failed to get expected gslb: (%v)", err)
}

expectedHosts := []string{"app1.cloud.absa.internal", "app2.cloud.absa.internal", "app3.cloud.absa.internal"}
expectedHosts := []string{"app1.cloud.example.com", "app2.cloud.example.com", "app3.cloud.example.com"}
actualHosts := gslb.Status.ManagedHosts
if !reflect.DeepEqual(expectedHosts, actualHosts) {
t.Errorf("expected %v managed hosts, but got %v", expectedHosts, actualHosts)
Expand All @@ -99,7 +99,7 @@ func TestGslbController(t *testing.T) {

t.Run("NotFound service status", func(t *testing.T) {
expectedServiceStatus := "NotFound"
notFoundHost := "app1.cloud.absa.internal"
notFoundHost := "app1.cloud.example.com"
actualServiceStatus := gslb.Status.ServiceHealth[notFoundHost]
if expectedServiceStatus != actualServiceStatus {
t.Errorf("expected %s service status to be %s, but got %s", notFoundHost, expectedServiceStatus, actualServiceStatus)
Expand All @@ -108,7 +108,7 @@ func TestGslbController(t *testing.T) {

t.Run("Unhealthy service status", func(t *testing.T) {
serviceName := "unhealthy-app"
unhealthyHost := "app2.cloud.absa.internal"
unhealthyHost := "app2.cloud.example.com"
service := &corev1.Service{
ObjectMeta: metav1.ObjectMeta{
Name: serviceName,
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestGslbController(t *testing.T) {
reconcileAndUpdateGslb(t, r, req, cl, gslb)

expectedServiceStatus := "Healthy"
healthyHost := "app3.cloud.absa.internal"
healthyHost := "app3.cloud.example.com"
actualServiceStatus := gslb.Status.ServiceHealth[healthyHost]
if expectedServiceStatus != actualServiceStatus {
t.Errorf("expected %s service status to be %s, but got %s", healthyHost, expectedServiceStatus, actualServiceStatus)
Expand Down Expand Up @@ -206,7 +206,7 @@ func TestGslbController(t *testing.T) {
got := dnsEndpoint.Spec.Endpoints

want := []*externaldns.Endpoint{{
DNSName: "app3.cloud.absa.internal",
DNSName: "app3.cloud.example.com",
RecordTTL: 30,
RecordType: "A",
Targets: externaldns.Targets{"10.0.0.1"}},
Expand Down