skydive-project / skydive-operator

4 stars 5 forks source link

support for k8s v1.16+ (move to apps/v1 api) #5

Closed sa-cloud closed 4 years ago

sa-cloud commented 4 years ago

starting the skydive-operator demonstration:

kubectl1 create -f deploy/crds/charts.helm.k8s.io_skydives_crd.yaml
customresourcedefinition.apiextensions.k8s.io/skydives.charts.helm.k8s.io created
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 create -f deploy/crds/charts.helm.k8s.io_netflowcollectors_crd.yaml
customresourcedefinition.apiextensions.k8s.io/netflowcollectors.charts.helm.k8s.io created
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 create -f deploy/
deployment.apps/skydive-operator created
clusterrole.rbac.authorization.k8s.io/skydive-operator created
clusterrolebinding.rbac.authorization.k8s.io/skydive-operator created
serviceaccount/skydive-operator created
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 get pods
NAME                                READY   STATUS    RESTARTS   AGE
skydive-operator-768787fbbf-lx8x6   1/1     Running   0          56s
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 describe pod skydive-operator-768787fbbf-lx8x6
Name:               skydive-operator-768787fbbf-lx8x6
Namespace:          default
Priority:           0
PriorityClassName:  <none>
Node:               10.74.144.77/10.74.144.77
Start Time:         Sun, 16 Feb 2020 10:48:37 +0000
Labels:             name=skydive-operator
                    pod-template-hash=768787fbbf
