Skip to content

Commit

Permalink
Merge branch 'main' into bugfix-1340-update-svc-after-gateway-restart
Browse files Browse the repository at this point in the history
  • Loading branch information
arkodg authored May 5, 2023
2 parents 171b1ca + 297fcf1 commit 8f2695c
Show file tree
Hide file tree
Showing 43 changed files with 6,606 additions and 5,546 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,35 @@ jobs:
CONFORMANCE_UNIQUE_PORTS: false
IMAGE_PULL_POLICY: IfNotPresent
run: make conformance

e2e-test:
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
version: [ v1.25.8, v1.26.3, v1.27.0 ]
steps:
- uses: actions/checkout@v3
- uses: ./tools/github-actions/setup-deps

- name: Download EG Binaries
uses: actions/download-artifact@v3
with:
name: envoy-gateway
path: bin/

- name: Give Privileges To EG Binaries
run: |
chmod +x bin/linux/amd64/envoy-gateway
chmod +x bin/linux/arm64/envoy-gateway
# E2E
- name: Run E2E Tests
env:
KIND_NODE_TAG: ${{ matrix.version }}
CONFORMANCE_UNIQUE_PORTS: false
IMAGE_PULL_POLICY: IfNotPresent
run: make e2e

publish:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ individuals and will be valid for 1 year from the start date.
- Envoy core proxy maintainers [Member: Matt Klein]
- Tetrate [Member: Varun Talwar; End Date: 5/16/2023]
- VMware [Member: Winnie Kwon; End Date: 5/16/2023]
- Ambassador Labs [Member: Richard Li; End Date: 5/16/2023]
- Ambassador Labs [Member: Alex Gervais; End Date: 5/16/2023]
- Fidelity Investments [Member: Venkat Kasisomayajula / Rajarajan Pudupatti Sundari Jeyakodi; End Date: 5/16/2023]
- Tencent Holdings Limited [Member: Xunzhuo Liu; End Date: 5/16/2023]

Expand Down
12 changes: 8 additions & 4 deletions api/config/v1alpha1/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,21 @@ type KubernetesContainerSpec struct {

// ServiceType string describes ingress methods for a service
// +enum
// +kubebuilder:validation:Enum=LoadBalancer;ClusterIP
// +kubebuilder:validation:Enum=ClusterIP;LoadBalancer;NodePort
type ServiceType string

const (
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the cluster IP.
ServiceTypeClusterIP ServiceType = "ClusterIP"

// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it).
ServiceTypeLoadBalancer ServiceType = "LoadBalancer"

// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the cluster IP.
ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on each Kubernetes Node
// at a static Port, common across all Nodes.
ServiceTypeNodePort ServiceType = "NodePort"
)

// KubernetesServiceSpec defines the desired state of the Kubernetes service resource.
Expand Down
4 changes: 3 additions & 1 deletion api/config/v1alpha1/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ func validateServiceType(spec *EnvoyProxySpec) []error {
var errs []error
if spec.Provider.Kubernetes != nil && spec.Provider.Kubernetes.EnvoyService != nil {
if serviceType := spec.Provider.Kubernetes.EnvoyService.Type; serviceType != nil {
if *serviceType != ServiceTypeLoadBalancer && *serviceType != ServiceTypeClusterIP {
if *serviceType != ServiceTypeLoadBalancer &&
*serviceType != ServiceTypeClusterIP &&
*serviceType != ServiceTypeNodePort {
errs = append(errs, fmt.Errorf("unsupported envoy service type %v", serviceType))
}
}
Expand Down
2 changes: 1 addition & 1 deletion api/config/v1alpha1/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestValidateEnvoyProxy(t *testing.T) {
},
},
},
expected: false,
expected: true,
},
{
name: "valid envoy service type 'LoadBalancer'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,9 @@ spec:
only be accessible inside the cluster, via the cluster
IP.
enum:
- LoadBalancer
- ClusterIP
- LoadBalancer
- NodePort
type: string
type: object
type: object
Expand Down
1 change: 1 addition & 0 deletions charts/gateway-helm/templates/generated/rbac/roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rules:
- ""
resources:
- namespaces
- nodes
- secrets
- services
verbs:
Expand Down
69 changes: 69 additions & 0 deletions examples/redis/redis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
kind: Namespace
apiVersion: v1
metadata:
name: redis-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: redis-system
labels:
app: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- image: redis:6.0.6
imagePullPolicy: IfNotPresent
name: redis
resources:
limits:
cpu: 1500m
memory: 512Mi
requests:
cpu: 200m
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: redis-system
labels:
app: redis
annotations:
spec:
ports:
- name: redis
port: 6379
protocol: TCP
targetPort: 6379
selector:
app: redis
---
apiVersion: v1
kind: ConfigMap
metadata:
name: envoy-gateway-config
namespace: envoy-gateway-system
data:
envoy-gateway.yaml: |
apiVersion: config.gateway.envoyproxy.io/v1alpha1
kind: EnvoyGateway
provider:
type: Kubernetes
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
rateLimit:
backend:
type: Redis
redis:
url: redis.redis-system.svc.cluster.local:6379
Loading

0 comments on commit 8f2695c

Please sign in to comment.