From f71df5b8612bde1dfc752aa0db1e8e1fa91376d2 Mon Sep 17 00:00:00 2001 From: leoporoli Date: Thu, 11 Jul 2024 09:04:25 -0300 Subject: [PATCH] refactor: remove Kardinal Manager yaml file (#33) We want users and devs deploying Kardinal Manager with the Kardinal CLI command instead of using kubectl, so we are removing the YAML file for Kardinal Manager to reinforce this, otherwise we will have conflicts while deploying Kardinal Manager if there are existing resources deployed with kubectl. --- README.md | 33 ++++++--------- kardinal-manager/deployment/k8s.yaml | 62 ---------------------------- 2 files changed, 13 insertions(+), 82 deletions(-) delete mode 100644 kardinal-manager/deployment/k8s.yaml diff --git a/README.md b/README.md index 621b9724..0acfca5f 100644 --- a/README.md +++ b/README.md @@ -324,39 +324,32 @@ minikube tunnel ## Deploying Kardinal Manager to local cluster -Configure it by setting the following environment variables: +You can use tilt deploy and keeping the image hot-reloading: ```bash -KARDINAL_MANAGER_CLUSTER_CONFIG_ENDPOINT=http://localhost:8080/tenant/{36e22127-3c9e-4110-aa83-af552cd94b88}/cluster-resources -KARDINAL_MANAGER_FETCHER_JOB_DURATION_SECONDS=10 -``` - -or in the `kardinal-manager/deployment/k8s.yaml`: - -```yaml - env: - - name: KARDINAL_MANAGER_CLUSTER_CONFIG_ENDPOINT - # This is valid for reaching out the Kardinal Kontrol if this is running on the host - value: "http://localhost:8080/tenant/36e22127-3c9e-4110-aa83-af552cd94b88/cluster-resources" - - name: KARDINAL_MANAGER_FETCHER_JOB_DURATION_SECONDS - value: "10" +tilt up ``` -NOTE: you can get your tenant UUID by running any CLI command +Or you can use the Kardinal CLI to deploy it -You can use tilt deploy and keeping the image hot-reloading: +Option 1: Using Kloud Kardinal Kontrol ```bash -tilt up +# the Kloud Kontrol will always pull the latest image version from Docker Hub +kardinal manager deploy kloud-kontrol ``` -Or manually build it: +Option 2: Using the local Kardinal Kontrol with Minikube (better for the dev flow) ```bash -# First set the docker context to minikube +# First build the image + +# set the docker context to minikube eval $(minikube docker-env) docker load < $(nix build ./#kardinal-manager-container --no-link --print-out-paths) -kubectl apply -f kardinal-manager/deployment + +# the local-minikube Kontrol will use the image builded +kardinal manager deploy local-minikube ``` ## Deploying Redis Overlay Service to local cluster diff --git a/kardinal-manager/deployment/k8s.yaml b/kardinal-manager/deployment/k8s.yaml deleted file mode 100644 index 52b11e6f..00000000 --- a/kardinal-manager/deployment/k8s.yaml +++ /dev/null @@ -1,62 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: kardinal-manager - namespace: default - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: kardinal-manager-role -rules: - - apiGroups: ["*"] - resources: ["namespaces", "pods", "services", "deployments", "virtualservices", "workloadgroups", "workloadentries", "sidecars", "serviceentries", "gateways", "envoyfilters", "destinationrules"] - verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] - ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: kardinal-manager-binding -subjects: - - kind: ServiceAccount - name: kardinal-manager - namespace: default -roleRef: - kind: ClusterRole - name: kardinal-manager-role - apiGroup: rbac.authorization.k8s.io - ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: kardinal-manager - namespace: default -spec: - replicas: 1 - selector: - matchLabels: - app: kardinal-manager - template: - metadata: - labels: - app: kardinal-manager - spec: - serviceAccountName: kardinal-manager - containers: - - name: kardinal-manager - image: kurtosistech/kardinal-manager:latest - # TODO: Policy to local dev only - figure a way to remove it - imagePullPolicy: Never - env: - - name: KUBERNETES_SERVICE_HOST - value: "kubernetes.default.svc" - - name: KUBERNETES_SERVICE_PORT - value: "443" - - name: KARDINAL_MANAGER_CLUSTER_CONFIG_ENDPOINT - # This is valid for reaching out the Kardinal Kontrol if this is running on the host - value: "http://host.minikube.internal:8080/tenant/58d33536-3c9e-4110-aa83-bf112ae94a49/cluster-resources" - - name: KARDINAL_MANAGER_FETCHER_JOB_DURATION_SECONDS - value: "10"