Skip to content

Commit

Permalink
remove gloo prefix for deployed objs (#10629)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgadban authored Feb 14, 2025
1 parent e95c051 commit eac9a06
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
8 changes: 4 additions & 4 deletions devel/architecture/istio-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,11 @@ spec:
EOF
```

This should create a new gateway in the `default` namespace named `gloo-proxy-http`:
This should create a new gateway in the `default` namespace named `http`:
```shell
❯ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
gloo-proxy-http 1/1 1 1 10m
NAME READY UP-TO-DATE AVAILABLE AGE
http 1/1 1 1 10m
```

Apply an HTTPRoute equivalent to the VirtualService we tested earlier:
Expand Down Expand Up @@ -269,7 +269,7 @@ EOF
Port-forward the new k8s gateway:

```shell
kubectl port-forward deployment/gloo-proxy-http 8080:8080
kubectl port-forward deployment/http 8080:8080
```

Now let's send traffic with the same curl as before, this time going through the new k8s Gateway API gateway.
Expand Down
4 changes: 2 additions & 2 deletions internal/kgateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ EOF
Expose the gateway that gets created via the Gateway resource:

```shell
kubectl port-forward deployment/gloo-proxy-http 8080:8080
kubectl port-forward deployment/http 8080:8080
```

Send some traffic through the gateway:
Expand Down Expand Up @@ -125,7 +125,7 @@ settings:
Then expose the gateway that gets created via the Gateway resource:

```shell
kubectl port-forward deployment/gloo-proxy-http 8080:8080
kubectl port-forward deployment/http 8080:8080
```

Send some traffic through the gateway:
Expand Down
34 changes: 15 additions & 19 deletions internal/kgateway/deployer/deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ func (objs *clientObjects) getEnvoyConfig(namespace, name string) *envoy_config_
return &bootstrapCfg
}

func proxyName(name string) string {
return fmt.Sprintf("gloo-proxy-%s", name)
}

// containMapElements produces a matcher that will only match if all provided map elements
// are completely accounted for. The actual value is expected to not be nil or empty since
// there are other, more appropriate matchers for those cases.
Expand Down Expand Up @@ -251,7 +247,7 @@ var _ = Describe("Deployer", func() {
}
}

defaultDeploymentName = proxyName(defaultGateway().Name)
defaultDeploymentName = defaultGateway().Name
defaultConfigMapName = defaultDeploymentName
defaultServiceName = defaultDeploymentName
defaultServiceAccountName = defaultDeploymentName
Expand Down Expand Up @@ -332,10 +328,10 @@ var _ = Describe("Deployer", func() {
objs, err = d.GetObjsToDeploy(context.Background(), gw)
Expect(err).NotTo(HaveOccurred())
Expect(objs).To(HaveLen(4))
Expect(objs.findDeployment(defaultNamespace, proxyName(gw.Name))).ToNot(BeNil())
Expect(objs.findService(defaultNamespace, proxyName(gw.Name))).ToNot(BeNil())
Expect(objs.findConfigMap(defaultNamespace, proxyName(gw.Name))).ToNot(BeNil())
Expect(objs.findServiceAccount(defaultNamespace, proxyName(gw.Name))).ToNot(BeNil())
Expect(objs.findDeployment(defaultNamespace, gw.Name)).ToNot(BeNil())
Expect(objs.findService(defaultNamespace, gw.Name)).ToNot(BeNil())
Expect(objs.findConfigMap(defaultNamespace, gw.Name)).ToNot(BeNil())
Expect(objs.findServiceAccount(defaultNamespace, gw.Name)).ToNot(BeNil())
})
})

Expand Down Expand Up @@ -508,24 +504,24 @@ var _ = Describe("Deployer", func() {
objs1, err = d1.GetObjsToDeploy(context.Background(), gw1)
Expect(err).NotTo(HaveOccurred())
Expect(objs1).NotTo(BeEmpty())
Expect(objs1.findDeployment(defaultNamespace, proxyName(gw1.Name))).ToNot(BeNil())
Expect(objs1.findService(defaultNamespace, proxyName(gw1.Name))).ToNot(BeNil())
Expect(objs1.findConfigMap(defaultNamespace, proxyName(gw1.Name))).ToNot(BeNil())
Expect(objs1.findServiceAccount(defaultNamespace, proxyName(gw1.Name))).ToNot(BeNil())
Expect(objs1.findDeployment(defaultNamespace, gw1.Name)).ToNot(BeNil())
Expect(objs1.findService(defaultNamespace, gw1.Name)).ToNot(BeNil())
Expect(objs1.findConfigMap(defaultNamespace, gw1.Name)).ToNot(BeNil())
Expect(objs1.findServiceAccount(defaultNamespace, gw1.Name)).ToNot(BeNil())

objs2, err = d2.GetObjsToDeploy(context.Background(), gw2)
Expect(err).NotTo(HaveOccurred())
Expect(objs2).NotTo(BeEmpty())
Expect(objs2.findDeployment(defaultNamespace, proxyName(gw2.Name))).ToNot(BeNil())
Expect(objs2.findService(defaultNamespace, proxyName(gw2.Name))).ToNot(BeNil())
Expect(objs2.findConfigMap(defaultNamespace, proxyName(gw2.Name))).ToNot(BeNil())
Expect(objs2.findServiceAccount(defaultNamespace, proxyName(gw2.Name))).ToNot(BeNil())
Expect(objs2.findDeployment(defaultNamespace, gw2.Name)).ToNot(BeNil())
Expect(objs2.findService(defaultNamespace, gw2.Name)).ToNot(BeNil())
Expect(objs2.findConfigMap(defaultNamespace, gw2.Name)).ToNot(BeNil())
Expect(objs2.findServiceAccount(defaultNamespace, gw2.Name)).ToNot(BeNil())

for _, obj := range objs1 {
Expect(obj.GetName()).To(Equal("gloo-proxy-foo"))
Expect(obj.GetName()).To(Equal(gw1.Name))
}
for _, obj := range objs2 {
Expect(obj.GetName()).To(Equal("gloo-proxy-bar"))
Expect(obj.GetName()).To(Equal(gw2.Name))
}
})
})
Expand Down
4 changes: 2 additions & 2 deletions internal/kgateway/helm/gloo-gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Expand the name of the chart.
*/}}
{{- define "gloo-gateway.gateway.name" -}}
{{- if .Values.gateway.name }}
{{- .Values.gateway.name | printf "gloo-proxy-%s" | trunc 63 | trimSuffix "-" }}
{{- .Values.gateway.name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- default .Chart.Name .Values.gateway.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
Expand All @@ -31,7 +31,7 @@ If release name contains chart name it will be used as a full name.
{{- .Values.gateway.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Release.Name .Values.gateway.nameOverride }}
{{- .Release.Name | printf "gloo-proxy-%s" | trunc 63 | trimSuffix "-" }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

Expand Down

0 comments on commit eac9a06

Please sign in to comment.