diff --git a/bundle/manifests/konveyor-operator.clusterserviceversion.yaml b/bundle/manifests/konveyor-operator.clusterserviceversion.yaml index d28ec1d..16bb654 100644 --- a/bundle/manifests/konveyor-operator.clusterserviceversion.yaml +++ b/bundle/manifests/konveyor-operator.clusterserviceversion.yaml @@ -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. @@ -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: @@ -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 diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index a2ca127..ac0029f 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -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 diff --git a/helm/values.yaml b/helm/values.yaml index 97fa64e..6852808 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -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 \ No newline at end of file diff --git a/roles/tackle/defaults/main.yml b/roles/tackle/defaults/main.yml index c14ae95..1003fc2 100644 --- a/roles/tackle/defaults/main.yml +++ b/roles/tackle/defaults/main.yml @@ -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" diff --git a/roles/tackle/tasks/main.yml b/roles/tackle/tasks/main.yml index bb5093a..a4a2ccb 100644 --- a/roles/tackle/tasks/main.yml +++ b/roles/tackle/tasks/main.yml @@ -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 diff --git a/roles/tackle/templates/customresource-addon-analyzer.yml.j2 b/roles/tackle/templates/customresource-addon-analyzer.yml.j2 index 53c635f..900ce1b 100644 --- a/roles/tackle/templates/customresource-addon-analyzer.yml.j2 +++ b/roles/tackle/templates/customresource-addon-analyzer.yml.j2 @@ -110,3 +110,4 @@ metadata: name: {{ analyzer_name }} spec: priority: 10 + dependencies: [ {{ language_discovery_name }} ] diff --git a/roles/tackle/templates/customresource-addon-language-discovery.yml.j2 b/roles/tackle/templates/customresource-addon-language-discovery.yml.j2 new file mode 100644 index 0000000..0d585e8 --- /dev/null +++ b/roles/tackle/templates/customresource-addon-language-discovery.yml.j2 @@ -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 \ No newline at end of file diff --git a/roles/tackle/templates/customresource-addon-tech-discovery.yml.j2 b/roles/tackle/templates/customresource-addon-tech-discovery.yml.j2 new file mode 100644 index 0000000..9c64a66 --- /dev/null +++ b/roles/tackle/templates/customresource-addon-tech-discovery.yml.j2 @@ -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"]