Skip to content

Commit 5616577

Browse files
authored
Merge pull request #41 from kube-slice/wg
feat(): Add slice gateway type wireguard
2 parents ab44f58 + 972be67 commit 5616577

16 files changed

+1637
-880
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ help: ## Display this help.
3030

3131
##@ Development
3232

33+
.PHONY: manifests
34+
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
35+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=crd
36+
3337
.PHONY: generate
3438
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
3539
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
@@ -49,14 +53,14 @@ vet: ## Run go vet against code.
4953
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
5054
.PHONY: controller-gen
5155
controller-gen: ## Download controller-gen locally if necessary.
52-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.7.0)
56+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.3)
5357

5458
PROTO_GEN = $(shell pwd)/bin/go-to-protobuf
5559
.PHONY: proto-gen
5660
proto-gen: ## Convert the types definition to Protocol Buffers.
57-
$(call go-get-tool,$(PROTO_GEN),k8s.io/code-generator/cmd/go-to-protobuf@v0.23.3)
61+
$(call go-get-tool,$(PROTO_GEN),k8s.io/code-generator/cmd/go-to-protobuf@v0.32.2)
5862

59-
# go-get-tool will 'go get' any package $2 and install it to $1.
63+
# go-get-tool will 'go install' any package $2 and install it to $1.
6064
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
6165
define go-get-tool
6266
@[ -f $(1) ] || { \
@@ -65,7 +69,7 @@ TMP_DIR=$$(mktemp -d) ;\
6569
cd $$TMP_DIR ;\
6670
go mod init tmp ;\
6771
echo "Downloading $(2)" ;\
68-
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
72+
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
6973
rm -rf $$TMP_DIR ;\
7074
}
7175
endef
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.3
7+
name: clusters.controller.kubeslice.io
8+
spec:
9+
group: controller.kubeslice.io
10+
names:
11+
kind: Cluster
12+
listKind: ClusterList
13+
plural: clusters
14+
singular: cluster
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: Cluster is the Schema for the clusters API
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: ClusterSpec defines the desired state of Cluster
41+
properties:
42+
clusterProperty:
43+
description: put in an object
44+
properties:
45+
geoLocation:
46+
description: GeoLocation contains information regarding Geographical
47+
Location of the Cluster
48+
properties:
49+
cloudProvider:
50+
description: CloudProvider is the cloud service provider
51+
type: string
52+
cloudRegion:
53+
description: CloudRegion is the region of the cloud
54+
type: string
55+
latitude:
56+
description: Latitude is the latitude of the cluster
57+
type: string
58+
longitude:
59+
description: Longitude is the longitude of the cluster
60+
type: string
61+
type: object
62+
monitoring:
63+
description: Monitoring contains the Kubernetes Monitoring Dashboard
64+
properties:
65+
grafanaDashboardBaseURL:
66+
description: GrafanaDashboardBaseURL is the base URL for the
67+
grafana dashboard
68+
type: string
69+
kubernetesDashboard:
70+
description: KubernetesDashboard contains the information
71+
regarding Kubernetes Monitoring Dashboard
72+
properties:
73+
accessToken:
74+
description: AccessToken is the Access Token to access
75+
the KubernetesDashboard
76+
type: string
77+
enabled:
78+
description: Enabled is the enable status of the KubernetesDashboard
79+
type: boolean
80+
endpoint:
81+
description: Endpoint is the base endpoint to access the
82+
kubernetes dashboard
83+
type: string
84+
ingressPrefix:
85+
description: IngressPrefix is the prefix of ingress gateway
86+
for KubernetesDashboard
87+
type: string
88+
type: object
89+
type: object
90+
telemetry:
91+
description: Telemetry contains Telemetry information
92+
properties:
93+
enabled:
94+
description: Enabled is the enable status of the Telemetry
95+
type: boolean
96+
endpoint:
97+
description: Endpoint is the Telemetry Endpoint
98+
type: string
99+
telemetryProvider:
100+
description: TelemetryProvider is the Telemetry Provider information
101+
type: string
102+
type: object
103+
type: object
104+
enableAutoEviction:
105+
description: EnableAutoEviction is a flag to enable auto eviction
106+
feature for the given cluster
107+
type: boolean
108+
networkInterface:
109+
description: NetworkInterface is the network interface attached with
110+
the cluster.
111+
type: string
112+
nodeIP:
113+
description: NodeIP is the IP address of the Node - deprecated field
114+
use Plural NodeIPs
115+
type: string
116+
nodeIPs:
117+
items:
118+
type: string
119+
type: array
120+
requeueOnFailure:
121+
type: boolean
122+
type: object
123+
status:
124+
description: ClusterStatus defines the observed state of Cluster
125+
properties:
126+
GPURestriction:
127+
properties:
128+
enforceRestrictions:
129+
description: EnforceRestrictions is the flag to check if the cluster
130+
is restricted
131+
type: boolean
132+
lastUpdatedTimestamp:
133+
description: LastUpdatedTimestamp is the timestamp when the enforcement
134+
was updated
135+
format: date-time
136+
type: string
137+
type: object
138+
clusterHealth:
139+
description: ClusterHealth shows the health of the worker cluster
140+
properties:
141+
clusterHealthStatus:
142+
description: ClusterHealthStatus shows the overall health status
143+
of the cluster
144+
enum:
145+
- Normal
146+
- Warning
147+
type: string
148+
componentStatuses:
149+
description: ComponentStatuses shows the health status of individual
150+
components in the cluster
151+
items:
152+
properties:
153+
component:
154+
description: Component name
155+
type: string
156+
componentHealthStatus:
157+
enum:
158+
- Normal
159+
- Warning
160+
- Error
161+
type: string
162+
required:
163+
- component
164+
- componentHealthStatus
165+
type: object
166+
type: array
167+
lastUpdated:
168+
description: LastUpdated is the timestamp when healthstatus was
169+
updated
170+
format: date-time
171+
type: string
172+
type: object
173+
cniSubnet:
174+
description: CniSubnet is the podip and service ip subnet of CNI
175+
items:
176+
type: string
177+
type: array
178+
isDeregisterInProgress:
179+
description: IsDeregisterInProgress is the flag to check if the cluster
180+
deregister is InProgress
181+
type: boolean
182+
namespaces:
183+
description: Namespaces present in cluster
184+
items:
185+
properties:
186+
name:
187+
type: string
188+
sliceName:
189+
type: string
190+
type: object
191+
type: array
192+
networkPresent:
193+
default: false
194+
description: NetworkPresent denotes if the networking components (NSM,
195+
Spire) are installed on a cluster
196+
type: boolean
197+
nodeIPs:
198+
description: NodeIPs of the gateway node of worker cluster
199+
items:
200+
type: string
201+
type: array
202+
registrationStatus:
203+
description: RegistrationStatus shows the status of cluster registration
204+
enum:
205+
- Pending
206+
- InProgress
207+
- Failed
208+
- Registered
209+
- DeregisterInProgress
210+
- DeregisterFailed
211+
- Deregistered
212+
type: string
213+
secretName:
214+
description: SecretName is the name of the secret for the worker cluster.
215+
type: string
216+
vCPURestriction:
217+
description: VCPURestriction is the restriction on the cluster disabling
218+
the creation of new pods
219+
properties:
220+
enforceRestrictions:
221+
description: EnforceRestrictions is the flag to check if the cluster
222+
is restricted
223+
type: boolean
224+
lastUpdatedTimestamp:
225+
description: LastUpdatedTimestamp is the timestamp when the enforcement
226+
was updated
227+
format: date-time
228+
type: string
229+
type: object
230+
type: object
231+
type: object
232+
served: true
233+
storage: true
234+
subresources:
235+
status: {}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
apiVersion: apiextensions.k8s.io/v1
3+
kind: CustomResourceDefinition
4+
metadata:
5+
annotations:
6+
controller-gen.kubebuilder.io/version: v0.17.3
7+
name: projects.controller.kubeslice.io
8+
spec:
9+
group: controller.kubeslice.io
10+
names:
11+
kind: Project
12+
listKind: ProjectList
13+
plural: projects
14+
singular: project
15+
scope: Namespaced
16+
versions:
17+
- name: v1alpha1
18+
schema:
19+
openAPIV3Schema:
20+
description: Project is the Schema for the projects API
21+
properties:
22+
apiVersion:
23+
description: |-
24+
APIVersion defines the versioned schema of this representation of an object.
25+
Servers should convert recognized schemas to the latest internal value, and
26+
may reject unrecognized values.
27+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
28+
type: string
29+
kind:
30+
description: |-
31+
Kind is a string value representing the REST resource this object represents.
32+
Servers may infer this from the endpoint the client submits requests to.
33+
Cannot be updated.
34+
In CamelCase.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
36+
type: string
37+
metadata:
38+
type: object
39+
spec:
40+
description: ProjectSpec defines the desired state of Project
41+
properties:
42+
defaultSliceCreation:
43+
description: If defaultSliceCreation is true, then the default slice
44+
will be created
45+
type: boolean
46+
serviceAccount:
47+
description: ServiceAccount is a field of Project. Edit project_types.go
48+
to remove/update
49+
properties:
50+
readOnly:
51+
items:
52+
type: string
53+
type: array
54+
readWrite:
55+
items:
56+
type: string
57+
type: array
58+
type: object
59+
type: object
60+
status:
61+
description: ProjectStatus defines the observed state of Project
62+
type: object
63+
type: object
64+
served: true
65+
storage: true
66+
subresources:
67+
status: {}

0 commit comments

Comments
 (0)