Skip to content

Commit

Permalink
Add new API version and webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sgayangi committed Aug 23, 2024
1 parent 659b1b0 commit d0abcd6
Show file tree
Hide file tree
Showing 14 changed files with 227 additions and 34 deletions.
5 changes: 5 additions & 0 deletions helm-charts/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@
.idea/
*.tmproj
.vscode/
instructions.md
README.md
apk-crds.md
Version-Upgrade.md
samples/
178 changes: 178 additions & 0 deletions helm-charts/templates/crds/dp.wso2.com_apis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,184 @@ spec:
type: object
type: object
served: true
storage: false
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .spec.apiName
name: API Name
type: string
- jsonPath: .spec.apiVersion
name: Version
type: string
- jsonPath: .spec.basePath
name: BasePath
type: string
- jsonPath: .spec.organization
name: Organization
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1beta1
schema:
openAPIV3Schema:
description: API is the Schema for the apis API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: APISpec defines the desired state of API
properties:
apiName:
description: APIName is the unique name of the API can be used to
uniquely identify an API.
maxLength: 60
minLength: 1
pattern: ^[^~!@#;:%^*()+={}|\<>"'',&$\[\]\/]*$
type: string
apiProperties:
description: APIProperties denotes the custom properties of the API.
items:
description: Property holds key value pair of APIProperties
properties:
name:
type: string
value:
type: string
type: object
nullable: true
type: array
apiType:
description: APIType denotes the type of the API. Possible values
could be REST, GraphQL, gRPC
enum:
- REST
- GraphQL
- gRPC
type: string
apiVersion:
description: APIVersion is the version number of the API.
maxLength: 30
minLength: 1
pattern: ^[^~!@#;:%^*()+={}|\<>"'',&/$\[\]\s+\/]+$
type: string
basePath:
description: 'BasePath denotes the basepath of the API. e.g: /pet-store-api/1.0.6'
pattern: ^[/][a-zA-Z0-9~/_.-]*$
type: string
definitionFileRef:
description: DefinitionFileRef contains the definition of the API
in a ConfigMap.
type: string
definitionPath:
default: /api-definition
description: DefinitionPath contains the path to expose the API definition.
minLength: 1
type: string
environment:
description: Environment denotes the environment of the API.
nullable: true
type: string
isDefaultVersion:
description: IsDefaultVersion indicates whether this API version should
be used as a default API
type: boolean
organization:
description: Organization denotes the organization. related to the
API
type: string
production:
description: 'Production contains a list of references to HttpRoutes
of type HttpRoute. xref: https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1beta1/httproute_types.go'
items:
description: EnvConfig contains the environment specific configuration
properties:
routeRefs:
description: RouteRefs denotes the environment of the API.
items:
type: string
type: array
required:
- routeRefs
type: object
maxItems: 1
nullable: true
type: array
sandbox:
description: 'Sandbox contains a list of references to HttpRoutes
of type HttpRoute. xref: https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1beta1/httproute_types.go'
items:
description: EnvConfig contains the environment specific configuration
properties:
routeRefs:
description: RouteRefs denotes the environment of the API.
items:
type: string
type: array
required:
- routeRefs
type: object
maxItems: 1
nullable: true
type: array
systemAPI:
description: SystemAPI denotes if it is an internal system API.
type: boolean
required:
- apiName
- apiType
- apiVersion
- basePath
- definitionPath
type: object
status:
description: APIStatus defines the observed state of API
properties:
deploymentStatus:
description: DeploymentStatus denotes the deployment status of the
API
properties:
accepted:
description: Accepted represents whether the API is accepted or
not.
type: boolean
events:
description: Events contains a list of events related to the API.
items:
type: string
type: array
message:
description: Message represents a user friendly message that explains
the current state of the API.
type: string
status:
description: Status denotes the state of the API in its lifecycle.
Possible values could be Accepted, Invalid, Deploy etc.
type: string
transitionTime:
description: TransitionTime represents the last known transition
timestamp.
format: date-time
type: string
required:
- accepted
- status
- transitionTime
type: object
type: object
type: object
served: true
storage: true
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if and .Values.wso2.apk.dp.enabled .Values.wso2.apk.dp.configdeployer.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: "{{ template "apk-helm.resource.prefix" . }}-wso2-apk-config-deployer-api"
namespace: {{ .Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if and .Values.wso2.apk.dp.enabled .Values.wso2.apk.dp.configdeployer.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: "{{ template "apk-helm.resource.prefix" . }}-wso2-apk-config-generator-api"
namespace: {{ .Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{{- if and .Values.wso2.apk.dp.enabled .Values.wso2.apk.dp.commonController }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: "{{ template "apk-helm.resource.prefix" . }}-wso2-apk-notification-api"
namespace: {{ .Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ webhooks:
service:
name: {{ template "apk-helm.resource.prefix" . }}-common-controller-service
namespace: {{ .Release.Namespace }}
path: /mutate-dp-wso2-com-v1alpha2-api
path: /mutate-dp-wso2-com-v1beta1-api
failurePolicy: Fail
name: mapi.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha2
- v1beta1
operations:
- CREATE
- UPDATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ webhooks:
service:
name: {{ template "apk-helm.resource.prefix" . }}-common-controller-service
namespace: {{ .Release.Namespace }}
path: /validate-dp-wso2-com-v1alpha2-api
path: /validate-dp-wso2-com-v1beta1-api
failurePolicy: Fail
name: vapi.kb.io
rules:
- apiGroups:
- dp.wso2.com
apiVersions:
- v1alpha2
- v1beta1
operations:
- CREATE
- UPDATE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if .Values.idp.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: {{ template "apk-helm.resource.prefix" . }}-jwks-endpoint-ds-api
namespace: {{ .Release.Namespace }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if .Values.idp.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: {{ template "apk-helm.resource.prefix" . }}-authentication-endpoint-ds-api
namespace: {{ .Release.Namespace }}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/templates/idp/commonoauth-domain-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if .Values.idp.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: {{ template "apk-helm.resource.prefix" . }}-commonoauth-api
namespace: {{ .Release.Namespace }}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/templates/idp/dcr-domain-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if .Values.idp.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: {{ template "apk-helm.resource.prefix" . }}-dcr-api
namespace: {{ .Release.Namespace }}
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/templates/idp/oauth-domain-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# under the License.
{{- if .Values.idp.enabled }}
kind: "API"
apiVersion: "dp.wso2.com/v1alpha2"
apiVersion: "dp.wso2.com/v1beta1"
metadata:
name: {{ template "apk-helm.resource.prefix" . }}-oauth-api
namespace: {{ .Release.Namespace }}
Expand Down
11 changes: 10 additions & 1 deletion helm-charts/templates/serviceAccount/apk-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rules:
resources: ["services","configmaps","secrets"]
verbs: ["get","list","watch","update","delete","create"]
- apiGroups: ["gateway.networking.k8s.io"]
resources: ["httproutes","gateways","gatewayclasses"]
resources: ["httproutes","gateways","gatewayclasses","grpcroutes"]
verbs: ["get","list","watch","update","delete","create"]
- apiGroups: [ "gateway.networking.k8s.io" ]
resources: [ "gateways/status","gatewayclasses/status","httproutes/status" ]
Expand Down Expand Up @@ -62,6 +62,15 @@ rules:
- apiGroups: ["dp.wso2.com"]
resources: ["apipolicies/finalizers"]
verbs: ["update"]
- apiGroups: ["dp.wso2.com"]
resources: ["grpcroutes"]
verbs: ["get","list","watch","update","delete","create"]
- apiGroups: ["dp.wso2.com"]
resources: ["grpcroutes/finalizers"]
verbs: ["update"]
- apiGroups: ["dp.wso2.com"]
resources: ["grpcroutes/status"]
verbs: ["get","patch","update"]
- apiGroups: ["dp.wso2.com"]
resources: ["apipolicies/status"]
verbs: ["get","patch","update"]
Expand Down
43 changes: 22 additions & 21 deletions helm-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ wso2:
gateway:
listener:
hostname: "gw.wso2.com"
service: {}
service:
{}
# secretName: "idp-tls"
# partitionServer:
# enabled: false
Expand Down Expand Up @@ -93,14 +94,14 @@ wso2:
failureThreshold: 5
strategy: RollingUpdate
replicas: 1
imagePullPolicy: Always
image: wso2/apk-config-deployer-service:1.1.0
# debug: true
# configs:
# tls:
# secretName: "my-secret"
# certKeyFilename: "tls.key"
# certFilename: "certchain.crt"
imagePullPolicy: IfNotPresent
image: apk-config-deployer-service:1.1.0-SNAPSHOT
debug: true
# configs:
# tls:
# secretName: "my-secret"
# certKeyFilename: "tls.key"
# certFilename: "certchain.crt"
adapter:
deployment:
resources:
Expand Down Expand Up @@ -241,20 +242,20 @@ wso2:
periodSeconds: 20
failureThreshold: 5
strategy: RollingUpdate
imagePullPolicy: Always
image: wso2/apk-enforcer:1.1.0
imagePullPolicy: IfNotPresent
image: apk-enforcer:1.1.0-SNAPSHOT
security:
sslHostname: "enforcer"
# logging:
# level: DEBUG
# configs:
# tls:
# secretName: "router-cert"
# certKeyFilename: ""
# certFilename: ""
# JWKSClient:
# skipSSLVerification: false
# hostnameVerifier: "AllowAll"
# logging:
# level: DEBUG
# configs:
# tls:
# secretName: "router-cert"
# certKeyFilename: ""
# certFilename: ""
# JWKSClient:
# skipSSLVerification: false
# hostnameVerifier: "AllowAll"

metrics:
enabled: false
Expand Down

0 comments on commit d0abcd6

Please sign in to comment.