Skip to content

Commit

Permalink
Removing the gateway type suffix from the naming conventions for term…
Browse files Browse the repository at this point in the history
…inating and ingress gateways
  • Loading branch information
jmurret committed Mar 25, 2022
1 parent 94dec90 commit 8c2bbd3
Show file tree
Hide file tree
Showing 27 changed files with 131 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestIngressGatewaySingleNamespace(t *testing.T) {
require.NoError(t, err)
require.Equal(t, true, created, "config entry failed")

ingressGatewayService := fmt.Sprintf("http://%s-consul-%s-ingress-gateway.%s:8080/", releaseName, igName, ctx.KubectlOptions(t).Namespace)
ingressGatewayService := fmt.Sprintf("http://%s-consul-%s.%s:8080/", releaseName, igName, ctx.KubectlOptions(t).Namespace)

// If ACLs are enabled, test that intentions prevent connections.
if c.secure {
Expand Down Expand Up @@ -247,7 +247,7 @@ func TestIngressGatewayNamespaceMirroring(t *testing.T) {
require.NoError(t, err)
require.Equal(t, true, created, "config entry failed")

ingressGatewayService := fmt.Sprintf("http://%s-consul-%s-ingress-gateway.%s:8080/", releaseName, igName, ctx.KubectlOptions(t).Namespace)
ingressGatewayService := fmt.Sprintf("http://%s-consul-%s.%s:8080/", releaseName, igName, ctx.KubectlOptions(t).Namespace)

// If ACLs are enabled, test that intentions prevent connections.
if c.secure {
Expand Down
4 changes: 2 additions & 2 deletions acceptance/tests/ingress-gateway/ingress_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func TestIngressGateway(t *testing.T) {
logger.Log(t, "testing intentions prevent ingress")
k8s.CheckStaticServerConnectionFailing(t, k8sOptions,
staticClientName, "-H", "Host: static-server.ingress.consul",
fmt.Sprintf("http://%s-consul-%s-ingress-gateway:8080/", releaseName, igName))
fmt.Sprintf("http://%s-consul-%s:8080/", releaseName, igName))

// Now we create the allow intention.
logger.Log(t, "creating ingress-gateway => static-server intention")
Expand All @@ -119,7 +119,7 @@ func TestIngressGateway(t *testing.T) {
logger.Log(t, "trying calls to ingress gateway")
k8s.CheckStaticServerConnectionSuccessful(t, k8sOptions,
staticClientName, "-H", "Host: static-server.ingress.consul",
fmt.Sprintf("http://%s-consul-%s-ingress-gateway:8080/", releaseName, igName))
fmt.Sprintf("http://%s-consul-%s:8080/", releaseName, igName))
})
}
}
12 changes: 6 additions & 6 deletions charts/consul/templates/ingress-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
spec:
replicas: {{ default $defaults.replicas .replicas }}
selector:
Expand All @@ -44,7 +44,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
template:
metadata:
labels:
Expand All @@ -53,7 +53,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
annotations:
{{- if (and $root.Values.global.secretsBackend.vault.enabled $root.Values.global.tls.enabled) }}
"vault.hashicorp.com/agent-init-first": "true"
Expand Down Expand Up @@ -92,7 +92,7 @@ spec:
{{ tpl (default $defaults.tolerations .tolerations) $root | nindent 8 | trim }}
{{- end }}
terminationGracePeriodSeconds: {{ default $defaults.terminationGracePeriodSeconds .terminationGracePeriodSeconds }}
serviceAccountName: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
serviceAccountName: {{ template "consul.fullname" $root }}-{{ .name }}
volumes:
- name: consul-bin
emptyDir: {}
Expand Down Expand Up @@ -189,7 +189,7 @@ spec:
-log-level={{ $root.Values.global.logLevel }} \
-log-json={{ $root.Values.global.logJSON }} \
-k8s-namespace={{ $root.Release.Namespace }} \
-name={{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway \
-name={{ template "consul.fullname" $root }}-{{ .name }} \
-output-file=/tmp/address.txt
WAN_ADDR="$(cat /tmp/address.txt)"
{{- else }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
spec:
privileged: false
# Required to prevent escalations to root.
Expand Down
10 changes: 5 additions & 5 deletions charts/consul/templates/ingress-gateways-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
rules:
- apiGroups: [""]
resources:
- services
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
- {{ template "consul.fullname" $root }}-{{ .name }}
verbs:
- get
{{- if $root.Values.global.enablePodSecurityPolicies }}
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
- {{ template "consul.fullname" $root }}-{{ .name }}
verbs:
- use
{{- end }}
Expand All @@ -37,7 +37,7 @@ rules:
resources:
- secrets
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway-acl-token
- {{ template "consul.fullname" $root }}-{{ .name }}-acl-token
verbs:
- get
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/consul/templates/ingress-gateways-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
subjects:
- kind: ServiceAccount
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
---
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/consul/templates/ingress-gateways-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
{{- if (or $defaults.service.annotations $service.annotations) }}
# We allow both default annotations and gateway-specific annotations
annotations:
Expand All @@ -33,7 +33,7 @@ spec:
app: {{ template "consul.name" $root }}
release: "{{ $root.Release.Name }}"
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
ports:
{{- range $index, $ports := (default $defaults.service.ports $service.ports) }}
- name: gateway-{{ $index }}
Expand Down
4 changes: 2 additions & 2 deletions charts/consul/templates/ingress-gateways-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-ingress-gateway
ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
{{- if (or $defaults.serviceAccount.annotations $serviceAccount.annotations) }}
annotations:
{{- if $defaults.serviceAccount.annotations }}
Expand Down
10 changes: 5 additions & 5 deletions charts/consul/templates/terminating-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
spec:
replicas: {{ default $defaults.replicas .replicas }}
selector:
Expand All @@ -42,7 +42,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
template:
metadata:
labels:
Expand All @@ -51,7 +51,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
annotations:
{{- if (and $root.Values.global.secretsBackend.vault.enabled $root.Values.global.tls.enabled) }}
"vault.hashicorp.com/agent-init-first": "true"
Expand Down Expand Up @@ -90,7 +90,7 @@ spec:
{{ tpl (default $defaults.tolerations .tolerations) $root | nindent 8 | trim }}
{{- end }}
terminationGracePeriodSeconds: 10
serviceAccountName: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
serviceAccountName: {{ template "consul.fullname" $root }}-{{ .name }}
volumes:
- name: consul-bin
emptyDir: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
spec:
privileged: false
# Required to prevent escalations to root.
Expand Down
8 changes: 4 additions & 4 deletions charts/consul/templates/terminating-gateways-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
{{- if (or $root.Values.global.acls.manageSystemACLs $root.Values.global.enablePodSecurityPolicies) }}
rules:
{{- if $root.Values.global.enablePodSecurityPolicies }}
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
- {{ template "consul.fullname" $root }}-{{ .name }}
verbs:
- use
{{- end }}
Expand All @@ -31,7 +31,7 @@ rules:
resources:
- secrets
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway-acl-token
- {{ template "consul.fullname" $root }}-{{ .name }}-acl-token
verbs:
- get
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/consul/templates/terminating-gateways-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
subjects:
- kind: ServiceAccount
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
---
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
name: {{ template "consul.fullname" $root }}-{{ .name }}
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
{{- if (or $defaults.serviceAccount.annotations $serviceAccount.annotations) }}
annotations:
{{- if $defaults.serviceAccount.annotations }}
Expand Down
Loading

0 comments on commit 8c2bbd3

Please sign in to comment.