Skip to content

Commit

Permalink
Merge pull request #78 from port-labs/PORT-5363-ui-for-the-kubernetes…
Browse files Browse the repository at this point in the history
…-exporter-moving-the-config-into-port

k8s install script
  • Loading branch information
yairsimantov20 authored Dec 31, 2023
2 parents e9a2630 + e1a44a8 commit 14eb147
Show file tree
Hide file tree
Showing 9 changed files with 570 additions and 506 deletions.
16 changes: 8 additions & 8 deletions kubernetes/argo_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
port:
entity:
mappings:
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + "{CLUSTER_NAME}"
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
blueprint: '"argocdApp"'
title: .metadata.name
properties:
Expand All @@ -14,32 +14,32 @@
gitPath: .spec.source.path // null
gitRev: .status.sync.revision // null
relations:
workload: '(.spec.destination.namespace as $namespace | .status.resources | map(select(.kind == "Deployment" or .kind == "StatefulSet" or .kind == "DaemonSet" or .kind == "Rollout" )) | .[] | .name + "-" + .kind + "-" + $namespace + "-{CLUSTER_NAME}") // []'
argocdProject: .spec.project + "-" + .metadata.namespace + "-" + "{CLUSTER_NAME}"
destinationNamespace: .spec.destination.namespace + "-" + "{CLUSTER_NAME}"
workload: '(.spec.destination.namespace as $namespace | .status.resources | map(select(.kind == "Deployment" or .kind == "StatefulSet" or .kind == "DaemonSet" or .kind == "Rollout" )) | .[] | .name + "-" + .kind + "-" + $namespace + "-" + env.CLUSTER_NAME) // []'
argocdProject: .spec.project + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
destinationNamespace: .spec.destination.namespace + "-" + env.CLUSTER_NAME

- kind: argoproj.io/v1alpha1/appproject
port:
entity:
mappings:
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + "{CLUSTER_NAME}"
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
title: .metadata.name
blueprint: '"argocdProject"'
properties:
relations:
Namespace: .metadata.namespace + "-" + "{CLUSTER_NAME}"
Namespace: .metadata.namespace + "-" + env.CLUSTER_NAME

- kind: v1/secrets
selector:
query: '.metadata.labels // {} | contains({ "argocd.argoproj.io/secret-type": "repository" })'
port:
entity:
mappings:
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + "{CLUSTER_NAME}"
- identifier: .metadata.name + "-" + .metadata.namespace + "-" + env.CLUSTER_NAME
title: .metadata.name
blueprint: '"argocdRepo"'
properties:
repoUrl: .data.url | @base64d
repoType: .data.type | @base64d
relations:
Namespace: .metadata.namespace + "-" + "{CLUSTER_NAME}"
Namespace: .metadata.namespace + "-" + env.CLUSTER_NAME
4 changes: 2 additions & 2 deletions kubernetes/argo_rollouts_config.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
port:
entity:
mappings:
- identifier: .metadata.name + "-Rollout-" + .metadata.namespace + "-" + "{CLUSTER_NAME}"
- identifier: .metadata.name + "-Rollout-" + .metadata.namespace + "-" + env.CLUSTER_NAME
title: .metadata.name
blueprint: '"workload"'
properties:
Expand All @@ -21,4 +21,4 @@
containers: (.spec.template.spec.containers | map({name, image, resources}))
isHealthy: if .spec.replicas == .status.availableReplicas then "Healthy" else "Unhealthy" end
relations:
Namespace: .metadata.namespace + "-" + "{CLUSTER_NAME}"
Namespace: .metadata.namespace + "-" + env.CLUSTER_NAME
Loading

0 comments on commit 14eb147

Please sign in to comment.