Documentation ¶
Overview ¶
Copyright © 2019 Portworx
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Portworx ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Portworx ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2019 Portworx ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( DEFAULT_TAIL_LINES = int64(10) NO_TAIL_LINES = int64(-1) )
Variables ¶
var (
NODE_KEY = []byte("node=")
)
Functions ¶
func KubeConnect ¶
func KubeConnect(cfgFile, context string) (clientcmd.ClientConfig, *kubernetes.Clientset, error)
KubeConnect will return a Kubernetes client using the kubeconfig file set in the default context. clientcmd.ClientConfig will allow the caller to call ClientConfig.Namespace() to get the namespace set by the caller on their Kubeconfig.
func KubeConnectDefault ¶ added in v0.21.4
func KubeConnectDefault() (clientcmd.ClientConfig, *kubernetes.Clientset, error)
KubeConnectDefault returns a Kubernetes client to the default or named context.
Types ¶
type COps ¶ added in v0.21.3
type COps interface { // GetPodsByLabels returns pods from specified namespace with the given labels // labels should be of the form "abc=def,xyz=mno" GetPodsByLabels(namespace string, labels string) ([]v1.Pod, error) // GetPvcsByLabels returns pvcs from spacified namespace with given labels // labels should be of the form "abc=def,xyz=mno" GetPvcsByLabels(namespace string, labels string) ([]v1.PersistentVolumeClaim, error) // GetLogs writes out logs to out based on the logOptions specified GetLogs(logOptions *COpsLogOptions, out io.Writer) error }
func NewCOps ¶ added in v0.21.3
func NewCOps(kc *KubeConnectionData) COps
type COpsLogOptions ¶ added in v0.21.3
type COpsLogOptions struct { PodLogOptions v1.PodLogOptions IgnoreLogErrors bool MaxFollowConcurency int ShowPodInfo bool Filters []string ApplyFilters bool PortworxNamespace string CInfo []ContainerInfo }
type ContainerInfo ¶ added in v0.21.3
type KubeConnectionData ¶ added in v0.21.3
type KubeConnectionData struct { ClientConfig clientcmd.ClientConfig ClientSet *kclikube.Clientset }
func (*KubeConnectionData) GetLogs ¶ added in v0.21.3
func (p *KubeConnectionData) GetLogs( lo *COpsLogOptions, out io.Writer, ) error
func (*KubeConnectionData) GetPodsByLabels ¶ added in v0.21.3
func (*KubeConnectionData) GetPvcsByLabels ¶ added in v0.21.3
func (p *KubeConnectionData) GetPvcsByLabels( namespace string, labels string, ) ([]v1.PersistentVolumeClaim, error)
type PxPvc ¶ added in v0.21.2
type PxPvc struct { Name string Namespace string PodNames []string Pvc *v1.PersistentVolumeClaim PxVolume *api.Volume Pods []v1.Pod }
func NewPxPvc ¶ added in v0.21.2
func NewPxPvc(pvc *v1.PersistentVolumeClaim) *PxPvc