mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-28 05:47:36 +00:00
🚀 Change Hub's and Front's resource type from Pod
to Deployment
(#1412)
* change services to ClusterIP and update selector labels Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> * replace kind of hub and front to Deployments Pod -> Deployments hub config -> Uses a config-map license -> Ises a secret Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> * uses map of labels to select pods and services Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> * remove ListAllNamespaces method Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> * include livenessProbe and readinessProbe for deployments Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> --------- Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com>
This commit is contained in:
@@ -127,6 +127,21 @@ func (provider *Provider) ListAllRunningPodsMatchingRegex(ctx context.Context, r
|
||||
return matchingPods, nil
|
||||
}
|
||||
|
||||
func (provider *Provider) ListPodsByAppLabel(ctx context.Context, namespaces string, labels map[string]string) ([]core.Pod, error) {
|
||||
pods, err := provider.clientSet.CoreV1().Pods(namespaces).List(ctx, metav1.ListOptions{
|
||||
LabelSelector: metav1.FormatLabelSelector(
|
||||
&metav1.LabelSelector{
|
||||
MatchLabels: labels,
|
||||
},
|
||||
),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return pods.Items, err
|
||||
}
|
||||
|
||||
func (provider *Provider) GetPodLogs(ctx context.Context, namespace string, podName string, containerName string) (string, error) {
|
||||
podLogOpts := core.PodLogOptions{Container: containerName}
|
||||
req := provider.clientSet.CoreV1().Pods(namespace).GetLogs(podName, &podLogOpts)
|
||||
|
Reference in New Issue
Block a user