Skip to content

Commit

Permalink
Add Discovery addons and tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
  • Loading branch information
mansam committed Jun 21, 2024
1 parent c5d61de commit 157f89b
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ jobs:
image: konveyor/tackle-keycloak-init
- repo: konveyor/kantra
image: konveyor/kantra
- repo: konveyor/tackle2-addon-discovery
image: konveyor/tackle2-addon-discovery
fail-fast: true
steps:
- uses: konveyor/release-tools/create-release@main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ metadata:
categories: Modernization & Migration
certified: "false"
containerImage: quay.io/konveyor/tackle2-operator:latest
createdAt: "2024-06-17T20:49:11Z"
createdAt: "2024-06-20T20:30:45Z"
description: Konveyor is an open-source application modernization platform that
helps organizations safely and predictably modernize applications to Kubernetes
at scale.
Expand Down Expand Up @@ -212,6 +212,8 @@ spec:
value: quay.io/konveyor/generic-external-provider:latest
- name: RELATED_IMAGE_PROVIDER_JAVA
value: quay.io/konveyor/java-external-provider:latest
- name: RELATED_IMAGE_ADDON_LANGUAGE_DISCOVERY
value: quay.io/konveyor/tackle2-addon-discovery:latest
image: quay.io/konveyor/tackle2-operator:latest
imagePullPolicy: Always
livenessProbe:
Expand Down Expand Up @@ -404,4 +406,6 @@ spec:
name: provider-generic
- image: quay.io/konveyor/java-external-provider:latest
name: provider-java
- image: quay.io/konveyor/tackle2-addon-discovery:latest
name: addon-language-discovery
version: 99.0.0
2 changes: 2 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
value: {{ .Values.images.provider_generic }}
- name: RELATED_IMAGE_PROVIDER_JAVA
value: {{ .Values.images.provider_java }}
- name: RELATED_IMAGE_ADDON_LANGUAGE_DISCOVERY
value: {{ .Values.images.addon_language_discovery }}
name: tackle-operator
image: {{ .Values.images.operator }}
imagePullPolicy: Always
Expand Down
1 change: 1 addition & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ images:
addon_analyzer: quay.io/konveyor/tackle2-addon-analyzer:latest
provider_generic: quay.io/konveyor/generic-external-provider:latest
provider_java: quay.io/konveyor/java-external-provider:latest
addon_language_discovery: quay.io/konveyor/tackle2-addon-discovery:latest
18 changes: 18 additions & 0 deletions roles/tackle/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,24 @@ provider_java_image_fqin: "{{ lookup('env', 'RELATED_IMAGE_PROVIDER_JAVA') }}"
provider_java_name: "java"
provider_java_service_name: "{{ app_name }}-{{ provider_java_name }}-{{ analyzer_component_name }}"

language_discovery_fqin: "{{ lookup('env', 'RELATED_IMAGE_ADDON_LANGUAGE_DISCOVERY') }}"
language_discovery_name: "language-discovery"
language_discovery_component_name: "addon"
language_discovery_service_name: "{{ app_name }}-{{ language_discovery_name }}-{{ language_discovery_component_name }}"
language_discovery_container_limits_cpu: "500m"
language_discovery_container_limits_memory: "512Mi"
language_discovery_container_requests_cpu: "500m"
language_discovery_container_requests_memory: "512Mi"

tech_discovery_fqin: "{{ analyzer_fqin }}"
tech_discovery_name: "tech-discovery"
tech_discovery_component_name: "addon"
tech_discovery_service_name: "{{ app_name }}-{{ tech_discovery_name }}-{{ tech_discovery_component_name }}"
tech_discovery_container_limits_cpu: "{{ analyzer_container_limits_cpu }}"
tech_discovery_container_limits_memory: "{{ analyzer_container_limits_memory }}"
tech_discovery_container_requests_cpu: "{{ analyzer_container_requests_cpu }}"
tech_discovery_container_requests_memory: "{{ analyzer_container_requests_memory }}"

cache_name: "cache"
cache_data_volume_size: "100Gi"
cache_data_volume_name: "{{ app_name }}-{{ cache_name }}-data"
Expand Down
10 changes: 10 additions & 0 deletions roles/tackle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,16 @@
state: present
definition: "{{ lookup('template', 'customresource-addon-analyzer.yml.j2') }}"

- name: "Create Language Discovery Addon CR"
k8s:
state: present
definition: "{{ lookup('template', 'customresource-addon-language-discovery.yml.j2') }}"

- name: "Create Tech Discovery Addon CR"
k8s:
state: present
definition: "{{ lookup('template', 'customresource-addon-tech-discovery.yml.j2') }}"

