forked from suse-edge/Factory
Import first batch of Edge 3.1 packages
Signed-off-by: Nicolas Belouin <nicolas.belouin@suse.com>
This commit is contained in:
parent
fdcd84b482
commit
18bd432874
86
.obs/add_package.py
Executable file
86
.obs/add_package.py
Executable file
@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python3
|
||||
import yaml
|
||||
import subprocess
|
||||
import argparse
|
||||
import os
|
||||
import os.path
|
||||
|
||||
from common import PROJECT, REPOSITORY, BRANCH
|
||||
|
||||
def add_package_to_workflow(name: str):
|
||||
modified = False
|
||||
with open(".obs/workflows.yml", "r") as wf_file:
|
||||
workflows = yaml.safe_load(wf_file)
|
||||
if not any(
|
||||
x
|
||||
for x in workflows["staging_build"]["steps"]
|
||||
if x["branch_package"]["source_package"] == name
|
||||
):
|
||||
workflows["staging_build"]["steps"].append(
|
||||
{
|
||||
"branch_package": {
|
||||
"source_project": PROJECT,
|
||||
"target_project": f"{PROJECT}:Staging",
|
||||
"source_package": name,
|
||||
}
|
||||
}
|
||||
)
|
||||
modified = True
|
||||
if not any(
|
||||
x
|
||||
for x in workflows["refresh_factory"]["steps"]
|
||||
if x["trigger_services"]["package"] == name
|
||||
):
|
||||
workflows["refresh_factory"]["steps"].append(
|
||||
{
|
||||
"trigger_services": {
|
||||
"project": PROJECT,
|
||||
"package": name,
|
||||
}
|
||||
}
|
||||
)
|
||||
modified = True
|
||||
if modified:
|
||||
with open(".obs/workflows.yml", "w") as wf_file:
|
||||
yaml.dump(workflows, wf_file)
|
||||
|
||||
|
||||
def add_package_to_project(name: str):
|
||||
package_meta = f"""<package name="{name}" project="{PROJECT}">
|
||||
<title/>
|
||||
<description/>
|
||||
<scmsync>{REPOSITORY}?subdir={name}#{BRANCH}</scmsync>
|
||||
</package>"""
|
||||
p = subprocess.run(["osc", "meta", "pkg", "-F", "-", PROJECT, name], input=package_meta, encoding='utf-8' , stdout=subprocess.PIPE)
|
||||
print(p.stdout)
|
||||
print(p.stderr)
|
||||
p.check_returncode()
|
||||
|
||||
|
||||
def add_package(package_name: str):
|
||||
if "/" in package_name:
|
||||
print("invalid package name")
|
||||
os.exit(1)
|
||||
|
||||
if not os.path.isdir(package_name):
|
||||
print("package doesn't exist in this directory")
|
||||
os.exit(1)
|
||||
|
||||
add_package_to_project(package_name)
|
||||
add_package_to_workflow(package_name)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="add_package")
|
||||
parser.add_argument("package")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
add_package(args.package)
|
||||
|
||||
|
||||
print("Package created in OBS, you can now push the modified workflow file")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
3
.obs/common.py
Normal file
3
.obs/common.py
Normal file
@ -0,0 +1,3 @@
|
||||
PROJECT = "isv:SUSE:Edge:Factory"
|
||||
REPOSITORY = "https://src.opensuse.org/suse-edge/Factory"
|
||||
BRANCH = "main"
|
56
.obs/delete_package.py
Executable file
56
.obs/delete_package.py
Executable file
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python3
|
||||
import yaml
|
||||
import subprocess
|
||||
import argparse
|
||||
import os
|
||||
import os.path
|
||||
|
||||
from common import PROJECT
|
||||
|
||||
|
||||
def delete_package_from_workflow(name: str):
|
||||
with open(".obs/workflows.yml", "r") as wf_file:
|
||||
workflows = yaml.safe_load(wf_file)
|
||||
workflows["staging_build"]["steps"] = [
|
||||
x
|
||||
for x in workflows["staging_build"]["steps"]
|
||||
if x["branch_package"]["source_package"] != name
|
||||
]
|
||||
workflows["refresh_factory"]["steps"] = [
|
||||
x
|
||||
for x in workflows["refresh_factory"]["steps"]
|
||||
if x["trigger_services"]["package"] != name
|
||||
]
|
||||
with open(".obs/workflows.yml", "w") as wf_file:
|
||||
yaml.dump(workflows, wf_file)
|
||||
|
||||
|
||||
def delete_package_from_project(name: str):
|
||||
p = subprocess.run(["osc", "rdelete", PROJECT, name], stdout=subprocess.PIPE)
|
||||
print(p.stdout)
|
||||
print(p.stderr)
|
||||
p.check_returncode()
|
||||
|
||||
|
||||
def delete_package(package_name: str):
|
||||
if "/" in package_name:
|
||||
print("invalid package name")
|
||||
os.exit(1)
|
||||
|
||||
delete_package_from_project(package_name)
|
||||
delete_package_from_workflow(package_name)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="delete_package")
|
||||
parser.add_argument("package")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
delete_package(args.package)
|
||||
|
||||
print("Package deleted in OBS, you can now push the modified workflow file")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
44
.obs/sync_packages.py
Normal file
44
.obs/sync_packages.py
Normal file
@ -0,0 +1,44 @@
|
||||
import argparse
|
||||
import subprocess
|
||||
import pathlib
|
||||
from typing import Set
|
||||
import add_package
|
||||
import delete_package
|
||||
|
||||
from common import PROJECT
|
||||
|
||||
def get_obs_packages() -> Set[str]:
|
||||
packages = subprocess.run(["osc", "ls", PROJECT], encoding='utf-8' , capture_output=True)
|
||||
return set(packages.stdout.splitlines())
|
||||
|
||||
def get_local_packages() -> Set[str]:
|
||||
p = pathlib.Path('.')
|
||||
return {x.name for x in p.iterdir() if x.is_dir() if not x.name.startswith('.')}
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="sync_packages")
|
||||
parser.add_argument('--dry-run', action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
local_packages = get_local_packages()
|
||||
obs_packages = get_obs_packages()
|
||||
|
||||
packages_to_add = local_packages - obs_packages
|
||||
packages_to_delete = obs_packages - local_packages
|
||||
|
||||
for p in packages_to_add:
|
||||
print(f"Adding {p}")
|
||||
if not args.dry_run:
|
||||
add_package.add_package(p)
|
||||
|
||||
for p in packages_to_delete:
|
||||
print(f"Removing {p}")
|
||||
if not args.dry_run:
|
||||
delete_package.delete_package(p)
|
||||
|
||||
print("Package synced in OBS, you can now push the modified workflow file")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
213
.obs/workflows.yml
Normal file
213
.obs/workflows.yml
Normal file
@ -0,0 +1,213 @@
|
||||
refresh_factory:
|
||||
filters:
|
||||
branches:
|
||||
only: main
|
||||
event: push
|
||||
steps:
|
||||
- trigger_services:
|
||||
package: endpoint-copier-operator
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: endpoint-copier-operator-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: endpoint-copier-operator-chart
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-agent-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-chart
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-controller-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-dashboard-extension-chart
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-debug-echo-discovery-handler-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-onvif-discovery-handler-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-opcua-discovery-handler-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-udev-discovery-handler-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: akri-webhook-configuration-image
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: obs-service-set_version
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: cosign
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: frr-k8s
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: cluster-api
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: cluster-api-operator
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: kubectl
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: upgrade-controller
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: cluster-api-provider-rke2
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: nm-configurator
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: kube-rbac-proxy
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: edge-image-builder
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: metallb
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: hauler
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: ip-address-manager
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: baremetal-operator
|
||||
project: isv:SUSE:Edge:Factory
|
||||
- trigger_services:
|
||||
package: cluster-api-provider-metal3
|
||||
project: isv:SUSE:Edge:Factory
|
||||
staging_build:
|
||||
filters:
|
||||
event: pull_request
|
||||
steps:
|
||||
- branch_package:
|
||||
source_package: endpoint-copier-operator
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: endpoint-copier-operator-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: endpoint-copier-operator-chart
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-agent-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-chart
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-controller-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-dashboard-extension-chart
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-debug-echo-discovery-handler-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-onvif-discovery-handler-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-opcua-discovery-handler-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-udev-discovery-handler-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: akri-webhook-configuration-image
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: obs-service-set_version
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: cosign
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: frr-k8s
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: cluster-api
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: cluster-api-operator
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: kubectl
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: upgrade-controller
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: cluster-api-provider-rke2
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: nm-configurator
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: kube-rbac-proxy
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: edge-image-builder
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: metallb
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: hauler
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: ip-address-manager
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: baremetal-operator
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
||||
- branch_package:
|
||||
source_package: cluster-api-provider-metal3
|
||||
source_project: isv:SUSE:Edge:Factory
|
||||
target_project: isv:SUSE:Edge:Factory:Staging
|
34
akri-agent-image/Dockerfile
Normal file
34
akri-agent-image/Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
#!BuildTag: akri-agent:latest
|
||||
#!BuildTag: akri-agent:v%PACKAGE_VERSION%
|
||||
#!BuildTag: akri-agent:v%PACKAGE_VERSION%-%RELEASE%
|
||||
ARG SLE_VERSION
|
||||
FROM registry.suse.com/bci/bci-micro:$SLE_VERSION AS micro
|
||||
|
||||
FROM registry.suse.com/bci/bci-base:$SLE_VERSION AS base
|
||||
COPY --from=micro / /installroot/
|
||||
RUN zypper --installroot /installroot --non-interactive install --no-recommends akri-agent
|
||||
|
||||
FROM micro AS final
|
||||
|
||||
# Define labels according to https://en.opensuse.org/Building_derived_containers
|
||||
# labelprefix=com.suse.application.akri
|
||||
LABEL org.opencontainers.image.authors="SUSE LLC (https://www.suse.com/)"
|
||||
LABEL org.opencontainers.image.title="SLE Akri Agent Container Image"
|
||||
LABEL org.opencontainers.image.description="akri-agent based on the SLE Base Container Image."
|
||||
LABEL org.opencontainers.image.version="%PACKAGE_VERSION%"
|
||||
LABEL org.opencontainers.image.url="https://www.suse.com/solutions/edge-computing/"
|
||||
LABEL org.opencontainers.image.created="%BUILDTIME%"
|
||||
LABEL org.opencontainers.image.vendor="SUSE LLC"
|
||||
LABEL org.opensuse.reference="%%IMG_REPO%%/akri-agent:v%PACKAGE_VERSION%-%RELEASE%"
|
||||
LABEL org.openbuildservice.disturl="%DISTURL%"
|
||||
LABEL com.suse.supportlevel="techpreview"
|
||||
LABEL com.suse.eula="SUSE Combined EULA February 2024"
|
||||
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle"
|
||||
LABEL com.suse.image-type="application"
|
||||
LABEL com.suse.release-stage="released"
|
||||
# endlabelprefix
|
||||
|
||||
COPY --from=base /installroot /
|
||||
ENV RUST_LOG agent,akri_debug_echo,akri_discovery_utils,akri_onvif,akri_opcua,akri_shared,akri_udev\
|
||||
,controller,debug_echo_discovery_handler,onvif_discovery_handler,opcua_discovery_handler,udev_discovery_handler
|
||||
ENTRYPOINT [ "/usr/bin/agent" ]
|
15
akri-agent-image/_service
Normal file
15
akri-agent-image/_service
Normal file
@ -0,0 +1,15 @@
|
||||
<services>
|
||||
<service name="kiwi_metainfo_helper" mode="buildtime"/>
|
||||
<service name="docker_label_helper" mode="buildtime"/>
|
||||
<service name="replace_using_package_version" mode="buildtime">
|
||||
<param name="file">Dockerfile</param>
|
||||
<param name="regex">%PACKAGE_VERSION%</param>
|
||||
<param name="package">akri-agent</param>
|
||||
<param name="parse-version">patch</param>
|
||||
</service>
|
||||
<service name="replace_using_env" mode="buildtime">
|
||||
<param name="file">Dockerfile</param>
|
||||
<param name="eval">IMG_REPO=$(rpm --macros=/root/.rpmmacros -E %img_repo)</param>
|
||||
<param name="var">IMG_REPO</param>
|
||||
</service>
|
||||
</services>
|
11
akri-chart/Chart.yaml
Normal file
11
akri-chart/Chart.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
#!BuildTag: akri-chart:0.12.20
|
||||
#!BuildTag: akri-chart:0.12.20-%RELEASE%
|
||||
annotations:
|
||||
catalog.cattle.io/display-name: Akri
|
||||
apiVersion: v2
|
||||
appVersion: 0.12.20
|
||||
description: A Helm chart for Akri
|
||||
icon: https://raw.githubusercontent.com/project-akri/akri-docs/main/art/icon/akri-icon-light.svg
|
||||
name: akri
|
||||
type: application
|
||||
version: 0.12.20
|
8
akri-chart/_service
Normal file
8
akri-chart/_service
Normal file
@ -0,0 +1,8 @@
|
||||
<services>
|
||||
<service mode="buildtime" name="kiwi_metainfo_helper"/>
|
||||
<service name="replace_using_env" mode="buildtime">
|
||||
<param name="file">values.yaml</param>
|
||||
<param name="eval">IMG_REPO=$(rpm --macros=/root/.rpmmacros -E %img_repo)</param>
|
||||
<param name="var">IMG_REPO</param>
|
||||
</service>
|
||||
</services>
|
5
akri-chart/app-readme.md
Normal file
5
akri-chart/app-readme.md
Normal file
@ -0,0 +1,5 @@
|
||||
WARNING: [TESTING]
|
||||
|
||||
Akri lets you easily expose heterogeneous leaf devices (such as IP cameras and USB devices) as resources in a Kubernetes cluster, while also supporting the exposure of embedded hardware resources such as GPUs and FPGAs. Akri continually detects nodes that have access to these devices and schedules workloads based on them.
|
||||
|
||||
Simply put: you name it, Akri finds it, you use it.
|
117
akri-chart/crds/akri-configuration-crd.yaml
Normal file
117
akri-chart/crds/akri-configuration-crd.yaml
Normal file
@ -0,0 +1,117 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: configurations.akri.sh
|
||||
spec:
|
||||
group: akri.sh
|
||||
versions:
|
||||
- name: v0
|
||||
served: true
|
||||
storage: true
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
discoveryHandler: # {{DiscoveryHandlerInfo}}
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
discoveryDetails:
|
||||
type: string
|
||||
discoveryProperties:
|
||||
nullable: true
|
||||
type: array
|
||||
items: # {{DiscoveryProperty}}
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
pattern: "^[_A-Za-z][_A-Za-z0-9]*$"
|
||||
value:
|
||||
type: string
|
||||
nullable: true
|
||||
valueFrom:
|
||||
type: object
|
||||
properties:
|
||||
secretKeyRef:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
optional:
|
||||
type: boolean
|
||||
configMapKeyRef:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
optional:
|
||||
type: boolean
|
||||
oneOf:
|
||||
- properties:
|
||||
required: ["secretKeyRef"]
|
||||
- properties:
|
||||
required: ["configMapKeyRef"]
|
||||
oneOf:
|
||||
- properties:
|
||||
required: ["value"]
|
||||
- properties:
|
||||
required: ["valueFrom"]
|
||||
capacity:
|
||||
type: integer
|
||||
brokerSpec: # {{BrokerSpec}}
|
||||
type: object
|
||||
properties:
|
||||
brokerJobSpec: # {{JobSpec}}
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
nullable: true
|
||||
brokerPodSpec: # {{PodSpec}}
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
nullable: true
|
||||
instanceServiceSpec: # {{ServiceSpec}}
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
nullable: true
|
||||
configurationServiceSpec: # {{ServiceSpec}}
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
nullable: true
|
||||
brokerProperties: # map<string, string>
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
additionalPrinterColumns:
|
||||
- name: Capacity
|
||||
type: string
|
||||
description: The capacity for each Instance discovered
|
||||
jsonPath: .spec.capacity
|
||||
- name: Age
|
||||
type: date
|
||||
jsonPath: .metadata.creationTimestamp
|
||||
scope: Namespaced
|
||||
names:
|
||||
plural: configurations
|
||||
singular: configuration
|
||||
kind: Configuration
|
||||
shortNames:
|
||||
- akric
|
56
akri-chart/crds/akri-instance-crd.yaml
Normal file
56
akri-chart/crds/akri-instance-crd.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
name: instances.akri.sh
|
||||
spec:
|
||||
group: akri.sh
|
||||
versions:
|
||||
- name: v0
|
||||
served: true
|
||||
storage: true
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
properties:
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
configurationName:
|
||||
type: string
|
||||
brokerProperties:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
shared:
|
||||
type: boolean
|
||||
nodes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
deviceUsage: # map<string, string>
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
additionalPrinterColumns:
|
||||
- name: Config
|
||||
type: string
|
||||
description: The Configuration this Instance belongs to
|
||||
jsonPath: .spec.configurationName
|
||||
- name: Shared
|
||||
type: boolean
|
||||
description: Describes whether this Instance is shared
|
||||
jsonPath: .spec.shared
|
||||
- name: Nodes
|
||||
type: string
|
||||
description: Nodes that expose this Instance
|
||||
jsonPath: .spec.nodes
|
||||
- name: Age
|
||||
type: date
|
||||
jsonPath: .metadata.creationTimestamp
|
||||
scope: Namespaced
|
||||
names:
|
||||
plural: instances
|
||||
singular: instance
|
||||
kind: Instance
|
||||
shortNames:
|
||||
- akrii
|
121
akri-chart/questions.yml
Normal file
121
akri-chart/questions.yml
Normal file
@ -0,0 +1,121 @@
|
||||
questions:
|
||||
- variable: kubernetesDistro
|
||||
default: "k8s"
|
||||
label: Kubernetes Distribution
|
||||
description: Select Kubernetes distribution so Akri can determine where the container runtime socket lives.
|
||||
type: enum
|
||||
options:
|
||||
- k8s
|
||||
- microk8s
|
||||
- k3s
|
||||
- Other
|
||||
group: General
|
||||
- variable: agent.host.containerRuntimeSocket
|
||||
label: Container Runtime Socket
|
||||
description: Akri depends on crictl to track some Pod information. In order to use it, the Agent must know where the container runtime socket lives.
|
||||
show_if: "kubernetesDistro=Other"
|
||||
type: string
|
||||
group: General
|
||||
- variable: useDevelopmentContainers
|
||||
label: Use development containers
|
||||
description: When enabled the non-release (*-dev) image tags will be used by default. This can be overridden if the tag is explicitly specified.
|
||||
type: boolean
|
||||
group: General
|
||||
- variable: _imageDetails
|
||||
label: Customize agent and controller images
|
||||
default: false
|
||||
type: boolean
|
||||
group: General
|
||||
show_subquestion_if: true
|
||||
subquestions:
|
||||
- variable: agent.image.repository
|
||||
label: Akri agent image repository
|
||||
type: string
|
||||
- variable: agent.image.tag
|
||||
label: Akri agent image tag
|
||||
description: Akri agent container tag. agent.yaml will default to v(AppVersion)[-dev] with `-dev` added if `Use development containers` is enabled.
|
||||
type: string
|
||||
- variable: agent.image.pullPolicy
|
||||
label: Akri agent image pull policy
|
||||
type: enum
|
||||
options:
|
||||
- "IfNotPresent"
|
||||
- "Always"
|
||||
- "Never"
|
||||
- variable: controller.image.repository
|
||||
label: Akri controller image repository
|
||||
type: string
|
||||
- variable: controller.image.tag
|
||||
label: Akri controller image tag
|
||||
description: Akri controller container tag. controller.yaml will default to v(AppVersion)[-dev] with `-dev` added if `Use development containers` is enabled.
|
||||
type: string
|
||||
- variable: controller.image.pullPolicy
|
||||
label: Akri controller image pull policy
|
||||
type: enum
|
||||
options:
|
||||
- "IfNotPresent"
|
||||
- "Always"
|
||||
- "Never"
|
||||
- variable: onvif.discovery.enabled
|
||||
label: Enable ONVIF Discovery Handler
|
||||
description: ONVIF is a standard used by many IP cameras.
|
||||
type: boolean
|
||||
group: "Discovery Handlers"
|
||||
show_subquestion_if: true
|
||||
subquestions:
|
||||
- variable: onvif.discovery.image.repository
|
||||
label: ONVIF handler image repository
|
||||
type: string
|
||||
- variable: onvif.discovery.image.tag
|
||||
label: Image tag
|
||||
description: onvif-configuration.yaml will default to v(AppVersion)[-dev] with `-dev` added if `Use development containers` is enabled.
|
||||
type: string
|
||||
- variable: onvif.discovery.image.pullPolicy
|
||||
label: Image pull policy
|
||||
type: enum
|
||||
options:
|
||||
- "IfNotPresent"
|
||||
- "Always"
|
||||
- "Never"
|
||||
- variable: opcua.discovery.enabled
|
||||
label: Enable OPC UA Discovery Handler
|
||||
description: OPC UA (Open Platform Communications Unified Architecture) is a communication protocol for industrial automation.
|
||||
type: boolean
|
||||
group: "Discovery Handlers"
|
||||
show_subquestion_if: true
|
||||
subquestions:
|
||||
- variable: opcua.discovery.image.repository
|
||||
label: OPC UA handler image repository
|
||||
type: string
|
||||
- variable: opcua.discovery.image.tag
|
||||
label: Image tag
|
||||
description: opcua-configuration.yaml will default to v(AppVersion)[-dev] with `-dev` added if `Use development containers` is enabled.
|
||||
type: string
|
||||
- variable: opcua.discovery.image.pullPolicy
|
||||
label: Image pull policy
|
||||
type: enum
|
||||
options:
|
||||
- "IfNotPresent"
|
||||
- "Always"
|
||||
- "Never"
|
||||
- variable: udev.discovery.enabled
|
||||
label: Enable Udev Discovery Handler
|
||||
description: Udev is the device manager for Linux. It manages device nodes in the /dev directory, such as microphones, security chips, usb cameras, and so on. Udev can be used to find devices that are attached to or embedded in Linux nodes.
|
||||
type: boolean
|
||||
group: "Discovery Handlers"
|
||||
show_subquestion_if: true
|
||||
subquestions:
|
||||
- variable: udev.discovery.image.repository
|
||||
label: Udev handler image repository
|
||||
type: string
|
||||
- variable: udev.discovery.image.tag
|
||||
label: Image tag
|
||||
description: udev-configuration.yaml will default to v(AppVersion)[-dev] with `-dev` added if `Use development containers` is enabled.
|
||||
type: string
|
||||
- variable: udev.discovery.image.pullPolicy
|
||||
label: Image pull policy
|
||||
type: enum
|
||||
options:
|
||||
- "IfNotPresent"
|
||||
- "Always"
|
||||
- "Never"
|
6
akri-chart/templates/NOTES.txt
Normal file
6
akri-chart/templates/NOTES.txt
Normal file
@ -0,0 +1,6 @@
|
||||
1. Get the Akri Controller:
|
||||
kubectl get -o wide pods | grep controller
|
||||
2. Get the Akri Agent(s):
|
||||
kubectl get -o wide pods | grep agent
|
||||
3. Get the Akri Configuration(s):
|
||||
kubectl get -o wide akric
|
63
akri-chart/templates/_helpers.tpl
Normal file
63
akri-chart/templates/_helpers.tpl
Normal file
@ -0,0 +1,63 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "akri.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "akri.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "akri.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "akri.labels" -}}
|
||||
helm.sh/chart: {{ include "akri.chart" . }}
|
||||
{{ include "akri.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "akri.selectorLabels" -}}
|
||||
app.kubernetes.io/part-of: {{ include "akri.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "akri.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "akri.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
129
akri-chart/templates/agent.yaml
Normal file
129
akri-chart/templates/agent.yaml
Normal file
@ -0,0 +1,129 @@
|
||||
{{- if .Values.agent.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: akri-agent-daemonset
|
||||
labels: {{- include "akri.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/name: akri-agent
|
||||
app.kubernetes.io/component: agent
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "akri.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/name: akri-agent
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "akri.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/name: akri-agent
|
||||
app.kubernetes.io/component: agent
|
||||
spec:
|
||||
nodeSelector:
|
||||
"kubernetes.io/os": linux
|
||||
{{- if .Values.agent.nodeSelectors }}
|
||||
{{- toYaml .Values.agent.nodeSelectors | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.rbac.enabled }}
|
||||
serviceAccountName: 'akri-agent-sa'
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: akri-agent
|
||||
{{- $repository := .Values.agent.image.repository -}}
|
||||
{{- if .Values.useDevelopmentContainers }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" $repository (default "latest-dev" .Values.agent.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" $repository (default (printf "v%s-dev" .Chart.AppVersion) .Values.agent.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" $repository (default "latest" .Values.agent.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" $repository (default (printf "v%s" .Chart.AppVersion) .Values.agent.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.agent.image.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
memory: {{ .Values.agent.resources.memoryRequest }}
|
||||
cpu: {{ .Values.agent.resources.cpuRequest }}
|
||||
limits:
|
||||
memory: {{ .Values.agent.resources.memoryLimit }}
|
||||
cpu: {{ .Values.agent.resources.cpuLimit }}
|
||||
{{- if .Values.agent.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.agent.securityContext | nindent 10 }}
|
||||
{{- else }}
|
||||
securityContext:
|
||||
privileged: true
|
||||
{{- end}}
|
||||
env:
|
||||
{{- if .Values.agent.allowDebugEcho }}
|
||||
- name: ENABLE_DEBUG_ECHO
|
||||
value: "1"
|
||||
{{- /* environment variable to tell the Agent's embedded debug echo Discovery Handler whether its instances are shared */}}
|
||||
- name: DEBUG_ECHO_INSTANCES_SHARED
|
||||
value: {{ .Values.debugEcho.configuration.shared | quote }}
|
||||
{{- end }}
|
||||
- name: HOST_CRICTL_PATH
|
||||
value: /usr/bin/crictl
|
||||
- name: HOST_RUNTIME_ENDPOINT
|
||||
value: unix:///host/run/containerd/containerd.sock
|
||||
- name: HOST_IMAGE_ENDPOINT
|
||||
value: unix:///host/run/containerd/containerd.sock
|
||||
- name: AGENT_NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: DISCOVERY_HANDLERS_DIRECTORY
|
||||
value: /var/lib/akri
|
||||
volumeMounts:
|
||||
- name: discovery-handlers
|
||||
mountPath: /var/lib/akri
|
||||
- name: device-plugin
|
||||
mountPath: /var/lib/kubelet/device-plugins
|
||||
- name: var-run-dockershim
|
||||
mountPath: /host/run/containerd/containerd.sock
|
||||
{{- if .Values.agent.host.udev }}
|
||||
- name: devices
|
||||
mountPath: /run/udev
|
||||
{{- end }}
|
||||
{{- if .Values.prometheus.enabled }}
|
||||
ports:
|
||||
- name: {{ .Values.prometheus.portName | quote }}
|
||||
containerPort: {{ .Values.prometheus.port }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: discovery-handlers
|
||||
hostPath:
|
||||
path: {{ .Values.agent.host.discoveryHandlers }}
|
||||
- name: device-plugin
|
||||
hostPath:
|
||||
path: "{{ .Values.agent.host.kubeletDevicePlugins }}"
|
||||
- name: var-run-dockershim
|
||||
hostPath:
|
||||
{{- if ne "" .Values.agent.host.containerRuntimeSocket }}
|
||||
path: {{.Values.agent.host.containerRuntimeSocket }}
|
||||
{{- else if eq .Values.kubernetesDistro "microk8s" }}
|
||||
path: "/var/snap/microk8s/common/run/containerd.sock"
|
||||
{{- else if eq .Values.kubernetesDistro "k3s" }}
|
||||
path: "/run/k3s/containerd/containerd.sock"
|
||||
{{- else if eq .Values.kubernetesDistro "k8s" }}
|
||||
path: "/run/containerd/containerd.sock"
|
||||
{{- else }}
|
||||
# Please set container runtime socket by either selecting the appropriate K8s distro `kubernetesDistro=<k8s|k3s|microk8s>`
|
||||
# or setting `agent.host.containerRuntimeSocket=/container/runtime.sock`.
|
||||
# See https://docs.akri.sh/user-guide/cluster-setup for more information.
|
||||
# Using K8s default "/run/containerd/containerd.sock" for now.
|
||||
path: "/run/containerd/containerd.sock"
|
||||
{{- end }}
|
||||
{{- if .Values.agent.host.udev }}
|
||||
- name: devices
|
||||
hostPath:
|
||||
path: "{{ .Values.agent.host.udev }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
75
akri-chart/templates/controller.yaml
Normal file
75
akri-chart/templates/controller.yaml
Normal file
@ -0,0 +1,75 @@
|
||||
{{- if .Values.controller.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: akri-controller-deployment
|
||||
labels: {{- include "akri.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/name: akri-controller
|
||||
app.kubernetes.io/component: controller
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {{- include "akri.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/name: akri-controller
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "akri.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/name: akri-controller
|
||||
app.kubernetes.io/component: controller
|
||||
spec:
|
||||
{{- if .Values.rbac.enabled }}
|
||||
serviceAccountName: 'akri-controller-sa'
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: akri-controller
|
||||
{{- if .Values.useDevelopmentContainers }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" .Values.controller.image.repository (default "latest-dev" .Values.controller.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" .Values.controller.image.repository (default (printf "v%s-dev" .Chart.AppVersion) .Values.controller.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" .Values.controller.image.repository (default "latest" .Values.controller.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" .Values.controller.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.controller.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.controller.image.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.securityContext }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.controller.securityContext | nindent 10 }}
|
||||
{{- end}}
|
||||
resources:
|
||||
requests:
|
||||
memory: {{ .Values.controller.resources.memoryRequest }}
|
||||
cpu: {{ .Values.controller.resources.cpuRequest }}
|
||||
limits:
|
||||
memory: {{ .Values.controller.resources.memoryLimit }}
|
||||
cpu: {{ .Values.controller.resources.cpuLimit }}
|
||||
{{- if .Values.prometheus.enabled }}
|
||||
ports:
|
||||
- name: {{ .Values.prometheus.portName | quote }}
|
||||
containerPort: {{ .Values.prometheus.port }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.allowOnControlPlane }}
|
||||
tolerations:
|
||||
{{- /* Allow this pod to run on the master. */}}
|
||||
- key: node-role.kubernetes.io/master
|
||||
effect: NoSchedule
|
||||
{{- end }}
|
||||
nodeSelector:
|
||||
{{- if .Values.controller.onlyOnControlPlane }}
|
||||
node-role.kubernetes.io/master: ""
|
||||
{{- end }}
|
||||
"kubernetes.io/os": linux
|
||||
{{- if .Values.controller.nodeSelectors }}
|
||||
{{- toYaml .Values.controller.nodeSelectors | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
148
akri-chart/templates/custom-configuration.yaml
Normal file
148
akri-chart/templates/custom-configuration.yaml
Normal file
@ -0,0 +1,148 @@
|
||||
{{- if .Values.custom.configuration.enabled }}
|
||||
apiVersion: {{ printf "%s/%s" .Values.crds.group .Values.crds.version }}
|
||||
kind: Configuration
|
||||
metadata:
|
||||
name: {{ .Values.custom.configuration.name }}
|
||||
spec:
|
||||
discoveryHandler:
|
||||
name: {{ required "A custom.configuration.discoveryHandlerName is required." .Values.custom.configuration.discoveryHandlerName }}
|
||||
discoveryDetails: {{ .Values.custom.configuration.discoveryDetails | quote }}
|
||||
{{- if or .Values.custom.configuration.brokerPod.image.repository .Values.custom.configuration.brokerJob.image.repository }}
|
||||
{{- /* Only add brokerSpec if a broker image is provided */}}
|
||||
brokerSpec:
|
||||
{{- if .Values.custom.configuration.brokerPod.image.repository }}
|
||||
brokerPodSpec:
|
||||
containers:
|
||||
- name: {{ .Values.custom.configuration.name }}-broker
|
||||
image: {{ printf "%s:%s" .Values.custom.configuration.brokerPod.image.repository .Values.custom.configuration.brokerPod.image.tag | quote }}
|
||||
{{- with .Values.custom.configuration.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerPod.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.custom.configuration.brokerPod.env }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerPod.envFrom }}
|
||||
envFrom:
|
||||
{{- range $val := .Values.custom.configuration.brokerPod.envFrom.secretRef }}
|
||||
- secretRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- range $val := .Values.custom.configuration.brokerPod.envFrom.configMapRef }}
|
||||
- configMapRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.custom.configuration.brokerPod.resources.memoryRequest }}
|
||||
cpu: {{ .Values.custom.configuration.brokerPod.resources.cpuRequest }}
|
||||
limits:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.custom.configuration.brokerPod.resources.memoryLimit }}
|
||||
cpu: {{ .Values.custom.configuration.brokerPod.resources.cpuLimit }}
|
||||
{{- with .Values.custom.configuration.brokerPod.volumeMounts}}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.custom.configuration.brokerPod.volumes}}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
brokerJobSpec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.custom.configuration.name }}-broker
|
||||
image: {{ printf "%s:%s" .Values.custom.configuration.brokerJob.image.repository .Values.custom.configuration.brokerPod.image.tag | quote }}
|
||||
{{- if .Values.custom.configuration.brokerJob.command }}
|
||||
command:
|
||||
{{- toYaml .Values.custom.configuration.brokerJob.command | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- with .Values.custom.configuration.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerJob.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.custom.configuration.brokerJob.env }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerJob.envFrom }}
|
||||
envFrom:
|
||||
{{- range $val := .Values.custom.configuration.brokerJob.envFrom.secretRef }}
|
||||
- secretRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- range $val := .Values.custom.configuration.brokerJob.envFrom.configMapRef }}
|
||||
- configMapRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.custom.configuration.brokerJob.resources.memoryRequest }}
|
||||
cpu: {{ .Values.custom.configuration.brokerJob.resources.cpuRequest }}
|
||||
limits:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.custom.configuration.brokerJob.resources.memoryLimit }}
|
||||
cpu: {{ .Values.custom.configuration.brokerJob.resources.cpuLimit }}
|
||||
{{- with .Values.custom.configuration.brokerJob.volumeMounts}}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.custom.configuration.brokerJob.volumes}}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
restartPolicy: {{ .Values.custom.configuration.brokerJob.restartPolicy }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
backoffLimit: {{ .Values.custom.configuration.brokerJob.backoffLimit }}
|
||||
parallelism: {{ .Values.custom.configuration.brokerJob.parallelism }}
|
||||
completions: {{ .Values.custom.configuration.brokerJob.completions }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerPod.image.repository }}
|
||||
{{- if .Values.custom.configuration.createInstanceServices }}
|
||||
instanceServiceSpec:
|
||||
type: {{ .Values.custom.configuration.instanceService.type }}
|
||||
ports:
|
||||
- name: {{ .Values.custom.configuration.instanceService.name }}
|
||||
port: {{ .Values.custom.configuration.instanceService.port }}
|
||||
protocol: {{ .Values.custom.configuration.instanceService.protocol }}
|
||||
targetPort: {{ .Values.custom.configuration.instanceService.targetPort }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.createConfigurationService }}
|
||||
configurationServiceSpec:
|
||||
type: {{ .Values.custom.configuration.configurationService.type }}
|
||||
ports:
|
||||
- name: {{ .Values.custom.configuration.configurationService.name }}
|
||||
port: {{ .Values.custom.configuration.configurationService.port }}
|
||||
protocol: {{ .Values.custom.configuration.configurationService.protocol }}
|
||||
targetPort: {{ .Values.custom.configuration.configurationService.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.custom.configuration.brokerProperties }}
|
||||
brokerProperties:
|
||||
{{- range $key, $val := .Values.custom.configuration.brokerProperties }}
|
||||
{{- $key | nindent 4 }}: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
brokerProperties: {}
|
||||
{{- end }}
|
||||
capacity: {{ .Values.custom.configuration.capacity }}
|
||||
{{- end }}
|
66
akri-chart/templates/custom-discovery-handler.yaml
Normal file
66
akri-chart/templates/custom-discovery-handler.yaml
Normal file
@ -0,0 +1,66 @@
|
||||
{{- if .Values.custom.discovery.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ printf "%s-daemonset" .Values.custom.discovery.name }}
|
||||
{{- if .Values.custom.discovery.discoveryHandlerName }}
|
||||
annotations:
|
||||
akri.sh/discoveryHandlerName: {{ .Values.custom.discovery.discoveryHandlerName }}
|
||||
{{- end }}
|
||||
labels: {{- include "akri.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/name: {{ .Values.custom.discovery.name }}
|
||||
app.kubernetes.io/component: discovery-handler
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "akri.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/name: {{ .Values.custom.discovery.name }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "akri.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/name: {{ .Values.custom.discovery.name }}
|
||||
app.kubernetes.io/component: discovery-handler
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.custom.discovery.name }}
|
||||
image: {{ printf "%s:%s" (required "A custom.discovery.image.repository is required." .Values.custom.discovery.image.repository) .Values.custom.discovery.image.tag | quote }}
|
||||
{{- with .Values.custom.discovery.image.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end}}
|
||||
resources:
|
||||
requests:
|
||||
memory: {{ .Values.custom.discovery.resources.memoryRequest }}
|
||||
cpu: {{ .Values.custom.discovery.resources.cpuRequest }}
|
||||
limits:
|
||||
memory: {{ .Values.custom.discovery.resources.memoryLimit }}
|
||||
cpu: {{ .Values.custom.discovery.resources.cpuLimit }}
|
||||
{{- if .Values.custom.discovery.useNetworkConnection }}
|
||||
ports:
|
||||
- name: discovery
|
||||
containerPort: {{ .Values.custom.discovery.port }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if .Values.custom.discovery.useNetworkConnection }}
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
{{- end }}
|
||||
- name: DISCOVERY_HANDLERS_DIRECTORY
|
||||
value: /var/lib/akri
|
||||
volumeMounts:
|
||||
- name: discovery-handlers
|
||||
mountPath: /var/lib/akri
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
nodeSelector:
|
||||
"kubernetes.io/os": linux
|
||||
{{- if .Values.custom.discovery.nodeSelectors }}
|
||||
{{- toYaml .Values.custom.discovery.nodeSelectors | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: discovery-handlers
|
||||
hostPath:
|
||||
path: {{ .Values.agent.host.discoveryHandlers }}
|
||||
{{- end }}
|
154
akri-chart/templates/debug-echo-configuration.yaml
Normal file
154
akri-chart/templates/debug-echo-configuration.yaml
Normal file
@ -0,0 +1,154 @@
|
||||
{{- if .Values.debugEcho.configuration.enabled }}
|
||||
apiVersion: {{ printf "%s/%s" .Values.crds.group .Values.crds.version }}
|
||||
kind: Configuration
|
||||
metadata:
|
||||
name: {{ .Values.debugEcho.configuration.name }}
|
||||
spec:
|
||||
discoveryHandler:
|
||||
name: debugEcho
|
||||
discoveryDetails: |+
|
||||
{{- if .Values.debugEcho.configuration.discoveryDetails.descriptions }}
|
||||
descriptions:
|
||||
{{- toYaml .Values.debugEcho.configuration.discoveryDetails.descriptions | nindent 6 }}
|
||||
{{- else }}
|
||||
descriptions: []
|
||||
{{- end }}
|
||||
{{- if or .Values.debugEcho.configuration.brokerPod.image.repository .Values.debugEcho.configuration.brokerJob.image.repository }}
|
||||
{{- /* Only add brokerSpec if a broker image is provided */}}
|
||||
brokerSpec:
|
||||
{{- if .Values.debugEcho.configuration.brokerPod.image.repository }}
|
||||
brokerPodSpec:
|
||||
containers:
|
||||
- name: {{ .Values.debugEcho.configuration.name }}-broker
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.configuration.brokerPod.image.repository .Values.debugEcho.configuration.brokerPod.image.tag | quote }}
|
||||
{{- with .Values.debugEcho.configuration.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.brokerPod.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.debugEcho.configuration.brokerPod.env }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.brokerPod.envFrom }}
|
||||
envFrom:
|
||||
{{- range $val := .Values.debugEcho.configuration.brokerPod.envFrom.secretRef }}
|
||||
- secretRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- range $val := .Values.debugEcho.configuration.brokerPod.envFrom.configMapRef }}
|
||||
- configMapRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.debugEcho.configuration.brokerPod.resources.memoryRequest }}
|
||||
cpu: {{ .Values.debugEcho.configuration.brokerPod.resources.cpuRequest }}
|
||||
limits:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.debugEcho.configuration.brokerPod.resources.memoryLimit }}
|
||||
cpu: {{ .Values.debugEcho.configuration.brokerPod.resources.cpuLimit }}
|
||||
{{- with .Values.debugEcho.configuration.brokerPod.volumeMounts}}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.debugEcho.configuration.brokerPod.volumes}}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
brokerJobSpec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ .Values.debugEcho.configuration.name }}-broker
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.configuration.brokerJob.image.repository .Values.debugEcho.configuration.brokerPod.image.tag | quote }}
|
||||
{{- if .Values.debugEcho.configuration.brokerJob.command }}
|
||||
command:
|
||||
{{- toYaml .Values.debugEcho.configuration.brokerJob.command | nindent 14 }}
|
||||
{{- end }}
|
||||
{{- with .Values.debugEcho.configuration.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.brokerJob.env }}
|
||||
env:
|
||||
{{- range $key, $val := .Values.debugEcho.configuration.brokerJob.env }}
|
||||
- name: {{ $key }}
|
||||
value: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.brokerJob.envFrom }}
|
||||
envFrom:
|
||||
{{- range $val := .Values.debugEcho.configuration.brokerJob.envFrom.secretRef }}
|
||||
- secretRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- range $val := .Values.debugEcho.configuration.brokerJob.envFrom.configMapRef }}
|
||||
- configMapRef:
|
||||
name: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.debugEcho.configuration.brokerJob.resources.memoryRequest }}
|
||||
cpu: {{ .Values.debugEcho.configuration.brokerJob.resources.cpuRequest }}
|
||||
limits:
|
||||
{{`"{{PLACEHOLDER}}"`}} : "1"
|
||||
memory: {{ .Values.debugEcho.configuration.brokerJob.resources.memoryLimit }}
|
||||
cpu: {{ .Values.debugEcho.configuration.brokerJob.resources.cpuLimit }}
|
||||
{{- with .Values.debugEcho.configuration.brokerJob.volumeMounts}}
|
||||
volumeMounts:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.debugEcho.configuration.brokerJob.volumes}}
|
||||
volumes:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
restartPolicy: {{ .Values.debugEcho.configuration.brokerJob.restartPolicy }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
backoffLimit: {{ .Values.debugEcho.configuration.brokerJob.backoffLimit }}
|
||||
parallelism: {{ .Values.debugEcho.configuration.brokerJob.parallelism }}
|
||||
completions: {{ .Values.debugEcho.configuration.brokerJob.completions }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if or .Values.debugEcho.configuration.brokerPod.image.repository .Values.debugEcho.configuration.brokerJob.image.repository }}
|
||||
{{- if .Values.debugEcho.configuration.createInstanceServices }}
|
||||
instanceServiceSpec:
|
||||
type: {{ .Values.debugEcho.configuration.instanceService.type }}
|
||||
ports:
|
||||
- name: {{ .Values.debugEcho.configuration.instanceService.name }}
|
||||
port: {{ .Values.debugEcho.configuration.instanceService.port }}
|
||||
protocol: {{ .Values.debugEcho.configuration.instanceService.protocol }}
|
||||
targetPort: {{ .Values.debugEcho.configuration.instanceService.targetPort }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.createConfigurationService }}
|
||||
configurationServiceSpec:
|
||||
type: {{ .Values.debugEcho.configuration.configurationService.type }}
|
||||
ports:
|
||||
- name: {{ .Values.debugEcho.configuration.configurationService.name }}
|
||||
port: {{ .Values.debugEcho.configuration.configurationService.port }}
|
||||
protocol: {{ .Values.debugEcho.configuration.configurationService.protocol }}
|
||||
targetPort: {{ .Values.debugEcho.configuration.configurationService.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.debugEcho.configuration.brokerProperties }}
|
||||
brokerProperties:
|
||||
{{- range $key, $val := .Values.debugEcho.configuration.brokerProperties }}
|
||||
{{- $key | nindent 4 }}: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
brokerProperties: {}
|
||||
{{- end }}
|
||||
capacity: {{ .Values.debugEcho.configuration.capacity }}
|
||||
{{- end }}
|
78
akri-chart/templates/debug-echo-discovery-handler.yaml
Normal file
78
akri-chart/templates/debug-echo-discovery-handler.yaml
Normal file
@ -0,0 +1,78 @@
|
||||
{{- if .Values.debugEcho.discovery.enabled }}
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: akri-debug-echo-discovery-daemonset
|
||||
annotations:
|
||||
akri.sh/discoveryHandlerName: debugEcho
|
||||
labels: {{- include "akri.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/name: akri-debug-echo-discovery
|
||||
app.kubernetes.io/component: discovery-handler
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "akri.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/name: akri-debug-echo-discovery
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "akri.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/name: akri-debug-echo-discovery
|
||||
app.kubernetes.io/component: discovery-handler
|
||||
spec:
|
||||
containers:
|
||||
- name: akri-debug-echo-discovery
|
||||
{{- if .Values.useDevelopmentContainers }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.discovery.image.repository (default "latest-dev" .Values.debugEcho.discovery.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.discovery.image.repository (default (printf "v%s-dev" .Chart.AppVersion) .Values.debugEcho.discovery.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- if .Values.useLatestContainers }}
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.discovery.image.repository (default "latest" .Values.debugEcho.discovery.image.tag) | quote }}
|
||||
{{- else }}
|
||||
image: {{ printf "%s:%s" .Values.debugEcho.discovery.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.debugEcho.discovery.image.tag) | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.debugEcho.discovery.image.pullPolicy }}
|
||||
imagePullPolicy: {{ . }}
|
||||
{{- end}}
|
||||
resources:
|
||||
requests:
|
||||
memory: {{ .Values.debugEcho.discovery.resources.memoryRequest }}
|
||||
cpu: {{ .Values.debugEcho.discovery.resources.cpuRequest }}
|
||||
limits:
|
||||
memory: {{ .Values.debugEcho.discovery.resources.memoryLimit }}
|
||||
cpu: {{ .Values.debugEcho.discovery.resources.cpuLimit }}
|
||||
{{- if .Values.debugEcho.discovery.useNetworkConnection }}
|
||||
ports:
|
||||
- name: discovery
|
||||
containerPort: {{ .Values.debugEcho.discovery.port }}
|
||||
|