Add zuul-preview service
This change adds an optional preview configuration to the spec: preview: image: docker.io/zuul/zuul-preview:latest count: 0 Change-Id: Id9d902b3b9f25b1bf3fa459634396d7520681417
This commit is contained in:
parent
62b5ca9ad8
commit
9c53503051
40
conf/zuul/components/Preview.dhall
Normal file
40
conf/zuul/components/Preview.dhall
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
let Kubernetes = ../../Kubernetes.dhall
|
||||||
|
|
||||||
|
let F = ../functions.dhall
|
||||||
|
|
||||||
|
let InputPreview = (../input.dhall).Preview.Type
|
||||||
|
|
||||||
|
in \(app-name : Text)
|
||||||
|
-> \(image-name : Optional Text)
|
||||||
|
-> \(data-dir : List F.Volume.Type)
|
||||||
|
-> \(input-preview : InputPreview)
|
||||||
|
-> F.KubernetesComponent::{
|
||||||
|
, Service = Some (F.mkService app-name "preview" "preview" 80)
|
||||||
|
, Deployment = Some
|
||||||
|
( F.mkDeployment
|
||||||
|
app-name
|
||||||
|
F.Component::{
|
||||||
|
, name = "preview"
|
||||||
|
, count = F.defaultNat input-preview.count 0
|
||||||
|
, data-dir = data-dir
|
||||||
|
, container = Kubernetes.Container::{
|
||||||
|
, name = "preview"
|
||||||
|
, image = image-name
|
||||||
|
, imagePullPolicy = Some "IfNotPresent"
|
||||||
|
, ports = Some
|
||||||
|
[ Kubernetes.ContainerPort::{
|
||||||
|
, name = Some "preview"
|
||||||
|
, containerPort = 80
|
||||||
|
}
|
||||||
|
]
|
||||||
|
, env = Some
|
||||||
|
[ Kubernetes.EnvVar::{
|
||||||
|
, name = "ZUUL_API_URL"
|
||||||
|
, value = Some "http://web:9000"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
, volumeMounts = Some (F.mkVolumeMount data-dir)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
@ -97,6 +97,10 @@ let Schemas =
|
|||||||
, public-url = None Text
|
, public-url = None Text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
, Preview =
|
||||||
|
{ Type = { image : Optional Text, count : Optional Natural }
|
||||||
|
, default = { image = None Text, count = None Natural }
|
||||||
|
}
|
||||||
, Launcher =
|
, Launcher =
|
||||||
{ Type = { image : Optional Text, config : UserSecret }
|
{ Type = { image : Optional Text, config : UserSecret }
|
||||||
, default.image = None Text
|
, default.image = None Text
|
||||||
@ -143,6 +147,7 @@ let Input =
|
|||||||
, web : Schemas.Web.Type
|
, web : Schemas.Web.Type
|
||||||
, scheduler : Schemas.Scheduler.Type
|
, scheduler : Schemas.Scheduler.Type
|
||||||
, registry : Schemas.Registry.Type
|
, registry : Schemas.Registry.Type
|
||||||
|
, preview : Schemas.Preview.Type
|
||||||
, launcher : Schemas.Launcher.Type
|
, launcher : Schemas.Launcher.Type
|
||||||
, database : Optional UserSecret
|
, database : Optional UserSecret
|
||||||
, zookeeper : Optional UserSecret
|
, zookeeper : Optional UserSecret
|
||||||
@ -159,6 +164,7 @@ let Input =
|
|||||||
, web = Schemas.Web.default
|
, web = Schemas.Web.default
|
||||||
, scheduler = Schemas.Scheduler.default
|
, scheduler = Schemas.Scheduler.default
|
||||||
, registry = Schemas.Registry.default
|
, registry = Schemas.Registry.default
|
||||||
|
, preview = Schemas.Preview.default
|
||||||
, executor = Schemas.Executor.default
|
, executor = Schemas.Executor.default
|
||||||
, launcher = Schemas.Launcher.default
|
, launcher = Schemas.Launcher.default
|
||||||
, connections = Schemas.Connections.default
|
, connections = Schemas.Connections.default
|
||||||
|
@ -390,6 +390,12 @@ in \(input : Input)
|
|||||||
zuul-data-dir
|
zuul-data-dir
|
||||||
[ etc-zuul-registry ]
|
[ etc-zuul-registry ]
|
||||||
input.registry
|
input.registry
|
||||||
|
, Preview =
|
||||||
|
./components/Preview.dhall
|
||||||
|
input.name
|
||||||
|
(zuul-image "preview")
|
||||||
|
zuul-data-dir
|
||||||
|
input.preview
|
||||||
}
|
}
|
||||||
, Nodepool =
|
, Nodepool =
|
||||||
let nodepool-image =
|
let nodepool-image =
|
||||||
@ -586,6 +592,7 @@ in \(input : Input)
|
|||||||
# mkUnion Components.Zuul.Web
|
# mkUnion Components.Zuul.Web
|
||||||
# mkUnion Components.Zuul.Merger
|
# mkUnion Components.Zuul.Merger
|
||||||
# mkUnion Components.Zuul.Registry
|
# mkUnion Components.Zuul.Registry
|
||||||
|
# mkUnion Components.Zuul.Preview
|
||||||
# mkUnion Components.Nodepool.Launcher
|
# mkUnion Components.Nodepool.Launcher
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,8 @@ merger:
|
|||||||
scheduler:
|
scheduler:
|
||||||
config:
|
config:
|
||||||
secretName: zuul-yaml-conf
|
secretName: zuul-yaml-conf
|
||||||
|
preview:
|
||||||
|
count: 0
|
||||||
registry:
|
registry:
|
||||||
count: 0
|
count: 0
|
||||||
launcher:
|
launcher:
|
||||||
|
@ -134,6 +134,8 @@
|
|||||||
key: kube.config
|
key: kube.config
|
||||||
registry:
|
registry:
|
||||||
count: 1
|
count: 1
|
||||||
|
preview:
|
||||||
|
count: 1
|
||||||
withCertManager: "{{ withCertManager }}"
|
withCertManager: "{{ withCertManager }}"
|
||||||
|
|
||||||
- name: Wait maximum 4 minutes for the scheduler deployment
|
- name: Wait maximum 4 minutes for the scheduler deployment
|
||||||
@ -172,6 +174,18 @@
|
|||||||
command: kubectl get Issuers zuul-ca -o yaml
|
command: kubectl get Issuers zuul-ca -o yaml
|
||||||
when: withCertManager
|
when: withCertManager
|
||||||
|
|
||||||
|
- name: Test the preview service
|
||||||
|
block:
|
||||||
|
- name: Get preview service ip
|
||||||
|
command: kubectl get svc preview -o "jsonpath={.spec.clusterIP}"
|
||||||
|
register: _preview_ip
|
||||||
|
|
||||||
|
- name: Connect to the preview service
|
||||||
|
uri:
|
||||||
|
url: "http://{{ _preview_ip.stdout_lines[0] }}"
|
||||||
|
method: POST
|
||||||
|
status_code: 403
|
||||||
|
|
||||||
- name: Test the registry
|
- name: Test the registry
|
||||||
block:
|
block:
|
||||||
- name: Get registry service ip
|
- name: Get registry service ip
|
||||||
|
@ -14,5 +14,6 @@ cert_manager: "{{ (raw_spec['withCertManager'] | default(true)) | bool }}"
|
|||||||
spec_defaults:
|
spec_defaults:
|
||||||
web: {}
|
web: {}
|
||||||
registry: {}
|
registry: {}
|
||||||
|
preview: {}
|
||||||
externalConfig: {}
|
externalConfig: {}
|
||||||
withCertManager: true
|
withCertManager: true
|
||||||
|
Loading…
Reference in New Issue
Block a user