Skip to content

Commit

Permalink
Remove AWS visibility/IAMLive from network-mapper (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
orishavit authored Jan 30, 2025
1 parent e821b44 commit 6884a76
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 383 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,44 +72,6 @@ jobs:
build-args: |
"VERSION=0.0.${{ github.run_id }}"
build-iamlive:
name: Build (IAMLive)
runs-on: ubuntu-latest
steps:
- name: Checkout IAMLive fork
uses: actions/checkout@v2
with:
repository: otterize/iamlive
path: iamlive
ref: main

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
driver-opts: network=host

- name: Login to GCR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: _json_key_base64
password: ${{ secrets.B64_GCLOUD_SERVICE_ACCOUNT_JSON }}

- name: Test & Build production image
uses: docker/build-push-action@v2
with:
context: iamlive/
file: iamlive/Dockerfile
tags: ${{ env.REGISTRY }}/iamlive:${{ github.sha }}
push: true
network: host
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
"VERSION=0.0.${{ github.run_id }}"
e2e-test:
uses: ./.github/workflows/e2e-test.yaml
name: Trigger e2e tests
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout IAMLive fork
uses: actions/checkout@v2
with:
repository: otterize/iamlive
path: iamlive
ref: main

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
Expand Down Expand Up @@ -85,19 +78,6 @@ jobs:
"VERSION=${{ github.ref_name }}"
"SOURCE_IMAGE=${{ env.REGISTRY }}/kafka-watcher:${{ github.sha }}"
- name: Push to Docker Hub - IAMLive
uses: docker/build-push-action@v2
with:
context: ./iamlive/
file: ./iamlive/Dockerfile
tags: otterize/network-mapper-iamlive:latest,otterize/network-mapper-iamlive:${{ github.ref_name }}
push: true
network: host
platforms: linux/amd64,linux/arm64
build-args: |
"VERSION=${{ github.ref_name }}"
"SOURCE_IMAGE=${{ env.REGISTRY }}/iamlive:${{ github.sha }}"
commit-latest-build-tag-to-helm-chart:
name: Commit Latest Build Tag
Expand Down
44 changes: 0 additions & 44 deletions src/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 0 additions & 51 deletions src/mapper/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ import (
"github.com/bombsimon/logrusr/v3"
"github.com/labstack/echo-contrib/echoprometheus"
otterizev2alpha1 "github.com/otterize/intents-operator/src/operator/api/v2alpha1"
mutatingwebhookconfiguration "github.com/otterize/intents-operator/src/operator/controllers/mutating_webhook_controller"
"github.com/otterize/intents-operator/src/shared"
"github.com/otterize/intents-operator/src/shared/clusterutils"
"github.com/otterize/intents-operator/src/shared/errors"
"github.com/otterize/intents-operator/src/shared/filters"
"github.com/otterize/intents-operator/src/shared/telemetries/componentinfo"
"github.com/otterize/intents-operator/src/shared/telemetries/errorreporter"
istiowatcher "github.com/otterize/network-mapper/src/istio-watcher/pkg/watcher"
Expand All @@ -20,8 +18,6 @@ import (
"github.com/otterize/network-mapper/src/mapper/pkg/dnsintentspublisher"
"github.com/otterize/network-mapper/src/mapper/pkg/externaltrafficholder"
"github.com/otterize/network-mapper/src/mapper/pkg/incomingtrafficholder"
"github.com/otterize/network-mapper/src/mapper/pkg/mapperwebhooks"
"github.com/otterize/network-mapper/src/mapper/pkg/pod_webhook"
"github.com/otterize/network-mapper/src/mapper/pkg/resourcevisibility"
"github.com/otterize/network-mapper/src/shared/echologrus"
"golang.org/x/sync/errgroup"
Expand All @@ -31,8 +27,6 @@ import (
"net/http"
"os"
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
"time"

"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -167,51 +161,6 @@ func main() {
defer cancelFn()
mgr.GetCache().WaitForCacheSync(initCtx) // needed to let the manager initialize before used in intentsHolder

if viper.GetBool(config.EnableAWSVisibilityWebHookKey) {
logrus.Infoln("Registering AWS visibility mutating webhook")

webhookHandler, err := pod_webhook.NewInjectDNSConfigToPodWebhook(
mgr.GetClient(),
admission.NewDecoder(mgr.GetScheme()),
)

if err != nil {
logrus.WithError(err).Panic("unable to create webhook handler")
}

mgr.GetWebhookServer().Register(
"/mutate-v1-pod",
&webhook.Admission{
Handler: webhookHandler,
},
)

if viper.GetBool(config.CreateWebhookCertificateKey) {
// create webhook server certificate
logrus.Infoln("Creating self signing certs for webhook")
podNamespace, err := kubeutils.GetCurrentNamespace()

if err != nil {
logrus.WithError(err).Panic("unable to get pod namespace")
}

certBundle, err :=
mapperwebhooks.GenerateSelfSignedCertificate("otterize-network-mapper-webhook-service", podNamespace)
if err != nil {
logrus.WithError(err).Panic("unable to create self signed certs for webhook")
}
err = mapperwebhooks.WriteCertToFiles(certBundle)
if err != nil {
logrus.WithError(err).Panic("failed writing certs to file system")
}

reconciler := mutatingwebhookconfiguration.NewMutatingWebhookConfigsReconciler(mgr.GetClient(), mgr.GetScheme(), certBundle.CertPem, filters.NetworkMapperLabelPredicate())
if err = reconciler.SetupWithManager(mgr); err != nil {
logrus.WithField("controller", "MutatingWebhookConfigs").WithError(err).Panic("unable to create controller")
}
}
}

intentsHolder := intentsstore.NewIntentsHolder()
externalTrafficIntentsHolder := externaltrafficholder.NewExternalTrafficIntentsHolder()
incomingTrafficIntentsHolder := incomingtrafficholder.NewIncomingTrafficIntentsHolder()
Expand Down
3 changes: 0 additions & 3 deletions src/mapper/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const (
ExternalTrafficCaptureEnabledDefault = true
CreateWebhookCertificateKey = "create-webhook-certificate"
CreateWebhookCertificateDefault = true
EnableAWSVisibilityWebHookKey = "enable-aws-visibility-webhook"
EnableAWSVisibilityWebHookDefault = false
DNSCacheItemsMaxCapacityKey = "dns-cache-items-max-capacity"
DNSCacheItemsMaxCapacityDefault = 100000
DNSClientIntentsUpdateIntervalKey = "dns-client-intents-update-interval"
Expand Down Expand Up @@ -68,7 +66,6 @@ func init() {
viper.SetDefault(OTelMetricKey, OTelMetricDefault)
viper.SetDefault(ExternalTrafficCaptureEnabledKey, ExternalTrafficCaptureEnabledDefault)
viper.SetDefault(CreateWebhookCertificateKey, CreateWebhookCertificateDefault)
viper.SetDefault(EnableAWSVisibilityWebHookKey, EnableAWSVisibilityWebHookDefault)
viper.SetDefault(DNSCacheItemsMaxCapacityKey, DNSCacheItemsMaxCapacityDefault)
viper.SetDefault(DNSClientIntentsUpdateIntervalKey, DNSClientIntentsUpdateIntervalDefault)
viper.SetDefault(DNSClientIntentsUpdateEnabledKey, DNSClientIntentsUpdateEnabledDefault)
Expand Down
Loading

0 comments on commit 6884a76

Please sign in to comment.