Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into virtualserver-sup…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
Kaezon committed Jan 14, 2022
2 parents cc384fc + 9e45997 commit 6a746c1
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 22 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,14 @@ Test queries can be sent to the exposed CoreDNS service like this:
```
$ ip=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[0].address}')
$ dig @$ip -p 32553 myservicea.foo.org +short
172.18.0.2
192.168.224.2
$ dig @$ip -p 32553 test.default.foo.org +short
192.168.1.241
192.168.223.129
$ dig @$ip -p 32553 myservicea.gw.foo.org +short
192.168.223.130
$ dig @$ip -p 32553 myserviced.gw.foo.org +short
192.168.223.130
192.168.223.131
```

To cleanup local environment do:
Expand Down
Binary file added charts/k8s-gateway-1.1.0.tgz
Binary file not shown.
Binary file added charts/k8s-gateway-1.1.1.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions charts/k8s-gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: k8s-gateway
description: A Helm chart for the k8s_gateway CoreDNS plugin
type: application
version: 1.0.12
appVersion: 0.1.8
version: 1.1.1
appVersion: 0.2.1
maintainers:
- email: mmkashin@gmail.com
name: Michael
3 changes: 3 additions & 0 deletions charts/k8s-gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ data:
Corefile: |-
.:1053 {
errors
{{ if .Values.debug.enabled }}
debug
{{- end }}
log
health {
lameduck 5s
Expand Down
5 changes: 4 additions & 1 deletion charts/k8s-gateway/values.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
image:
registry: quay.io
repository: oriedge/k8s_gateway
tag: v0.1.8
tag: v0.2.1
pullPolicy: IfNotPresent

# Delegated domain
Expand Down Expand Up @@ -55,3 +55,6 @@ replicaCount: 1

# Optional PriorityClass that will be used in the Deployment, e.g. priorityClassName: "system-cluster-critical"
priorityClassName: ""

debug:
enabled: false
11 changes: 8 additions & 3 deletions gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,23 @@ type resourceWithIndex struct {
lookup lookupFunc
}

var noop lookupFunc = func([]string) (result []net.IP) { return }

var orderedResources = []*resourceWithIndex{
{
name: "HTTPRoute",
name: "HTTPRoute",
lookup: noop,
},
{
name: "VirtualServer",
},
{
name: "Ingress",
name: "Ingress",
lookup: noop,
},
{
name: "Service",
name: "Service",
lookup: noop,
},
}

Expand Down
54 changes: 40 additions & 14 deletions index.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
apiVersion: v1
entries:
k8s-gateway:
- apiVersion: v2
appVersion: 0.2.1
created: "2022-01-14T11:12:45.5088678Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: a6946aa35fed1b67ab968d282cc0cbbbb3136c6781563df7496b78e6e88ca8e1
maintainers:
- email: mmkashin@gmail.com
name: Michael
name: k8s-gateway
type: application
urls:
- https://ori-edge.github.io/k8s_gateway/charts/k8s-gateway-1.1.1.tgz
version: 1.1.1
- apiVersion: v2
appVersion: 0.2.0
created: "2022-01-14T11:12:45.5081359Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 74abb009602b062b805dbd96fb07cbd4c725e8dee7cd980bab0149fba1030c3a
maintainers:
- email: mmkashin@gmail.com
name: Michael
name: k8s-gateway
type: application
urls:
- https://ori-edge.github.io/k8s_gateway/charts/k8s-gateway-1.1.0.tgz
version: 1.1.0
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.605601411+01:00"
created: "2022-01-14T11:12:45.5040903Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: df847a43e164794eb49a0d4d2d81657dd4043524862f369ae995b2b70ecbb105
maintainers:
Expand All @@ -16,7 +42,7 @@ entries:
version: 1.0.12
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.605043284+01:00"
created: "2022-01-14T11:12:45.5035526Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 2d1fe6ac3011d03642a77ddaa3cbe9cc7a99f19226f33f4ae18ca0d413155c0e
maintainers:
Expand All @@ -29,7 +55,7 @@ entries:
version: 1.0.11
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.604560728+01:00"
created: "2022-01-14T11:12:45.5030846Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 796c8f7636ef4f33c43afb0ef947817ba4caa1ace29de3d903ee2fc831fd3edf
maintainers:
Expand All @@ -42,7 +68,7 @@ entries:
version: 1.0.10
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.610349009+01:00"
created: "2022-01-14T11:12:45.5077263Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 8d194587b8f31ed6230b2b2fcb2215f3f52e0be1a8ff754007b5a94731b7bcfb
maintainers:
Expand All @@ -55,7 +81,7 @@ entries:
version: 1.0.9
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.608874022+01:00"
created: "2022-01-14T11:12:45.5073246Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 8edd4edd05d76253b81ecfaafab51f171fa725bd81b6b26fef81efa26e9374d7
maintainers:
Expand All @@ -68,7 +94,7 @@ entries:
version: 1.0.8
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.608401169+01:00"
created: "2022-01-14T11:12:45.5069236Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: f162c5063236777b2cc238a03162e39ac2b2bbea46e0c31c6ae01eb88d9ce5c9
maintainers:
Expand All @@ -81,7 +107,7 @@ entries:
version: 1.0.7
- apiVersion: v2
appVersion: 0.1.8
created: "2021-11-22T21:54:20.607938048+01:00"
created: "2022-01-14T11:12:45.5064801Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: cb09166912e10c092c0f15ff5aee21e5f6a57d5ffc02047695991d0f7fc019d6
maintainers:
Expand All @@ -94,7 +120,7 @@ entries:
version: 1.0.6
- apiVersion: v2
appVersion: 0.1.7
created: "2021-11-22T21:54:20.607470717+01:00"
created: "2022-01-14T11:12:45.5060625Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 4941bcbfc5d054cf958befda1a65a2e32773aaddd59af4b2f9420353465f0be4
maintainers:
Expand All @@ -107,7 +133,7 @@ entries:
version: 1.0.5
- apiVersion: v2
appVersion: 0.1.6
created: "2021-11-22T21:54:20.60702812+01:00"
created: "2022-01-14T11:12:45.5055271Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 8753d366172031ce0386c50f6857c1ac6e1f094f9ed03ad01e33f3619c6e7880
maintainers:
Expand All @@ -120,7 +146,7 @@ entries:
version: 1.0.4
- apiVersion: v2
appVersion: 0.1.5
created: "2021-11-22T21:54:20.606493768+01:00"
created: "2022-01-14T11:12:45.5049886Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 2aa879712ad7ce33424b5f3477acf6a90480ba317e63dd1f343f4beac66b1c0e
maintainers:
Expand All @@ -133,7 +159,7 @@ entries:
version: 1.0.3
- apiVersion: v2
appVersion: 0.1.4
created: "2021-11-22T21:54:20.60605198+01:00"
created: "2022-01-14T11:12:45.5045285Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 145ce2e722a9d8c95f147a5d608e00a5c47addbaeb9ea4882491e1e185c949b4
maintainers:
Expand All @@ -146,7 +172,7 @@ entries:
version: 1.0.2
- apiVersion: v2
appVersion: 0.1.4
created: "2021-11-22T21:54:20.604099877+01:00"
created: "2022-01-14T11:12:45.5021065Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 8f780ec9b25ca9d4461c076203a7d31889499a134086df72ce26096f0eb71ce9
maintainers:
Expand All @@ -159,7 +185,7 @@ entries:
version: 1.0.1
- apiVersion: v2
appVersion: 0.1.0
created: "2021-11-22T21:54:20.60361765+01:00"
created: "2022-01-14T11:12:45.5014592Z"
description: A Helm chart for the k8s_gateway CoreDNS plugin
digest: 2744fcdd9840590cb9f86099135229ca2fd8b3a140bcf141a3ed206191dfd3f6
maintainers:
Expand All @@ -170,4 +196,4 @@ entries:
urls:
- https://ori-edge.github.io/k8s_gateway/charts/k8s-gateway-1.0.0.tgz
version: 1.0.0
generated: "2021-11-22T21:54:20.603024533+01:00"
generated: "2022-01-14T11:12:45.4901627Z"
5 changes: 5 additions & 0 deletions kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
core "k8s.io/api/core/v1"
networking "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
meta "k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -189,6 +190,10 @@ func existGatewayCRDs(ctx context.Context, c *gatewayClient.Clientset) bool {
log.Infof("GatewayAPI CRDs are not found. Not syncing GatewayAPI resources.")
return false
}
if apierrors.IsForbidden(err) {
log.Infof("access to `gateway.networking.k8s.io` is forbidden, please check RBAC. Not syncing GatewayAPI resources.")
return false
}
if err == nil {
return true
}
Expand Down

0 comments on commit 6a746c1

Please sign in to comment.