From c7006156bf41b6e502ab0c10f4e7e0c2d48adfd3 Mon Sep 17 00:00:00 2001 From: Nick Cardin Date: Mon, 21 Dec 2020 18:59:59 -0500 Subject: [PATCH] Rename K8 pods/services from "flv" to "fluvio" (#591) * delete old files * rename k8 pods and services from flv to fluvio --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- .github/workflows/ci.yml | 2 +- DEVELOPER.md | 2 +- Makefile | 2 +- k8-util/crd/config/gp2-storageclass-spu.yaml | 10 ---- k8-util/crd/config/local-storageclass.yaml | 6 --- .../crd/config/minikube-storageclass-spu.yaml | 6 --- .../config/persistent_volume_claim_spu.yaml | 11 ----- k8-util/crd/init.sh | 8 ---- k8-util/deploy.sh | 6 --- .../fluvio-app/templates/sc-deployment.yaml | 6 +-- .../fluvio-app/templates/sc-internal.yaml | 4 +- .../helm/fluvio-app/templates/sc-public.yaml | 4 +- k8-util/install.sh | 6 --- k8-util/operator-templates/spu-service.yaml | 22 --------- .../spu-stateful-patch.yaml | 3 -- k8-util/operator-templates/spu-stateful.yaml | 46 ------------------- .../spu0-exteranl-service.yaml | 13 ------ .../spu1-exteranl-service.yaml | 13 ------ .../spu2-exteranl-service.yaml | 13 ------ k8-util/sc-deployment/flv_namespace.yaml | 10 ---- .../sc-deployment/flv_set_context_minikube.sh | 3 -- .../sc-deployment/sc-deployment-debug.yaml | 16 ------- k8-util/sc-deployment/sc-internal-dev.yaml | 25 ---------- src/cli/src/profile/sync/k8.rs | 2 +- src/cluster/src/delete.rs | 2 +- src/cluster/src/start/k8.rs | 2 +- src/sc/src/k8/operator/conversion.rs | 4 +- src/sc/src/k8/operator/spg_operator.rs | 10 ++-- tests/runner/src/environment/k8.rs | 2 +- 30 files changed, 23 insertions(+), 240 deletions(-) delete mode 100644 k8-util/crd/config/gp2-storageclass-spu.yaml delete mode 100644 k8-util/crd/config/local-storageclass.yaml delete mode 100644 k8-util/crd/config/minikube-storageclass-spu.yaml delete mode 100644 k8-util/crd/config/persistent_volume_claim_spu.yaml delete mode 100755 k8-util/crd/init.sh delete mode 100755 k8-util/deploy.sh delete mode 100755 k8-util/install.sh delete mode 100644 k8-util/operator-templates/spu-service.yaml delete mode 100644 k8-util/operator-templates/spu-stateful-patch.yaml delete mode 100644 k8-util/operator-templates/spu-stateful.yaml delete mode 100644 k8-util/operator-templates/spu0-exteranl-service.yaml delete mode 100644 k8-util/operator-templates/spu1-exteranl-service.yaml delete mode 100644 k8-util/operator-templates/spu2-exteranl-service.yaml delete mode 100644 k8-util/sc-deployment/flv_namespace.yaml delete mode 100755 k8-util/sc-deployment/flv_set_context_minikube.sh delete mode 100644 k8-util/sc-deployment/sc-deployment-debug.yaml delete mode 100644 k8-util/sc-deployment/sc-internal-dev.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 28c50cc994..e780d70bef 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -31,8 +31,8 @@ Depending on your setup, here's how you can get the logs: - Run `cat /usr/local/var/log/fluvio/spu_log_XXXX.log` for each SPU - E.g. when running 1 SPU, there will be `spu_log_5001.log` - For a Fluvio installation on Minikube: - - Run `kubectl logs flv-sc` for SC logs - - Run `kubectl logs flv-spg-main-X` for each SPU + - Run `kubectl logs fluvio-sc` for SC logs + - Run `kubectl logs fluvio-spg-main-X` for each SPU **Environment (please complete the following information):** - OS: [e.g. Linux, Mac] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e917beb2b..3914c2e8e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -348,7 +348,7 @@ jobs: - run: minikube delete - name: Save logs if: failure() - run: kubectl logs flv-sc > /tmp/flv_sc.log + run: kubectl logs fluvio-sc > /tmp/flv_sc.log - name: Upload logs timeout-minutes: 10 if: failure() diff --git a/DEVELOPER.md b/DEVELOPER.md index 339d97bee5..2a7f0ff9ac 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -208,7 +208,7 @@ error: linker `x86_64-linux-musl-gcc` not found | = note: No such file or directory (os error 2) error: aborting due to previous error -error: could not compile `flv-spu`. +error: could not compile `fluvio-spu`. ``` This is indicative that you need to add standard library for the target platform: diff --git a/Makefile b/Makefile index 59ceb97258..8a1d5a1f68 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ smoke-test-k8-tls-policy: test-clean-up minikube_image --authorization-config-map authorization \ ${SKIP_CHECK} -test-permission-k8: SC_HOST=$(shell kubectl get svc flv-sc-public -o json | jq '.status.loadBalancer.ingress[0].ip' | tr -d '"' ) +test-permission-k8: SC_HOST=$(shell kubectl get svc fluvio-sc-public -o json | jq '.status.loadBalancer.ingress[0].ip' | tr -d '"' ) test-permission-k8: test-permission-user1 smoke-test-k8-tls-root: smoke-test-k8-tls-policy test-permission-k8 diff --git a/k8-util/crd/config/gp2-storageclass-spu.yaml b/k8-util/crd/config/gp2-storageclass-spu.yaml deleted file mode 100644 index d0383d7220..0000000000 --- a/k8-util/crd/config/gp2-storageclass-spu.yaml +++ /dev/null @@ -1,10 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fluvio-spu - annotations: - storageclass.kubernetes.io/is-default-class: "true" -provisioner: kubernetes.io/aws-ebs -parameters: - type: gp2 - fsType: ext4 \ No newline at end of file diff --git a/k8-util/crd/config/local-storageclass.yaml b/k8-util/crd/config/local-storageclass.yaml deleted file mode 100644 index 8c6d31b557..0000000000 --- a/k8-util/crd/config/local-storageclass.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fluvio-spu -provisioner: kubernetes.io/no-provisioner -volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/k8-util/crd/config/minikube-storageclass-spu.yaml b/k8-util/crd/config/minikube-storageclass-spu.yaml deleted file mode 100644 index 019b75557d..0000000000 --- a/k8-util/crd/config/minikube-storageclass-spu.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: fluvio-spu -provisioner: k8s.io/minikube-hostpath -reclaimPolicy: Retain \ No newline at end of file diff --git a/k8-util/crd/config/persistent_volume_claim_spu.yaml b/k8-util/crd/config/persistent_volume_claim_spu.yaml deleted file mode 100644 index 4116148cf6..0000000000 --- a/k8-util/crd/config/persistent_volume_claim_spu.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: fluvio-pvc -spec: - accessModes: - - ReadWriteOnce - storageClassName: gp2 - resources: - requests: - storage: 1Gi \ No newline at end of file diff --git a/k8-util/crd/init.sh b/k8-util/crd/init.sh deleted file mode 100755 index 39fdd52125..0000000000 --- a/k8-util/crd/init.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# initialize CRD -# add CRD -DATA_DIR=$(dirname "$0") -kubectl apply -f ${DATA_DIR}/crd_spu.yaml -kubectl apply -f ${DATA_DIR}/crd_spg.yaml -kubectl apply -f ${DATA_DIR}/crd_partition.yaml -kubectl apply -f ${DATA_DIR}/crd_topic.yaml \ No newline at end of file diff --git a/k8-util/deploy.sh b/k8-util/deploy.sh deleted file mode 100755 index 32be0d9024..0000000000 --- a/k8-util/deploy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -mydir="$(dirname "${0}")" -kubectl apply -f ${mydir}/sc-deployment/sc-deployment.yaml -kubectl apply -f ${mydir}/sc-deployment/sc-internal.yaml -kubectl apply -f ${mydir}/sc-deployment/sc-public.yaml - diff --git a/k8-util/helm/fluvio-app/templates/sc-deployment.yaml b/k8-util/helm/fluvio-app/templates/sc-deployment.yaml index 623684d14b..c1554925c5 100644 --- a/k8-util/helm/fluvio-app/templates/sc-deployment.yaml +++ b/k8-util/helm/fluvio-app/templates/sc-deployment.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Pod metadata: - name: flv-sc + name: fluvio-sc labels: - app: flv-sc + app: fluvio-sc spec: serviceAccountName: {{ .Values.serviceAccount.name }} containers: - - name: flv-sc + - name: fluvio-sc image: {{ .Values.image.registry }}/fluvio:{{ .Values.image.tag | default .Chart.Version }} imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/k8-util/helm/fluvio-app/templates/sc-internal.yaml b/k8-util/helm/fluvio-app/templates/sc-internal.yaml index 841f62ed47..d9d6397b89 100644 --- a/k8-util/helm/fluvio-app/templates/sc-internal.yaml +++ b/k8-util/helm/fluvio-app/templates/sc-internal.yaml @@ -1,10 +1,10 @@ apiVersion: v1 kind: Service metadata: - name: flv-sc-internal + name: fluvio-sc-internal spec: selector: - app: flv-sc + app: fluvio-sc ports: - protocol: TCP port: 9004 diff --git a/k8-util/helm/fluvio-app/templates/sc-public.yaml b/k8-util/helm/fluvio-app/templates/sc-public.yaml index 68fb0f891c..a0c2c6de24 100644 --- a/k8-util/helm/fluvio-app/templates/sc-public.yaml +++ b/k8-util/helm/fluvio-app/templates/sc-public.yaml @@ -1,12 +1,12 @@ apiVersion: v1 kind: Service metadata: - name: flv-sc-public + name: fluvio-sc-public spec: type: LoadBalancer externalTrafficPolicy: Local selector: - app: flv-sc + app: fluvio-sc ports: - protocol: TCP port: 9003 diff --git a/k8-util/install.sh b/k8-util/install.sh deleted file mode 100755 index 017ea16057..0000000000 --- a/k8-util/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -mydir="$(dirname "${0}")" -kubectl create clusterrolebinding cluster-system-anonymous --clusterrole=cluster-admin --user=system:anonymous -# kubectl apply -f ${mydir}/crd/config/minikube-storageclass-spu.yaml -# kubectl apply -f ${mydir}/crd/config/gp2-storageclass-spu.yaml -${mydir}/crd/init.sh diff --git a/k8-util/operator-templates/spu-service.yaml b/k8-util/operator-templates/spu-service.yaml deleted file mode 100644 index 5bd57e6325..0000000000 --- a/k8-util/operator-templates/spu-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: group1 - labels: - app: spu - group: group1 -spec: - ports: - - name: public - protocol: TCP - port: 9005 - targetPort: 9005 - - name: private - protocol: TCP - port: 9006 - targetPort: 9006 - clusterIP: None - type: ClusterIP - selector: - app: spu - group: group1 \ No newline at end of file diff --git a/k8-util/operator-templates/spu-stateful-patch.yaml b/k8-util/operator-templates/spu-stateful-patch.yaml deleted file mode 100644 index dbb0d46c61..0000000000 --- a/k8-util/operator-templates/spu-stateful-patch.yaml +++ /dev/null @@ -1,3 +0,0 @@ -spec: - replicas: 2 - diff --git a/k8-util/operator-templates/spu-stateful.yaml b/k8-util/operator-templates/spu-stateful.yaml deleted file mode 100644 index b06042bcbe..0000000000 --- a/k8-util/operator-templates/spu-stateful.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: group1 -spec: - selector: - matchLabels: - app: spu - group: group1 - serviceName: group1 - replicas: 3 - template: - metadata: - labels: - app: spu - group: group1 - spec: - terminationGracePeriodSeconds: 10 - containers: - - name: spu - image: fluvio/spu:0.1 - ports: - - name: public - containerPort: 9005 - - name: private - containerPort: 9006 - volumeMounts: - - name: data - mountPath: /var/lib/fluvio/data - env: - - name: SPU - valueFrom: - fieldRef: - fieldPath: metadata.name - - name: FLV_SC_PRIVATE_HOST - value: flv-sc-internal.default.svc.cluster.local - volumeClaimTemplates: - - metadata: - name: data - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: fluvio-spu - resources: - requests: - storage: 1Gi - diff --git a/k8-util/operator-templates/spu0-exteranl-service.yaml b/k8-util/operator-templates/spu0-exteranl-service.yaml deleted file mode 100644 index 523090ba3c..0000000000 --- a/k8-util/operator-templates/spu0-exteranl-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: spu-0 -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - statefulset.kubernetes.io/pod-name: spu-0 - ports: - - protocol: TCP - port: 9005 - targetPort: 9005 \ No newline at end of file diff --git a/k8-util/operator-templates/spu1-exteranl-service.yaml b/k8-util/operator-templates/spu1-exteranl-service.yaml deleted file mode 100644 index af04aea84f..0000000000 --- a/k8-util/operator-templates/spu1-exteranl-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: spu-1 -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - statefulset.kubernetes.io/pod-name: spu-1 - ports: - - protocol: TCP - port: 9005 - targetPort: 9005 \ No newline at end of file diff --git a/k8-util/operator-templates/spu2-exteranl-service.yaml b/k8-util/operator-templates/spu2-exteranl-service.yaml deleted file mode 100644 index 2e53523114..0000000000 --- a/k8-util/operator-templates/spu2-exteranl-service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: spu-2 -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - statefulset.kubernetes.io/pod-name: spu-2 - ports: - - protocol: TCP - port: 9005 - targetPort: 9005 \ No newline at end of file diff --git a/k8-util/sc-deployment/flv_namespace.yaml b/k8-util/sc-deployment/flv_namespace.yaml deleted file mode 100644 index 3fa1bf5f9e..0000000000 --- a/k8-util/sc-deployment/flv_namespace.yaml +++ /dev/null @@ -1,10 +0,0 @@ -{ - "apiVersion": "v1", - "kind": "Namespace", - "metadata": { - "name": "flv", - "labels": { - "name": "flv" - } - } -} \ No newline at end of file diff --git a/k8-util/sc-deployment/flv_set_context_minikube.sh b/k8-util/sc-deployment/flv_set_context_minikube.sh deleted file mode 100755 index 2abf5ba3f1..0000000000 --- a/k8-util/sc-deployment/flv_set_context_minikube.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -kubectl config set-context flv --namespace=flv --cluster=mycube --user=minikube -kubectl config use-context flv diff --git a/k8-util/sc-deployment/sc-deployment-debug.yaml b/k8-util/sc-deployment/sc-deployment-debug.yaml deleted file mode 100644 index b97aeb889a..0000000000 --- a/k8-util/sc-deployment/sc-deployment-debug.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: flv-sc - labels: - app: flv-sc -spec: - containers: - - name: flv-sc - image: infinyon/fluvio-sc:0.2.1 - imagePullPolicy: Never - ports: - - containerPort: 9003 - env: - - name: RUST_LOG - value: sc_server=debug \ No newline at end of file diff --git a/k8-util/sc-deployment/sc-internal-dev.yaml b/k8-util/sc-deployment/sc-internal-dev.yaml deleted file mode 100644 index 70d7016011..0000000000 --- a/k8-util/sc-deployment/sc-internal-dev.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: flv-sc-internal -spec: - selector: - app: flv-sc - ports: - - protocol: TCP - port: 9004 - targetPort: 9004 ---- -apiVersion: v1 -kind: Service -metadata: - name: flv-sc-internal -spec: - type: LoadBalancer - externalTrafficPolicy: Local - selector: - app: flv-sc - ports: - - protocol: TCP - port: 9004 - targetPort: 9004 \ No newline at end of file diff --git a/src/cli/src/profile/sync/k8.rs b/src/cli/src/profile/sync/k8.rs index 9db244ba1d..3e11b4ba0e 100644 --- a/src/cli/src/profile/sync/k8.rs +++ b/src/cli/src/profile/sync/k8.rs @@ -118,7 +118,7 @@ pub async fn discover_fluvio_addr(namespace: Option<&str>) -> Result(&InputObjectMeta::named("flv-sc-public", ns)) + .retrieve_item::(&InputObjectMeta::named("fluvio-sc-public", ns)) .await { Ok(svc) => svc, diff --git a/src/cluster/src/delete.rs b/src/cluster/src/delete.rs index d27c634d69..62c83dff7c 100644 --- a/src/cluster/src/delete.rs +++ b/src/cluster/src/delete.rs @@ -135,7 +135,7 @@ impl ClusterUninstaller { let client = load_and_share().map_err(UninstallError::K8ClientError)?; - let sc_pod = InputObjectMeta::named("flv-sc", &self.config.namespace); + let sc_pod = InputObjectMeta::named("fluvio-sc", &self.config.namespace); self.wait_for_delete::(client, &sc_pod).await?; self.cleanup().await?; diff --git a/src/cluster/src/start/k8.rs b/src/cluster/src/start/k8.rs index 02f706464b..ccc2bb247e 100644 --- a/src/cluster/src/start/k8.rs +++ b/src/cluster/src/start/k8.rs @@ -892,7 +892,7 @@ impl ClusterInstaller { let result = self .kube_client - .retrieve_item::(&InputObjectMeta::named("flv-sc-public", ns)) + .retrieve_item::(&InputObjectMeta::named("fluvio-sc-public", ns)) .await; let svc = match result { diff --git a/src/sc/src/k8/operator/conversion.rs b/src/sc/src/k8/operator/conversion.rs index deeb454175..37986a6386 100644 --- a/src/sc/src/k8/operator/conversion.rs +++ b/src/sc/src/k8/operator/conversion.rs @@ -32,7 +32,7 @@ pub fn convert_cluster_to_statefulset( namespace: &str, tls: Option<&TlsConfig>, ) -> InputK8Obj { - let statefulset_name = format!("flv-spg-{}", group_name); + let statefulset_name = format!("fluvio-spg-{}", group_name); let spec = generate_stateful(group_spec, group_name, group_svc_name, namespace, tls); let owner_ref = metadata.make_owner_reference::(); @@ -102,7 +102,7 @@ fn generate_stateful( "spu".to_owned(), "--sc-addr".to_owned(), format!( - "flv-sc-internal.{}.svc.cluster.local:{}", + "fluvio-sc-internal.{}.svc.cluster.local:{}", namespace, SC_PRIVATE_PORT ), "--log-base-dir".to_owned(), diff --git a/src/sc/src/k8/operator/spg_operator.rs b/src/sc/src/k8/operator/spg_operator.rs index 3b0c8316b8..8ea6dd4897 100644 --- a/src/sc/src/k8/operator/spg_operator.rs +++ b/src/sc/src/k8/operator/spg_operator.rs @@ -267,8 +267,8 @@ impl SpgOperator { SpuEndpointTemplate::default_public() }; - let full_group_name = format!("flv-spg-{}", group_name); - let full_spu_name = format!("flv-spg-{}", spu_name); + let full_group_name = format!("fluvio-spg-{}", group_name); + let full_spu_name = format!("fluvio-spg-{}", spu_name); let spu_spec = SpuSpec { id, spu_type: SpuType::Managed, @@ -329,7 +329,7 @@ impl SpgOperator { public_port.target_port = Some(public_port.port); let mut selector = HashMap::new(); - let pod_name = format!("flv-spg-{}", spu_name); + let pod_name = format!("fluvio-spg-{}", spu_name); selector.insert("statefulset.kubernetes.io/pod-name".to_owned(), pod_name); let service_spec = ServiceSpec { @@ -341,7 +341,7 @@ impl SpgOperator { }; let owner_ref = metadata.make_owner_reference::(); - let svc_name = format!("flv-spu-{}", spu_name); + let svc_name = format!("fluvio-spu-{}", spu_name); let input_service: InputK8Obj = InputK8Obj { api_version: ServiceSpec::api_version(), @@ -378,7 +378,7 @@ impl SpgOperator { labels.insert("app".to_owned(), SPU_DEFAULT_NAME.to_owned()); labels.insert("group".to_owned(), spg_name.to_owned()); - let svc_name = format!("flv-spg-{}", spg_name); + let svc_name = format!("fluvio-spg-{}", spg_name); let input_service: InputK8Obj = InputK8Obj { api_version: ServiceSpec::api_version(), diff --git a/tests/runner/src/environment/k8.rs b/tests/runner/src/environment/k8.rs index 5bb0615d6f..bfbbe0ad27 100644 --- a/tests/runner/src/environment/k8.rs +++ b/tests/runner/src/environment/k8.rs @@ -75,7 +75,7 @@ fn print_sc_logs() { let _ = Command::new("kubectl") .arg("logs") - .arg("flv-sc") + .arg("fluvio-sc") .print() .inherit();