Add test for kube-aws cue-manifest part
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
committed by
Guillaume de Rouville
parent
5fcaaa6cfe
commit
f24af776db
36
docs/learn/tests/kube-aws/cue-manifest/service.cue
Normal file
36
docs/learn/tests/kube-aws/cue-manifest/service.cue
Normal file
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
// Service template containing all the common boilerplate shared by
|
||||
// services of this application.
|
||||
#Service: {
|
||||
// Name of the service. This will be used to label resources automatically
|
||||
// and generate selector.
|
||||
name: string
|
||||
|
||||
// NodePort is the default service type.
|
||||
type: *"NodePort" | "LoadBalancer" | "ClusterIP" | "ExternalName"
|
||||
|
||||
// Ports where the service should listen
|
||||
ports: [string]: number
|
||||
|
||||
// Service manifest. Uses the name, type and ports above to
|
||||
// generate the resource manifest.
|
||||
manifest: {
|
||||
apiVersion: "v1"
|
||||
kind: "Service"
|
||||
metadata: {
|
||||
"name": "\(name)-service"
|
||||
labels: app: name
|
||||
}
|
||||
spec: {
|
||||
"type": type
|
||||
"ports": [
|
||||
for k, v in ports {
|
||||
name: k
|
||||
port: v
|
||||
},
|
||||
]
|
||||
selector: app: name
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user