Bug Report
Getting error while deploying simple nifi cluster.
{"level":"info","ts":1607960170.9530003,"logger":"cmd","msg":"Operator Version: 0.3.1"}
{"level":"info","ts":1607960170.9530435,"logger":"cmd","msg":"Go Version: go1.14.4"}
{"level":"info","ts":1607960170.95305,"logger":"cmd","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1607960170.9530544,"logger":"cmd","msg":"Version of operator-sdk: v0.18.1"}
{"level":"info","ts":1607960170.9534504,"logger":"leader","msg":"Trying to become the leader."}
I1214 15:36:12.004143 1 request.go:621] Throttling request took 1.034656236s, request: GET:https://10.19.240.1:443/apis/scheduling.k8s.io/v1?timeout=32s
{"level":"info","ts":1607960172.0770478,"logger":"leader","msg":"Found existing lock with my name. I was likely restarted."}
{"level":"info","ts":1607960172.077083,"logger":"leader","msg":"Continuing as the leader."}
time="2020-12-14T15:36:12Z" level=info msg="Writing ready file."
{"level":"info","ts":1607960173.1828148,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":"0.0.0.0:8383"}
{"level":"info","ts":1607960173.1836252,"logger":"cmd","msg":"Registering Components."}
{"level":"info","ts":1607960173.1841946,"logger":"cmd","msg":"Starting manager."}
{"level":"info","ts":1607960173.1846204,"logger":"controller-runtime.manager","msg":"starting metrics server","path":"/metrics"}
{"level":"info","ts":1607960173.184939,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nifiregistryclient-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.1851072,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nifiuser-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.1854053,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nifiparametercontext-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.1857305,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nificlustertask-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.1848311,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nificluster-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.1863284,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nifidataflow-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.2862976,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nifiparametercontext-controller"}
{"level":"info","ts":1607960173.2863894,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nifiparametercontext-controller","worker count":1}
{"level":"info","ts":1607960173.286246,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nifiregistryclient-controller"}
{"level":"info","ts":1607960173.2864208,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nifiregistryclient-controller","worker count":1}
{"level":"info","ts":1607960173.2872162,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nifidataflow-controller"}
{"level":"info","ts":1607960173.2873166,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nifidataflow-controller","worker count":1}
{"level":"info","ts":1607960173.2871523,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nificlustertask-controller"}
{"level":"info","ts":1607960173.2877488,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nificlustertask-controller","worker count":1}
{"level":"info","ts":1607960173.2880201,"logger":"controller_nificlustertask","msg":"Reconciling NifiCluster","Request.Namespace":"nifi","Request.Name":"simplenifi"}
{"level":"info","ts":1607960173.2876427,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nificluster-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.2873774,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nifiuser-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.388855,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nificluster-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.3896422,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nifiuser-controller"}
{"level":"info","ts":1607960173.4897692,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nifiuser-controller","worker count":1}
{"level":"info","ts":1607960173.4897482,"logger":"controller-runtime.controller","msg":"Starting EventSource","controller":"nificluster-controller","source":"kind source: /, Kind="}
{"level":"info","ts":1607960173.5903778,"logger":"controller-runtime.controller","msg":"Starting Controller","controller":"nificluster-controller"}
{"level":"info","ts":1607960173.5907698,"logger":"controller-runtime.controller","msg":"Starting workers","controller":"nificluster-controller","worker count":1}
{"level":"info","ts":1607960173.5911188,"logger":"controller_nificluster","msg":"Reconciling NifiCluster","Request.Namespace":"nifi","Request.Name":"simplenifi"}
{"level":"info","ts":1607960173.604301,"logger":"controller_nificluster","msg":"CR status updated","Request.Namespace":"nifi","Request.Name":"simplenifi","status":"ClusterReconciling"}
E1214 15:36:13.713654 1 runtime.go:78] Observed a panic: runtime.boundsError{x:1, y:1, signed:true, code:0x0} (runtime error: index out of range [1] with length 1)
goroutine 512 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x17436e0, 0xc0006ad1a0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:74 +0xa3
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:48 +0x82
panic(0x17436e0, 0xc0006ad1a0)
/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/Orange-OpenSource/nifikop/pkg/util/zookeeper.GetPortAddress(...)
nifikop/pkg/util/zookeeper/common.go:32
github.com/Orange-OpenSource/nifikop/pkg/resources/nifi.(*Reconciler).pod(0xc000945d40, 0xc000000001, 0xc00037e480, 0xc000850c40, 0x1, 0x1, 0x1abca00, 0xc0008dd000, 0x1, 0x1)
nifikop/pkg/resources/nifi/pod.go:59 +0x35ad
github.com/Orange-OpenSource/nifikop/pkg/resources/nifi.(*Reconciler).Reconcile(0xc000945d40, 0x1abca00, 0xc0008dd000, 0x15ccee0, 0x1a5fb40)
nifikop/pkg/resources/nifi/nifi.go:179 +0xa09
github.com/Orange-OpenSource/nifikop/pkg/controller/nificluster.(*ReconcileNifiCluster).Reconcile(0xc0005fd300, 0xc00060a78c, 0x4, 0xc00060a770, 0xa, 0x0, 0xbfedff7b63399626, 0xc000162ea0, 0xc0000c06c8)
nifikop/pkg/controller/nificluster/nificluster_controller.go:174 +0x452
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002126c0, 0x16ae860, 0xc0009b4a40, 0x17b3c00)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256 +0x161
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002126c0, 0x203000)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232 +0xae
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker(0xc0002126c0)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211 +0x2b
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc0006f0d80)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc0006f0d80, 0x1a7b080, 0xc00076a030, 0xc00000fe01, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xa3
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc0006f0d80, 0x3b9aca00, 0x0, 0x18e5701, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0xe2
k8s.io/apimachinery/pkg/util/wait.Until(0xc0006f0d80, 0x3b9aca00, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4d
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:193 +0x305
panic: runtime error: index out of range [1] with length 1 [recovered]
panic: runtime error: index out of range [1] with length 1
goroutine 512 [running]:
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/runtime/runtime.go:55 +0x105
panic(0x17436e0, 0xc0006ad1a0)
/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/Orange-OpenSource/nifikop/pkg/util/zookeeper.GetPortAddress(...)
nifikop/pkg/util/zookeeper/common.go:32
github.com/Orange-OpenSource/nifikop/pkg/resources/nifi.(*Reconciler).pod(0xc000945d40, 0xc000000001, 0xc00037e480, 0xc000850c40, 0x1, 0x1, 0x1abca00, 0xc0008dd000, 0x1, 0x1)
nifikop/pkg/resources/nifi/pod.go:59 +0x35ad
github.com/Orange-OpenSource/nifikop/pkg/resources/nifi.(*Reconciler).Reconcile(0xc000945d40, 0x1abca00, 0xc0008dd000, 0x15ccee0, 0x1a5fb40)
nifikop/pkg/resources/nifi/nifi.go:179 +0xa09
github.com/Orange-OpenSource/nifikop/pkg/controller/nificluster.(*ReconcileNifiCluster).Reconcile(0xc0005fd300, 0xc00060a78c, 0x4, 0xc00060a770, 0xa, 0x0, 0xbfedff7b63399626, 0xc000162ea0, 0xc0000c06c8)
nifikop/pkg/controller/nificluster/nificluster_controller.go:174 +0x452
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002126c0, 0x16ae860, 0xc0009b4a40, 0x17b3c00)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256 +0x161
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002126c0, 0x203000)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232 +0xae
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker(0xc0002126c0)
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211 +0x2b
k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc0006f0d80)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f
k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc0006f0d80, 0x1a7b080, 0xc00076a030, 0xc00000fe01, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xa3
k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc0006f0d80, 0x3b9aca00, 0x0, 0x18e5701, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0xe2
k8s.io/apimachinery/pkg/util/wait.Until(0xc0006f0d80, 0x3b9aca00, 0xc0001698c0)
nifikop/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4d
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1
nifikop/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:193 +0x305
What did you do?
#! /bin/bash
export GCP_PROJECT=${1}
export GCP_ZONE=us-central1-a
export CLUSTER_NAME=nifi-cluster
gcloud container clusters create $CLUSTER_NAME \
--cluster-version latest \
--machine-type=e2-medium \
--num-nodes 3 \
--zone $GCP_ZONE \
--project $GCP_PROJECT
gcloud container clusters get-credentials $CLUSTER_NAME \
--zone $GCP_ZONE \
--project $GCP_PROJECT
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account)
kubectl create namespace nifi
kubectl create namespace zookeeper
kubectl create namespace cert-manager
cat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
parameters:
type: pd-standard
provisioner: kubernetes.io/gce-pd
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
EOF
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: nifikop
EOF
helm install nifikop-zk bitnami/zookeeper \
--namespace=nifi \
--set resources.requests.memory=256Mi \
--set resources.requests.cpu=250m \
--set resources.limits.memory=256Mi \
--set resources.limits.cpu=250m \
--set networkPolicy.enabled=true \
--set replicaCount=3 \
--set namespaces={“nifi”}
kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.1.0/cert-manager.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nificlusters_crd.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nifiusers_crd.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nifiusergroups_crd.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nifidataflows_crd.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nifiparametercontexts_crd.yaml
kubectl apply -f https://raw.githubusercontent.com/Orange-OpenSource/nifikop/master/deploy/crds/v1/nifi.orange.com_nifiregistryclients_crd.yaml
helm install nifikop \
orange-incubator/nifikop \
--namespace=nifi \
--set namespaces={"nifi"} \
--set resources.requests.memory=256Mi \
--set resources.requests.cpu=250m \
--set resources.limits.memory=256Mi \
--set resources.limits.cpu=250m
cat <<EOF | kubectl create -n nifi -f -
apiVersion: nifi.orange.com/v1alpha1
kind: NifiCluster
metadata:
name: simplenifi
spec:
service:
headlessEnabled: true
zkAddress: "nifikop-zk-zookeeper:2181"
zkPath: "/simplenifi"
clusterImage: "apache/nifi:1.12,1"
oneNifiNodePerNode: false
nodeConfigGroups:
default_group:
isNode: true
storageConfigs:
- mountPath: "/opt/nifi/nifi-current/logs"
name: logs
pvcSpec:
accessModes:
- ReadWriteOnce
storageClassName: "local-storage"
resources:
requests:
storage: 10Gi
serviceAccountName: "nifikop"
resourcesRequirements:
limits:
cpu: "2"
memory: 3Gi
requests:
cpu: "1"
memory: 1Gi
nodes:
- id: 1
nodeConfigGroup: "default_group"
- id: 2
nodeConfigGroup: "default_group"
propagateLabels: true
nifiClusterTaskSpec:
retryDurationMinutes: 10
listenersConfig:
internalListeners:
- type: "http"
name: "http"
containerPort: 8080
- type: "cluster"
name: "cluster"
containerPort: 6007
- type: "s2s"
name: "s2s"
containerPort: 10000
EOF
What did you expect to see?
A clear and concise description of what you expected to happen (or insert a code snippet).
NiFi is up and running
What did you see instead? Under which circumstances?
A clear and concise description of what you expected to happen (or insert a code snippet).
Environment
-
nifikop version:
0.3.1 - (runtime error: index out of range [1] with length 1)
0.4.1-alpha, 0.4.2-alpha - No service is created
-
Kubernetes version information:
kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.9", GitCommit:"4fb7ed12476d57b8437ada90b4f93b17ffaeed99", GitTreeState:"clean", BuildDate:"2020-07-15T16:18:16Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.14-gke.1200", GitCommit:"7c407f5cc8632f9af5a2657f220963aa7f1c46e7", GitTreeState:"clean", BuildDate:"2020-12-01T09:20:59Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}