Annotations:        kubernetes.io/psp: ibm-privileged-psp
Status:             Running
IP:                 172.30.248.207
Controlled By:      ReplicaSet/skydive-operator-768787fbbf
Containers:
  skydive-operator:
    Container ID:   containerd://063a2cbd74f4392287b364fe138c55d9e8bb72770683014782a5a64e402e8e5a
    Image:          quay.io/sacloud/skydive-op:v0.0.7
    Image ID:       quay.io/sacloud/skydive-op@sha256:50b3be69c17e75e0d77090f7c29da03396887bab4235393da05a5a275ecff9b7
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Sun, 16 Feb 2020 10:48:39 +0000
    Ready:          True
    Restart Count:  0
    Environment:
      WATCH_NAMESPACE:
      POD_NAME:         skydive-operator-768787fbbf-lx8x6 (v1:metadata.name)
      OPERATOR_NAME:    skydive-operator
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from skydive-operator-token-rd4rh (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  skydive-operator-token-rd4rh:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  skydive-operator-token-rd4rh
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 600s
                 node.kubernetes.io/unreachable:NoExecute for 600s
Events:
  Type    Reason     Age   From                   Message
  ----    ------     ----  ----                   -------
  Normal  Scheduled  74s   default-scheduler      Successfully assigned default/skydive-operator-768787fbbf-lx8x6 to 10.74.144.77
  Normal  Pulling    73s   kubelet, 10.74.144.77  pulling image "quay.io/sacloud/skydive-op:v0.0.7"
  Normal  Pulled     72s   kubelet, 10.74.144.77  Successfully pulled image "quay.io/sacloud/skydive-op:v0.0.7"
  Normal  Created    72s   kubelet, 10.74.144.77  Created container
  Normal  Started    72s   kubelet, 10.74.144.77  Started container
sa-cloud commented 4 years ago

creating the netflowcollector resource using the skydive-operator:

kubectl1 create -f deploy/crds/charts.helm.k8s.io_v1alpha1_netflowcollector_cr.yaml
netflowcollector.charts.helm.k8s.io/netflow-collector created
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 get pods
NAME                                                  READY   STATUS    RESTARTS   AGE
netflow-collector-skydive-agent-5lwzd                 1/1     Running   0          31s
netflow-collector-skydive-agent-gv2m4                 1/1     Running   0          31s
netflow-collector-skydive-agent-q5btn                 1/1     Running   0          31s
netflow-collector-skydive-analyzer-75446989c8-4dl74   3/3     Running   0          31s
skydive-operator-768787fbbf-lx8x6                     1/1     Running   0          3m
jlerner@iris-bluesecure:~/workspace/SA-Operators/skydive-operator/skydive-operator$ kubectl1 describe pod netflow-collector-skydive-analyzer-75446989c8-4dl74
Name:               netflow-collector-skydive-analyzer-75446989c8-4dl74
Namespace:          default
Priority:           0
PriorityClassName:  <none>
Node:               10.74.144.77/10.74.144.77
Start Time:         Sun, 16 Feb 2020 10:51:06 +0000
Labels:             app=netflow-collector-skydive
                    chart=skydive
                    heritage=Tiller
                    pod-template-hash=75446989c8
                    release=netflow-collector
                    tier=analyzer
Annotations:        kubernetes.io/psp: ibm-privileged-psp
                    productID: 8e6bdbcba44f46939c3d1c54447386b2
                    productName: skydive
                    productVersion: 1.1.2
Status:             Running
IP:                 10.74.144.77
Controlled By:      ReplicaSet/netflow-collector-skydive-analyzer-75446989c8
Containers:
  skydive-analyzer:
    Container ID:  containerd://58405024a93a7cd09ab4ddb62eaeb47520a6d87d0c0bc3199569cf46e584a7fc
    Image:         skydive/skydive:0.24.0
    Image ID:      docker.io/skydive/skydive@sha256:e2037c83f8cc0a45eb0947fe81e39e7e7ee46a920098c5fb6dbf0690c139c37b
    Ports:         8082/TCP, 8082/UDP, 12379/TCP
    Host Ports:    8082/TCP, 8082/UDP, 12379/TCP
    Args:
      analyzer
      --listen=0.0.0.0:8082
    State:          Running
      Started:      Sun, 16 Feb 2020 10:51:06 +0000
    Ready:          True
    Restart Count:  0
    Limits:
      cpu:     2
      memory:  8Gi
    Requests:
      cpu:      100m
      memory:   512Mi
    Liveness:   http-get http://:8082/api/status delay=20s timeout=1s period=10s #success=1 #failure=10
    Readiness:  http-get http://:8082/api/status delay=10s timeout=1s period=10s #success=1 #failure=3
    Environment:
      SKYDIVE_UI:                                {"theme":"light","k8s_enabled":"true"}
      SKYDIVE_ANALYZER_TOPOLOGY_PROBES:          k8s
      SKYDIVE_EMBEDDED:                          true
      SKYDIVE_FLOW_PROTOCOL:                     websocket
      SKYDIVE_ANALYZER_TOPOLOGY_FABRIC:          TOR1->*[Type=host]/eth0
      SKYDIVE_LOGGING_LEVEL:                     INFO
      SKYDIVE_FLOW_UPDATE:                       30
      SKYDIVE_ANALYZER_STARTUP_CAPTURE_GREMLIN:  G.V().has('Name', NE('lo'))
      SKYDIVE_ANALYZER_STARTUP_CAPTURE_BPF:      not (tcp dst port 8082)
      SKYDIVE_FLOW_DEFAULT_LAYER_KEY_MODE:       L3
      SKYDIVE_ANALYZER_STARTUP_CAPTURE_TYPE:     pcap
      SKYDIVE_AGENT_CAPTURE_SYN:                 True
    Mounts:
      /etc/ssl/certs from ssl (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from skydive-service-account-token-dpm7c (ro)
  skydive-exporter:
    Container ID:   containerd://553ef1ba768ff8bb1a0895d4748a3c1fc63a6a0a65f36121dfccb84ecc85d2a6
    Image:          quay.io/sacloud/skydive-exporter:5
    Image ID:       quay.io/sacloud/skydive-exporter@sha256:73f2db5f279c3cfb0681350277d137ba128fc74fa1ed5699e0bc5bdceae155d6
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Sun, 16 Feb 2020 10:51:07 +0000
    Ready:          True
    Restart Count:  0
    Environment:
      SKYDIVE_ANALYZERS:                                       netflow-collector-skydive-service:8082
      SKYDIVE_PIPELINE_SUBSCRIBER_URL:                         ws://netflow-collector-skydive-service:8082/ws/subscriber/flow
      SKYDIVE_PIPELINE_STORE_BUFFERED_FILENAME_PREFIX:         <set to the key 'objectPrefix' of config map 'skydive-exporter-s3-configuration'>  Optional: false
      SKYDIVE_PIPELINE_WRITE_S3_ENDPOINT:                      <set to the key 'endpoint' of config map 'skydive-exporter-s3-configuration'>      Optional: false
      SKYDIVE_PIPELINE_WRITE_S3_ACCESS_KEY:                    <set to the key 'accesskey' in secret 'skydive-exporter-secret'>                   Optional: false
      SKYDIVE_PIPELINE_WRITE_S3_SECRET_KEY:                    <set to the key 'secretkey' in secret 'skydive-exporter-secret'>                   Optional: false
      SKYDIVE_PIPELINE_STORE_BUFFERED_DIRNAME:                 <set to the key 'bucket' of config map 'skydive-exporter-s3-configuration'>        Optional: false
      SKYDIVE_PIPELINE_WRITE_S3_REGION:                        <set to the key 'region' of config map 'skydive-exporter-s3-configuration'>        Optional: false
      SKYDIVE_PIPELINE_STORE_BUFFERED_MAX_FLOWS_PER_OBJECT:    60000
      SKYDIVE_PIPELINE_STORE_BUFFERED_MAX_SECONDS_PER_OBJECT:  60
      SKYDIVE_PIPELINE_STORE_BUFFERED_MAX_FLOW_ARRAY_SIZE:     100000
      SKYDIVE_PIPELINE_STORE_BUFFERED_MAX_SECONDS_PER_STREAM:  86400
      SKYDIVE_PIPELINE_CLASSIFY_TYPE:                          subnet_autodiscovery
      SKYDIVE_PIPELINE_CLASSIFY_CLUSTER_NET_MASKS:             10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
      SKYDIVE_PIPELINE_MANGLE_TYPE:                            none
      SKYDIVE_PIPELINE_FILTER_EXCLUDED_TAGS:                   other
      SKYDIVE_PIPELINE_ENCODE_TYPE:                            secadvisor
      SKYDIVE_PIPELINE_COMPRESS_TYPE:                          gzip
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from skydive-service-account-token-dpm7c (ro)
  skydive-minio:
    Container ID:   containerd://5d0c78853f9dafe52a832a2a06d0a1fff52cf0d143ec5c3572165776e04da0c4
    Image:          docker.io/bitnami/minio:2019.7.31-debian-9-r1
    Image ID:       docker.io/bitnami/minio@sha256:f4ab6fa8c7ce912a1b67f57b14afb41bbf97d63e7820db83c8b8b5b15b8d0f67
    Port:           9000/TCP
    Host Port:      9000/TCP
    State:          Running
      Started:      Sun, 16 Feb 2020 10:51:07 +0000
    Ready:          True
    Restart Count:  0
    Environment:
      MINIO_ACCESS_KEY:       admin
      MINIO_SECRET_KEY:       admin1234
      MINIO_DEFAULT_BUCKETS:  default
      MINIO_REGION_NAME:      default
    Mounts:
      /data from data (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from skydive-service-account-token-dpm7c (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  ssl:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/ssl/certs
    HostPathType:
  data:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  skydive-service-account-token-dpm7c:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  skydive-service-account-token-dpm7c
    Optional:    false
QoS Class:       Burstable
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 600s
                 node.kubernetes.io/unreachable:NoExecute for 600s
Events:
  Type    Reason     Age   From                   Message
  ----    ------     ----  ----                   -------
  Normal  Scheduled  55s   default-scheduler      Successfully assigned default/netflow-collector-skydive-analyzer-75446989c8-4dl74 to 10.74.144.77
  Normal  Pulled     55s   kubelet, 10.74.144.77  Container image "skydive/skydive:0.24.0" already present on machine
  Normal  Created    55s   kubelet, 10.74.144.77  Created container
  Normal  Started    55s   kubelet, 10.74.144.77  Started container
  Normal  Pulled     55s   kubelet, 10.74.144.77  Container image "quay.io/sacloud/skydive-exporter:5" already present on machine
  Normal  Created    54s   kubelet, 10.74.144.77  Created container
  Normal  Started    54s   kubelet, 10.74.144.77  Started container
  Normal  Pulled     54s   kubelet, 10.74.144.77  Container image "docker.io/bitnami/minio:2019.7.31-debian-9-r1" already present on machine
  Normal  Created    54s   kubelet, 10.74.144.77  Created container
  Normal  Started    54s   kubelet, 10.74.144.77  Started container