Skip to content

Commit

Permalink
[CN-822] HazelcastEndpoint CRD (#860)
Browse files Browse the repository at this point in the history
new hazelcastendpoint CR is introduced

Signed-off-by: devOpsHelm <devopshelm@hazelcast.com>
  • Loading branch information
devOpsHelm committed Oct 4, 2023
1 parent 84f6fe0 commit e9b3e8d
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,94 @@ spec:
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
creationTimestamp: null
name: hazelcastendpoints.hazelcast.com
spec:
group: hazelcast.com
names:
kind: HazelcastEndpoint
listKind: HazelcastEndpointList
plural: hazelcastendpoints
shortNames:
- hzep
singular: hazelcastendpoint
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: Type of the HazelcastEndpoint
jsonPath: .spec.type
name: Type
type: string
- description: Address of the HazelcastEndpoint
jsonPath: .status.address
name: Address
type: string
- description: Message for the current HazelcastEndpoint
jsonPath: .status.message
name: Message
priority: 1
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: HazelcastEndpoint is the Schema for the hazelcastendpoints 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: HazelcastEndpointSpec defines the desired state of HazelcastEndpoint
properties:
hazelcastResourceName:
description: HazelcastResourceName defines the name of the Hazelcast
resource that this resource is created for.
minLength: 1
type: string
port:
description: Port of the endpoint.
format: int32
type: integer
type:
description: Type defines the endpoint connection. It is used to identify
the target of the endpoint.
enum:
- Discovery
- Member
- WAN
type: string
required:
- hazelcastResourceName
- port
- type
type: object
status:
description: HazelcastEndpointStatus defines the observed state of HazelcastEndpoint
properties:
address:
description: Address is the external address of the endpoint. It is
taken from the corresponding service.
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.10.0
Expand All @@ -301,14 +389,6 @@ spec:
jsonPath: .status.hazelcastClusterStatus.readyMembers
name: Members
type: string
- description: External addresses of the Hazelcast cluster
jsonPath: .status.externalAddresses
name: External-Addresses
type: string
- description: WAN addresses of the Hazelcast cluster
jsonPath: .status.wanAddresses
name: WAN-Addresses
type: string
- description: Message for the current Hazelcast Config
jsonPath: .status.message
name: Message
Expand Down
67 changes: 51 additions & 16 deletions stable/hazelcast-platform-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ Rules needed for operator watched namespaces
- ""
resources:
- configmaps
- secrets
- events
- pods
- secrets
- serviceaccounts
- services
verbs:
Expand Down Expand Up @@ -214,6 +214,15 @@ Rules needed for operator watched namespaces
- create
- get
- list
- update
- watch
- apiGroups:
- ""
resources:
- services
verbs:
- get
- list
- watch
- apiGroups:
- apps
Expand Down Expand Up @@ -279,6 +288,32 @@ Rules needed for operator watched namespaces
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
- hazelcastendpoints
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- hazelcast.com
resources:
- hazelcastendpoints/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- hazelcastendpoints/status
verbs:
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
Expand Down Expand Up @@ -334,7 +369,7 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- managementcenters
- jetjobs
verbs:
- create
- delete
Expand All @@ -346,21 +381,21 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- managementcenters/finalizers
- jetjobs/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- managementcenters/status
- jetjobs/status
verbs:
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
- maps
- jetjobsnapshots
verbs:
- create
- delete
Expand All @@ -372,21 +407,21 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- maps/finalizers
- jetjobsnapshots/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- maps/status
- jetjobsnapshots/status
verbs:
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
- multimaps
- managementcenters
verbs:
- create
- delete
Expand All @@ -398,21 +433,21 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- multimaps/finalizers
- managementcenters/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- multimaps/status
- managementcenters/status
verbs:
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
- jetjobs
- maps
verbs:
- create
- delete
Expand All @@ -424,21 +459,21 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- jetjobs/finalizers
- maps/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- jetjobs/status
- maps/status
verbs:
- get
- patch
- update
- apiGroups:
- hazelcast.com
resources:
- jetjobsnapshots
- multimaps
verbs:
- create
- delete
Expand All @@ -450,13 +485,13 @@ Rules needed for operator watched namespaces
- apiGroups:
- hazelcast.com
resources:
- jetjobsnapshots/finalizers
- multimaps/finalizers
verbs:
- update
- apiGroups:
- hazelcast.com
resources:
- jetjobsnapshots/status
- multimaps/status
verbs:
- get
- patch
Expand Down
23 changes: 23 additions & 0 deletions stable/hazelcast-platform-operator/templates/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,29 @@ webhooks:
sideEffects: None
namespaceSelector:
{{- include "watched-namespaces.labelSelector" . | nindent 6 }}
- admissionReviewVersions:
- v1
clientConfig:
caBundle: {{ $ca.Cert | b64enc }}
service:
name: {{ $fullname }}
namespace: {{ .Release.Namespace }}
path: /validate-hazelcast-com-v1alpha1-hazelcastendpoint
failurePolicy: Ignore
name: vhazelcastendpoint.kb.io
rules:
- apiGroups:
- hazelcast.com
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- hazelcastendpoints
sideEffects: None
namespaceSelector:
{{- include "watched-namespaces.labelSelector" . | nindent 6 }}
---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit e9b3e8d

Please sign in to comment.