Skip to content

Commit

Permalink
Change gatway class name and gateway name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Feb 21, 2024
1 parent a4a1450 commit 3474b3e
Show file tree
Hide file tree
Showing 63 changed files with 108 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (

var (
setReadiness sync.Once
wso2APKDefaultControllerName = "wso2.com/apk-gateway-default"
)

// GatewayClassReconciler reconciles a Gateway object
Expand Down Expand Up @@ -102,7 +103,11 @@ func (gatewayClassReconciler *GatewayClassReconciler) Reconcile(ctx context.Cont
RequeueAfter: time.Duration(1 * time.Second),
}, nil
}
gatewayClassReconciler.handleGatewayClassStatus(req.NamespacedName, constants.Create, []string{})
// Check whether the gateway class controller name refers to wso2 apk and update the status as accepted, if it is.
controllerName := string(gatewayClassDef.Spec.ControllerName)
if (controllerName == wso2APKDefaultControllerName) {
gatewayClassReconciler.handleGatewayClassStatus(req.NamespacedName, constants.Create, []string{})
}
return ctrl.Result{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion developer/design/crds/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: Default
name: wso2-apk-default
rules:
- backendRefs:
- group: ""
Expand Down
4 changes: 2 additions & 2 deletions developer/design/crds/sample-gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: default
name: wso2-apk-default
annotations:
cert-manager.io/issuer: selfsigned-issuer
spec:
gatewayClassName: default
gatewayClassName: wso2-apk-default
listeners:
- name: examplelistener
hostname: "*.example.com"
Expand Down
6 changes: 3 additions & 3 deletions developer/tryout/samples/sample-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down Expand Up @@ -92,7 +92,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down Expand Up @@ -136,7 +136,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down
4 changes: 2 additions & 2 deletions developer/tryout/samples/sample-custom-ratelimit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# organization: default
# targetRef:
# kind: Gateway
# name: default
# name: wso2-apk-default
# group: gateway.networking.k8s.io
# ---
# apiVersion: dp.wso2.com/v1alpha1
Expand All @@ -45,5 +45,5 @@
# organization: default
# targetRef:
# kind: Gateway
# name: default
# name: wso2-apk-default
# group: gateway.networking.k8s.io
2 changes: 1 addition & 1 deletion developer/tryout/samples/sample-issuer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
2 changes: 2 additions & 0 deletions helm-charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ A Helm chart for APK components
| wso2.apk.idp.signing.fileName | string | `""` | IDP jwt signing certificate file name |
| wso2.apk.dp.enabled | bool | `true` | Enable the deployment of the Data Plane |
| wso2.apk.dp.environment.name | string | `Default` | Environment of the Data Plane |
| wso2.apk.dp.gatewayClass.name | string | `wso2-apk-default` | GatewayClass custom resource name |
| wso2.apk.dp.gateway.name | string | `wso2-apk-default` | Gateway custom resource name |
| wso2.apk.dp.gateway.httpListener.enabled | bool | `false` | HTTP listener enabled or not |
| wso2.apk.dp.gateway.httpListener.hostname | string | `"api.am.wso2.com"` | HTTP listener hostname |
| wso2.apk.dp.gateway.httpListener.port | int | `9080` | HTTP listener port |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "httpslistener"
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "httpslistener"
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data:
keyFilePath = "/home/wso2apk/config-deployer/security/config.key"
certFilePath = "/home/wso2apk/config-deployer/security/config.pem"
[wso2.config_deployer_service.gatewayConfiguration]
name = "default"
name = "{{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}"
listenerName = "httpslistener"
{{ include "generateVhosts" .Values.wso2.apk.dp.configdeployer.vhosts | indent 4 }}
{{if and .Values.wso2.apk.dp.partitionServer .Values.wso2.apk.dp.partitionServer.enabled}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: GatewayClass
metadata:
name: default
{{- if .Values.wso2.apk.dp.gatewayClass }}
name: {{ .Values.wso2.apk.dp.gatewayClass.name | default "wso2-apk-default" }}
{{- else }}
name: "wso2-apk-default"
{{- end }}
spec:
controllerName: "wso2.com/apk-gateway-default"
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
namespace: {{ .Release.Namespace }}
annotations:
cert-manager.io/issuer: selfsigned-issuer
spec:
gatewayClassName: "default"
{{- if .Values.wso2.apk.dp.gatewayClass }}
gatewayClassName: {{ .Values.wso2.apk.dp.gatewayClass.name | default "wso2-apk-default" }}
{{- else }}
gatewayClassName: "wso2-apk-default"
{{- end }}
listeners:
{{ if and .Values.wso2.apk.dp.gateway.httpListener .Values.wso2.apk.dp.gateway.httpListener.enabled }}
- name: httplistener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ spec:
{{ end }}
targetRef:
kind: Gateway
name: default
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
group: gateway.networking.k8s.io
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
- name: COMMON_CONTROLLER_REST_PORT
value : "18003"
- name: ENFORCER_LABEL
value : default
value : {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
- name: ENFORCER_REGION
value: UNKNOWN
- name: XDS_MAX_MSG_SIZE
Expand Down Expand Up @@ -269,7 +269,7 @@ spec:
- name: ROUTER_CLUSTER
value: "apk_router_cluster"
- name: ROUTER_LABEL
value: "default"
value: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
- name: ROUTER_PRIVATE_KEY_PATH
value: "/home/wso2/security/keystore/router.key"
- name: ROUTER_PUBLIC_CERT_PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ spec:
{{ end }}
targetRef:
kind: Gateway
name: default
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
group: gateway.networking.k8s.io
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "httpslistener"
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "idplistener"
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "idplistener"
{{- end -}}
2 changes: 1 addition & 1 deletion helm-charts/templates/idp/dcr-domain-api-httproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "idplistener"
{{- end -}}
2 changes: 1 addition & 1 deletion helm-charts/templates/idp/oauth-domain-api-httproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ spec:
parentRefs:
- group: "gateway.networking.k8s.io"
kind: "Gateway"
name: "default"
name: {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
sectionName: "idplistener"
{{- end -}}
5 changes: 5 additions & 0 deletions helm-charts/values.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ wso2:
environment:
# -- Environment Name of the Data Plane
name: "Development"
# -- GatewayClass custom resource name
gatewayClass:
name: "wso2-apk-default"
gateway:
# -- Gateway custom resource name
name: "wso2-apk-default"
listener:
# -- Gateway Listener Hostname
hostname: "gw.wso2.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ isolated service /api/configurator on ep0 {
isolated resource function post apis/'generate\-k8s\-resources(http:Request request) returns http:Response|BadRequestError|InternalServerErrorError|commons:APKError {
ConfigGeneratorClient apiclient = new ;
commons:Organization organization = {displayName: "default",
name: "default",
name: "wso2-apk-default",
organizationClaimValue: "default",
uuid: "",
enabled: true};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ spec:
organization: a3b58ccf-6ecc-4557-b5bb-0a35cce38256
targetRef:
kind: Gateway
name: default
name: wso2-apk-default
group: gateway.networking.k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
sectionName: httpslistener
rules:
- backendRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
namespace: apk
sectionName: httpslistener
rules:
Expand Down
20 changes: 10 additions & 10 deletions test/cucumber-tests/CRs/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -236,7 +236,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
apiVersion: dp.wso2.com/v1alpha1
kind: Backend
Expand Down Expand Up @@ -319,7 +319,7 @@ spec:
organization: default
targetRef:
kind: Gateway
name: default
name: wso2-apk-default
group: gateway.networking.k8s.io
---
apiVersion: dp.wso2.com/v1alpha1
Expand All @@ -337,7 +337,7 @@ spec:
organization: default
targetRef:
kind: Gateway
name: default
name: wso2-apk-default
group: gateway.networking.k8s.io

---
Expand Down Expand Up @@ -510,7 +510,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
kind: TokenIssuer
apiVersion: dp.wso2.com/v1alpha1
Expand All @@ -532,7 +532,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
kind: TokenIssuer
apiVersion: dp.wso2.com/v1alpha1
Expand All @@ -554,7 +554,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
kind: TokenIssuer
apiVersion: dp.wso2.com/v1alpha1
Expand All @@ -576,7 +576,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
kind: TokenIssuer
apiVersion: dp.wso2.com/v1alpha2
Expand All @@ -600,7 +600,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
kind: TokenIssuer
apiVersion: dp.wso2.com/v1alpha2
Expand All @@ -624,7 +624,7 @@ spec:
targetRef:
group: gateway.networking.k8s.io
kind: Gateway
name: default
name: wso2-apk-default
---
# We have removed the Envoy admin interface port from our helm gateway service yaml. So we need this one here.
apiVersion: v1
Expand Down
Loading

0 comments on commit 3474b3e

Please sign in to comment.