- name: "Create Network Policy"
k8s:
state: present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ metadata:
name: {{ analyzer_name }}
spec:
priority: 10
dependencies: [ {{ language_discovery_name }} ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
kind: Addon
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ language_discovery_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ language_discovery_service_name }}
app.kubernetes.io/component: {{ language_discovery_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
task: {{ language_discovery_name }}
container:
name: {{ language_discovery_component_name }}
image: {{ language_discovery_fqin }}
imagePullPolicy: {{ image_pull_policy }}
resources:
limits:
cpu: {{ language_discovery_container_limits_cpu }}
memory: {{ language_discovery_container_limits_memory }}
requests:
cpu: {{ language_discovery_container_requests_cpu }}
memory: {{ language_discovery_container_requests_memory }}
---
kind: Task
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
namespace: {{ app_namespace }}
name: {{ language_discovery_name }}
labels:
konveyor.io/discovery: "language"
spec:
priority: 10
data:
source: language-discovery
124 changes: 124 additions & 0 deletions roles/tackle/templates/customresource-addon-tech-discovery.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
kind: Addon
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ tech_discovery_service_name }}
app.kubernetes.io/component: {{ tech_discovery_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
task: {{ tech_discovery_name }}
container:
name: {{ tech_discovery_component_name }}
image: {{ tech_discovery_fqin }}
imagePullPolicy: {{ image_pull_policy }}
resources:
limits:
cpu: {{ tech_discovery_container_limits_cpu }}
memory: {{ tech_discovery_container_limits_memory }}
requests:
cpu: {{ tech_discovery_container_requests_cpu }}
memory: {{ tech_discovery_container_requests_memory }}
---
kind: Extension
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_provider_java_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ provider_java_service_name }}
app.kubernetes.io/component: {{ provider_java_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
addon: {{ tech_discovery_name }}
selector: tag:Language=Java || !tag:Language
container:
name: {{ provider_java_name }}
image: {{ provider_java_image_fqin }}
imagePullPolicy: {{ image_pull_policy }}
args:
- --port
- $(PORT)
env:
- name: PORT
value: ${seq:8000}
resources:
limits:
cpu: {{ provider_java_container_limits_cpu }}
memory: {{ provider_java_container_limits_memory }}
requests:
cpu: {{ provider_java_container_requests_cpu }}
memory: {{ provider_java_container_requests_memory }}
metadata:
resources:
- selector: identity:kind=maven
fields:
- name: settings
path: /shared/creds/maven/settings.xml
key: maven.settings.path
provider:
name: {{ provider_java_name }}
address: localhost:$(PORT)
initConfig:
- providerSpecificConfig:
bundles: /jdtls/java-analyzer-bundle/java-analyzer-bundle.core/target/java-analyzer-bundle.core-1.0.0-SNAPSHOT.jar
depOpenSourceLabelsFile: /usr/local/etc/maven.default.index
lspServerPath: /jdtls/bin/jdtls
mavenSettingsFile: $(maven.settings.path)
---
kind: Extension
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
name: {{ tech_discovery_provider_generic_name }}
namespace: {{ app_namespace }}
labels:
app.kubernetes.io/name: {{ provider_generic_service_name }}
app.kubernetes.io/component: {{ provider_generic_component_name }}
app.kubernetes.io/part-of: {{ app_name }}
spec:
addon: {{ tech_discovery_name }}
selector: tag:Language=Golang || tag:Language=Python
container:
name: {{ provider_generic_name }}
image: {{ provider_generic_image_fqin }}
imagePullPolicy: {{ image_pull_policy }}
args:
- --port
- $(PORT)
env:
- name: PORT
value: ${seq:8000}
resources:
limits:
cpu: {{ provider_generic_container_limits_cpu }}
memory: {{ provider_generic_container_limits_memory }}
requests:
cpu: {{ provider_generic_container_requests_cpu }}
memory: {{ provider_generic_container_requests_memory }}
metadata:
provider:
name: {{ provider_generic_name }}
address: localhost:$(PORT)
initConfig:
---
kind: Task
apiVersion: tackle.konveyor.io/v1alpha2
metadata:
namespace: {{ app_namespace }}
name: {{ tech_discovery_name }}
labels:
konveyor.io/discovery: "technology"
spec:
priority: 10
dependencies: [ {{ language_discovery_name }} ]
data:
mode:
discovery: true
tagger:
enabled: true
source: tech-discovery
rules:
labels:
included: ["discovery"]

0 comments on commit 157f89b

Please sign in to comment.