diff --git a/README.md b/README.md index b6f6474..5b4f43f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,16 @@ The user can choose which tools they want to use in order to either digest, display or process the IoT data. Eventually the user will be allowed to create custom data pipelines to connect the tools. Currently the following tools will be supported +## Getting Started + +Download the latest Release from the [release page](https://github.com/redhat-iot/iot-dev/releases) + +Move the Executable `IoTCLI` into your `$PATH` + +Run `IoTCLI` login to authenticate with your openshift cluster + +# Main Components Overview + ## Messaging Core In any Edge system that incorporates IoT devices, having a scalable cloud native edge system is very important. With the `IoTCLI` you can easily deploy these messaging services to your Openshift 4.X cluster @@ -66,24 +76,27 @@ Persistent storage is implemented using [Ceph Object Storage](https://ceph.io/ce #### TensorFlow lite TODO - - ## Command Reference -| Command1 (Tool) | Command2(Module) | Command3(Module command) | Argument (module input) | Flags | Function | -|-----------------|------------------|--------------------------|------------------------------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| -| ceph | setup | None | None | None | Setup Ceph Object Storage via the Rook Operator | -| enmasse | destroy | None | None | None | Remove Enmasse from openshift cluster | -| enmasse | IoT | addDevice | | None | Add a Device with specified ID to the Enmasse device registry for a specified messaging TenantSetup default Credentials | -| enmasse | IoT | project | None | --namespace | Make a new enmasse IoT project in the specified namespace, defaults to “myapp” | -| enmasse | setup | None | None | None | Download Enmasse Source, store in current directory. Setup Enmasse Setup IoT services | -| kafka | bridge | None | None | --namespace | Deploy kafka HTTP bridge Deploy nginx ingress to access bridge from outside the cluster (will be transitioned to a route) | -| kafka | destroy | None | None | --namespace | Destroy the kafka deployment located at the specified namespace | -| kafka | setup | None | None | --namespace | Setup a kafka cluster viat the strimzi operator at the specified namespace | -| knative | setup | None | None | --status=true/false | Setup Knative serverless on openshift clusterConfigures both Knative-Eventing and Knative-ServingSet --status=true to check on Knative deployment | -| knative | destroy | None | None | None | Remove Knative deployment from openshift cluster | -| knative | service | None | | --status=true/false--namespace | Deploy a knative service Set --status=true to check on Knative service deploymentDefault namespace is “knative-eventing” | -| knative | service | destroy | | --namespace | Remove a specified Knative service from the cluster at specified namespace Default namespace is “knative-eventing” | -| knative | source | None | | --namespace | Deploy a Knative Source at specified namespace Defaults to namespace “knative-eventing” | -| knative | source | destroy | | --namespace | Remove a specified knative source from the cluster from specified namespaceDefault namespace is “knative-eventing” | \ No newline at end of file +| Command1 (Tool) | Command2(Module) | Command3(Module command) | Argument (module input) | Flags | Function | +|-------------------|------------------|--------------------------|------------------------------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| ceph | destroy | None | None | None | Return user secrets for c | +| ceph | secrets | None | None | None | Return user secrets for ceph deployment | +| ceph | setup | None | None | None | Setup Ceph Object Storage via the Rook Operator | +| enmasse | destroy | None | None | None | Remove Enmasse from openshift cluster | +| enmasse | IoT | addDevice | | None | Add a Device with specified ID to the Enmasse device registry for a specified messaging TenantSetup default Credentials | +| enmasse | IoT | project | None | --namespace | Make a new enmasse IoT project in the specified namespace, defaults to “myapp” | +| enmasse | setup | None | None | None | Download Enmasse Source, store in current directory. Setup Enmasse Setup IoT services | +| kafka | bridge | None | None | --namespace | Deploy kafka HTTP bridge Deploy nginx ingress to access bridge from outside the cluster (will be transitioned to a route) | +| kafka | destroy | None | None | --namespace | Destroy the kafka deployment located at the specified namespace | +| kafka | setup | None | None | --namespace | Setup a kafka cluster viat the strimzi operator at the specified namespace | +| knative | setup | None | None | --status=true/false | Setup Knative serverless on openshift clusterConfigures both Knative-Eventing and Knative-ServingSet --status=true to check on Knative deployment | +| knative | destroy | None | None | None | Remove Knative deployment from openshift cluster | +| knative | service | None | | --status=true/false--namespace | Deploy a knative service Set --status=true to check on Knative service deploymentDefault namespace is “knative-eventing” | +| knative | service | destroy | | --namespace | Remove a specified Knative service from the cluster at specified namespace Default namespace is “knative-eventing” | +| knative | source | None | | --namespace | Deploy a Knative Source at specified namespace Defaults to namespace “knative-eventing” | +| knative | source | destroy | | --namespace | Remove a specified knative source from the cluster from specified namespaceDefault namespace is “knative-eventing” | +| login | None | None | None | None | Login to your openshift cluster with the username and password | +| tensorflowServing | setup | None | None | --namespace | Deploy a tensorflow serving deployment and service Default namespace is “default” | +| tensorflowServing | destroy | None | None | --namesapce | Deploy a tensorflow serving deployment and serviceDefault namespace is “default” | \ No newline at end of file diff --git a/cmd/ceph-destroy.go b/cmd/ceph-destroy.go new file mode 100644 index 0000000..985a671 --- /dev/null +++ b/cmd/ceph-destroy.go @@ -0,0 +1,91 @@ +/* +Copyright © 2020 NAME HERE + +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. +*/ +package cmd + +import ( + "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/kubectl/pkg/cmd/delete" + "log" + //"time" +) + +//Made from Instructions @https://opendatahub.io/docs/administration/advanced-installation/object-storage.html for installing +//ceph object storage via the rook operator +func cephDestroy() { + //Make command options for Knative Setup + co := utils.NewCommandOptions() + + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/route.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object-user.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/toolbox.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/cluster.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/operator.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/scc.yaml") + + IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() + + //Switch Context and Reload Config Flags + co.SwitchContext("rook-ceph-system") + + log.Println("Provision Knative Source") + for _, command := range co.Commands { + cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams) + //Kubectl signals missing field, set validate to false to ignore this + cmd.Flags().Set("validate", "false") + err := cmd.Flags().Set("filename", command) + if err != nil { + log.Fatal(err) + } + cmd.Run(cmd, []string{}) + log.Print(out.String()) + out.Reset() + + } + +} + +// destroyCmd represents the destroy command +var cephDestroyCmd = &cobra.Command{ + Use: "destroy", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + log.Println("destroy called") + cephDestroy() + }, +} + +func init() { + cephCmd.AddCommand(cephDestroyCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // destroyCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // destroyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/ceph-secrets.go b/cmd/ceph-secrets.go new file mode 100644 index 0000000..03766b7 --- /dev/null +++ b/cmd/ceph-secrets.go @@ -0,0 +1,72 @@ +/* +Copyright © 2020 NAME HERE + +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. +*/ +package cmd + +import ( + "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/kubectl/pkg/cmd/get" + "log" +) + +func getCredentials() { + co := utils.NewCommandOptions() + + co.Commands = append(co.Commands, "secrets") + + IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() + + //Switch Context and Reload Config Flags + co.SwitchContext("rook-ceph") + + log.Print("Get S3 secrets, save for possible later use:") + cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) + cmd.Flags().Set("output", "json") + cmd.Run(cmd, []string{co.Commands[0], "rook-ceph-object-user-my-store-odh-user"}) + log.Print(out.String()) + out.Reset() +} + +// secretsCmd represents the secrets command +var cephSecretsCmd = &cobra.Command{ + Use: "secrets", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + log.Println("Ceph Secrets called") + getCredentials() + }, +} + +func init() { + cephCmd.AddCommand(cephSecretsCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // secretsCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // secretsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/ceph-setup.go b/cmd/ceph-setup.go index 9b95de2..1b43831 100644 --- a/cmd/ceph-setup.go +++ b/cmd/ceph-setup.go @@ -22,6 +22,7 @@ import ( "k8s.io/kubectl/pkg/cmd/apply" "k8s.io/kubectl/pkg/cmd/get" "log" + "time" ) //Made from Instructions @https://opendatahub.io/docs/administration/advanced-installation/object-storage.html for installing @@ -38,7 +39,7 @@ func cephSetup() { co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object.yaml") co.Commands = append(co.Commands, "pods") co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/object-user.yaml") - co.Commands = append(co.Commands, "secrets") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/ceph/setup/route.yaml") IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() @@ -47,26 +48,34 @@ func cephSetup() { log.Println("Provision Knative Source") for commandNumber, command := range co.Commands { + //After the system pods are provisioned wait for them to become ready before moving on if commandNumber == 2 { - log.Print("Make sure Pods are ready in rook-ceph-system namespace:") - cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) - cmd.Run(cmd, []string{command}) - log.Print(out.String()) - out.Reset() + log.Print("Waiting for Pods to be ready in rook-ceph-system namespace:") + podStatus := utils.NewpodStatus() + for podStatus.Running != 7 { + cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) + cmd.Flags().Set("output", "yaml") + cmd.Run(cmd, []string{command}) + podStatus.CountPods(out.Bytes()) + log.Print("waiting...") + out.Reset() + time.Sleep(5 * time.Second) + } co.SwitchContext("rook-ceph") + } else if commandNumber == 6 { - log.Print("Make sure Pods are ready in rook-ceph") - cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) - cmd.Run(cmd, []string{command}) - log.Print(out.String()) - out.Reset() - } else if commandNumber == 8 { - log.Print("Get S3 secrets, save for possible later use:") - cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) - cmd.Flags().Set("output", "json") - cmd.Run(cmd, []string{command, "rook-ceph-object-user-my-store-odh-user"}) - log.Print(out.String()) - out.Reset() + //After the pods in rook-ceph are provisioned wait for them to become ready before moving on + log.Print("Waiting for pods to be ready in rook-ceph") + podStatus := utils.NewpodStatus() + for podStatus.Running != 9 && podStatus.Succeeded != 3 { + cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) + cmd.Flags().Set("output", "yaml") + cmd.Run(cmd, []string{command}) + podStatus.CountPods(out.Bytes()) + log.Print("waiting...") + out.Reset() + time.Sleep(5 * time.Second) + } } else { cmd := apply.NewCmdApply("kubectl", co.CurrentFactory, IOStreams) //Kubectl signals missing field, set validate to false to ignore this diff --git a/cmd/enmasse-IoT-project.go b/cmd/enmasse-IoT-project.go index a36cacf..0ec53b6 100644 --- a/cmd/enmasse-IoT-project.go +++ b/cmd/enmasse-IoT-project.go @@ -18,6 +18,7 @@ package cmd import ( "io/ioutil" "log" + "os" "strconv" "strings" "time" @@ -109,6 +110,9 @@ func createProject() { out.Reset() } + //Remove Enmasse Source code + os.RemoveAll(enmasseFolderName) + } // projectCmd represents the project command diff --git a/cmd/enmasse-destroy.go b/cmd/enmasse-destroy.go index fe496f2..9232af0 100644 --- a/cmd/enmasse-destroy.go +++ b/cmd/enmasse-destroy.go @@ -16,21 +16,42 @@ limitations under the License. package cmd import ( - "fmt" "log" - "os" - "os/exec" + //"os" "github.com/spf13/cobra" + + "github.com/IoTCLI/cmd/utils" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/kubectl/pkg/cmd/delete" ) func enmasseDestroy() { - cmd := exec.Command("./scripts/enmasseDestroy.sh") - cmd.Stdout = os.Stdout - err := cmd.Run() - if err != nil { - log.Fatal(err) + + //Make command options for Kafka Setup + co := utils.NewCommandOptions() + + //Fill ain the commands that must be applied to + //Install Enmasse Core + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/enmasse-infra-namespace.yaml") + // + IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() + + co.SwitchContext(enmasseSetupNamespaceFlag) + + //Reload config flags after switching context + log.Println("Destroy Enmasse Messaging Service") + for _, command := range co.Commands { + cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams) + err := cmd.Flags().Set("filename", command) + if err != nil { + log.Fatal(err) + } + cmd.Run(cmd, []string{}) + log.Print(out.String()) + out.Reset() } + } // destroyCmd represents the destroy command @@ -44,7 +65,7 @@ Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, Run: func(cmd *cobra.Command, args []string) { - fmt.Println("destroy called") + log.Println("destroy called") enmasseDestroy() }, } diff --git a/cmd/enmasse-setup.go b/cmd/enmasse-setup.go index 8ac9377..b87646f 100644 --- a/cmd/enmasse-setup.go +++ b/cmd/enmasse-setup.go @@ -16,17 +16,14 @@ limitations under the License. package cmd import ( - //"io/ioutil" "log" - //"os" + "os" "os/exec" "github.com/spf13/cobra" - //in package import "github.com/IoTCLI/cmd/utils" "k8s.io/cli-runtime/pkg/genericclioptions" - //"k8s.io/kubectl/pkg/cmd/" "k8s.io/kubectl/pkg/cmd/apply" ) @@ -90,6 +87,7 @@ func enmasseSetup() { log.Print(out.String()) out.Reset() } + os.RemoveAll(folderName) } diff --git a/cmd/kafka-bridge.go b/cmd/kafka-bridge.go index b0b63bf..a8aa664 100644 --- a/cmd/kafka-bridge.go +++ b/cmd/kafka-bridge.go @@ -32,14 +32,14 @@ func kafkaBridge() { co := utils.NewCommandOptions() //Setup kafka bridge - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/kafka-bridge.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/bridge/kafka-bridge.yaml") //Setup Nginix Ingress **CONVERT TO OPENSHIFT ROUTE AT SOME POINT** to connect to bridge from outside the cluster //Get Nginix controller and apply to cluster co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml") co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml") //Seutp the K8s ingress resource - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/ingress.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/bridge/ingress.yaml") IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() diff --git a/cmd/kafka-destroy.go b/cmd/kafka-destroy.go index 1e307d2..30dfc1f 100644 --- a/cmd/kafka-destroy.go +++ b/cmd/kafka-destroy.go @@ -32,11 +32,15 @@ func kafkaDestroy() { //Make command options for Kafka Setup co := utils.NewCommandOptions() + _ = utils.DownloadAndUncompress("oc.gz", "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz") + log.Println("oc Source folder: ", "oc") + //Fill in the commands that must be applied to - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/kafka.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka.yaml") co.Commands = append(co.Commands, "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.17.0/strimzi-cluster-operator-0.17.0.yaml") - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka-namespace.yaml") - + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka-namespace.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml") // IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() diff --git a/cmd/kafka-setup.go b/cmd/kafka-setup.go index d7b2436..6596f5a 100644 --- a/cmd/kafka-setup.go +++ b/cmd/kafka-setup.go @@ -46,7 +46,9 @@ func kafkaSetup() { } defer os.Remove(tmpFile.Name()) - myOutput := utils.RemoteSed(`s/namespace: .*/namespace: kafka/`, "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.17.0/strimzi-cluster-operator-0.17.0.yaml") + sedCommands := []string{`s/namespace: .*/namespace: kafka/`} + + myOutput := utils.RemoteSed(sedCommands, "https://github.com/strimzi/strimzi-kafka-operator/releases/download/0.17.0/strimzi-cluster-operator-0.17.0.yaml") tmpFile.Write(myOutput.Bytes()) @@ -56,9 +58,9 @@ func kafkaSetup() { } //Fill in the commands that must be applied to - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/kafka-namespace.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka-namespace.yaml") co.Commands = append(co.Commands, tmpFile.Name()) - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/kafka.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/kafka/setup/kafka.yaml") // IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() diff --git a/cmd/knative-destroy.go b/cmd/knative-destroy.go index 79e91d3..2a75946 100644 --- a/cmd/knative-destroy.go +++ b/cmd/knative-destroy.go @@ -17,22 +17,24 @@ package cmd import ( "fmt" + "github.com/spf13/cobra" "log" "os" "os/exec" - "github.com/spf13/cobra" ) -func destroyKnative(){ +///STILL NOT UPDATED TO Wrappers +func destroyKnative() { + ocCommands := [][]string{} - ocCommands = append(ocCommands,[]string{"./oc" , "delete", "--filename", "https://github.com/knative/eventing/releases/download/v0.13.0/eventing.yaml"}) - ocCommands = append(ocCommands,[]string{"./oc" ,"delete" ,"--selector", "knative.dev/crd-install=true" ,"--filename", "https://github.com/knative/eventing/releases/download/v0.13.0/eventing.yaml"}) - ocCommands = append(ocCommands,[]string{"./oc" , "delete", "namespace", "knative-eventing"} ) - ocCommands = append(ocCommands,[]string{"./oc", "delete", "knativeserving.operator.knative.dev", "knative-serving", "-n" ,"knative-serving"} ) - ocCommands = append(ocCommands,[]string{"./oc" , "delete", "namespace", "knative-serving"} ) + ocCommands = append(ocCommands, []string{"./oc", "delete", "--filename", "https://github.com/knative/eventing/releases/download/v0.13.0/eventing.yaml"}) + ocCommands = append(ocCommands, []string{"./oc", "delete", "--selector", "knative.dev/crd-install=true", "--filename", "https://github.com/knative/eventing/releases/download/v0.13.0/eventing.yaml"}) + ocCommands = append(ocCommands, []string{"./oc", "delete", "namespace", "knative-eventing"}) + ocCommands = append(ocCommands, []string{"./oc", "delete", "knativeserving.operator.knative.dev", "knative-serving", "-n", "knative-serving"}) + ocCommands = append(ocCommands, []string{"./oc", "delete", "namespace", "knative-serving"}) //ocCommands = append(ocCommands,[]string{"./oc","delete","-f","yamls/sub.yaml"} ) //ocCommands = append(ocCommands,[]string{"./oc","delete","-f","yamls/operatorgroup.yaml"} ) - + for command := range ocCommands { cmd := exec.Command(ocCommands[command][0], ocCommands[command][1:]...) cmd.Stdout = os.Stdout @@ -46,22 +48,22 @@ func destroyKnative(){ //delete Operator - currentCSV,err := exec.Command("bash","-c","./oc get subscription serverless-operator -n openshift-operators -o jsonpath='{.status.currentCSV}'").Output() - err = exec.Command("./oc" ,"delete" ,"subscription", "serverless-operator" ,"-n" ,"openshift-operators").Run() + currentCSV, err := exec.Command("bash", "-c", "./oc get subscription serverless-operator -n openshift-operators -o jsonpath='{.status.currentCSV}'").Output() + err = exec.Command("./oc", "delete", "subscription", "serverless-operator", "-n", "openshift-operators").Run() if err != nil { //Igonore Resource Not found error and continue, but still notify the user log.Println(err) } - err = exec.Command("./oc" ,"delete" ,"clusterserviceversion",string(currentCSV), "-n" ,"openshift-operators").Run() + err = exec.Command("./oc", "delete", "clusterserviceversion", string(currentCSV), "-n", "openshift-operators").Run() if err != nil { //Igonore Resource Not found error and continue, but still notify the user log.Println(err) } - + os.Remove("oc") } // destroyCmd represents the destroy command -var knative_destroyCmd = &cobra.Command{ +var knativeDestroyCmd = &cobra.Command{ Use: "destroy", Short: "A brief description of your command", Long: `A longer description that spans multiple lines and likely contains examples @@ -77,7 +79,7 @@ to quickly create a Cobra application.`, } func init() { - knativeCmd.AddCommand(knative_destroyCmd) + knativeCmd.AddCommand(knativeDestroyCmd) // Here you will define your flags and configuration settings. diff --git a/cmd/knative-service-destroy.go b/cmd/knative-service-destroy.go index f9f628f..dc01576 100644 --- a/cmd/knative-service-destroy.go +++ b/cmd/knative-service-destroy.go @@ -37,7 +37,7 @@ func destroyService(service string) { co := utils.NewCommandOptions() //Install Openshift Serveless and Knative Serving - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/services/"+service+".yaml") + co.Commands = append(co.Commands, service) IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() co.SwitchContext(knativeServiceDestroyNamespaceFlag) @@ -45,11 +45,7 @@ func destroyService(service string) { log.Println("Delete Knative service: ", service) for _, command := range co.Commands { cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams) - err := cmd.Flags().Set("filename", command) - if err != nil { - log.Fatal(err) - } - cmd.Run(cmd, []string{}) + cmd.Run(cmd, []string{"ksvc", command}) log.Print(out.String()) out.Reset() //Allow time for Operator to distribute to all namespaces diff --git a/cmd/knative-service.go b/cmd/knative-service.go index 397c9a2..caf2136 100644 --- a/cmd/knative-service.go +++ b/cmd/knative-service.go @@ -16,21 +16,26 @@ limitations under the License. package cmd import ( - "github.com/spf13/cobra" - "log" - - //in package import + b64 "encoding/base64" "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "io/ioutil" "k8s.io/cli-runtime/pkg/genericclioptions" - //"k8s.io/kubectl/pkg/cmd/" "k8s.io/kubectl/pkg/cmd/apply" "k8s.io/kubectl/pkg/cmd/get" + "log" + "os" + "strings" ) var ( status = false logView = false knativeServiceNamespaceFlag string + cephEndpoint string + cephAccessKey string + cephSecretKey string + tensorflowIP = "" ) func service(service string) { @@ -38,16 +43,79 @@ func service(service string) { //Make command options for Knative Setup co := utils.NewCommandOptions() - //Install Openshift Serveless and Knative Serving - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/services/"+service+".yaml") + //export IP=$(oc get pods -n kafka --selector=app=coco-server -o jsonpath='{.items[*].status.podIP'}) IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() - co.SwitchContext(knativeServiceNamespaceFlag) + tmpFile, err := ioutil.TempFile(os.TempDir(), "service-") + if err != nil { + log.Fatal("Cannot create temporary file", err) + } + defer os.Remove(tmpFile.Name()) + + //Service specific configs for reading in various service customization settings + switch service { + case "video-analytics": + + //Get Tensorflow Service IP for IoT Video Service + cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) + cmd.Flags().Set("selector", "app=coco-server") + cmd.Flags().Set("output", "jsonpath={.items[*].status.podIP}") + cmd.Run(cmd, []string{"pods"}) + tensorflowIP = strings.TrimSpace(out.String()) + if tensorflowIP == "" { + log.Fatal("Tensorflow Serving not deployed") + } + log.Println("Tensorflow Serving IP:", tensorflowIP) + out.Reset() + + //Populate Yaml in Memory + decodedcephAccessKey, _ := b64.StdEncoding.DecodeString(cephAccessKey) + decodedcephSecretKey, _ := b64.StdEncoding.DecodeString(cephSecretKey) + sedCommands := []string{` /- name: S3_ID/,/- name: S3_SECRET_KEY/s/value: .*/value: ` + string(decodedcephAccessKey) + `/`, ` /- name: CEPH_ENDPOINT/,/- name: S3_ID/s/value: .*/value: http:\/\/` + cephEndpoint + `/`, + ` /- name: S3_SECRET_KEY/,/- name: TF_URL/s/value: .*/value: ` + string(decodedcephSecretKey) + `/`, ` /- name: TF_URL/,/value:/s/value: .*/value: http:\/\/` + tensorflowIP + `:8501\/v1\/models\/ssdlite_mobilenet_v2_coco_2018_05_09:predict/`} + + myOutput := utils.RemoteSed(sedCommands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/services/video-analytics.yaml") + + //Write updated yaml to tempfile + tmpFile.Write(myOutput.Bytes()) + log.Println("the Source file: ", myOutput.String()) + //Close Tempfile after writing + if err := tmpFile.Close(); err != nil { + log.Fatal(err) + } + + //Add custom service yaml to command + co.Commands = append(co.Commands, tmpFile.Name()) + case "video-serving": + decodedcephAccessKey, _ := b64.StdEncoding.DecodeString(cephAccessKey) + decodedcephSecretKey, _ := b64.StdEncoding.DecodeString(cephSecretKey) + sedCommands := []string{` /- name: S3_ID/,/- name: S3_SECRET_KEY/s/value: .*/value: ` + string(decodedcephAccessKey) + `/`, ` /- name: CEPH_ENDPOINT/,/- name: S3_ID/s/value: .*/value: http:\/\/` + cephEndpoint + `/`, + ` /- name: S3_SECRET_KEY/,/value:/s/value: .*/value: ` + string(decodedcephSecretKey) + `/`} + + myOutput := utils.RemoteSed(sedCommands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/services/video-serving.yaml") + + tmpFile.Write(myOutput.Bytes()) + log.Println("the Source file: ", myOutput.String()) + //Close Tempfile after writing + if err := tmpFile.Close(); err != nil { + log.Fatal(err) + } + + co.Commands = append(co.Commands, tmpFile.Name()) + default: + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/services/"+service+".yaml") + if err := tmpFile.Close(); err != nil { + log.Fatal(err) + } + } + log.Println("Provision Knative Service: ", service) for _, command := range co.Commands { cmd := apply.NewCmdApply("kubectl", co.CurrentFactory, IOStreams) err := cmd.Flags().Set("filename", command) + //TODO implement a global dry run flag + //cmd.Flags().Set("dry-run", "true") if err != nil { log.Fatal(err) } @@ -55,6 +123,7 @@ func service(service string) { log.Print(out.String()) out.Reset() } + os.Remove(tmpFile.Name()) } @@ -79,6 +148,7 @@ func serviceStatus() { out.Reset() } +//Unimplemented leave in source for now 4/24/20 /* func logs(name string) { @@ -162,4 +232,7 @@ func init() { knativeServiceCmd.Flags().BoolVarP(&status, "status", "S", false, "Show Status of the Service") knativeServiceCmd.Flags().BoolVarP(&logView, "logView", "l", false, "Show logs of the Service") knativeServiceCmd.Flags().StringVarP(&knativeServiceNamespaceFlag, "namespace", "n", "knative-eventing", "Option to specify namespace for knative service deployment, defaults to 'knative-eventing'") + knativeServiceCmd.Flags().StringVarP(&cephEndpoint, "cephEndpoint", "c", "", "Option to specify ceph object storage endpoint to service") + knativeServiceCmd.Flags().StringVarP(&cephAccessKey, "cephAccessKey", "a", "", "Option to specify ceph object storage access key to service") + knativeServiceCmd.Flags().StringVarP(&cephSecretKey, "cephSecretKey", "s", "", "Option to specify ceph object storage secret key to service") } diff --git a/cmd/knative-setup.go b/cmd/knative-setup.go index 429a24b..379dc03 100644 --- a/cmd/knative-setup.go +++ b/cmd/knative-setup.go @@ -18,7 +18,6 @@ package cmd import ( "log" "strconv" - "strings" "github.com/spf13/cobra" @@ -38,9 +37,9 @@ func knativeServing() { co := utils.NewCommandOptions() //Install Openshift Serveless and Knative Serving - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/operatorgroup.yaml") - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/sub.yaml") - co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative-serving.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/setup/operatorgroup.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/setup/sub.yaml") + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/setup/knative-serving.yaml") IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() co.SwitchContext("knative-serving") @@ -57,7 +56,7 @@ func knativeServing() { out.Reset() //Allow time for Operator to distribute to all namespaces if commandNumber == 1 { - time.Sleep(2.0 * time.Second) + time.Sleep(10.0 * time.Second) } } @@ -70,25 +69,24 @@ func knativeServing() { for !deployments && !install && !ready && !dependencies { cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) - err := cmd.Flags().Set("output", "jsonpath={.status.conditions}") - if err != nil { - log.Fatal(err) - } + //err := cmd.Flags().Set("output", "jsonpath={.status.conditions}") + cmd.Flags().Set("template", "{{range .status.conditions}}{{printf \"%s=%s\" .type .status}}{{end}}") + cmd.Run(cmd, []string{"knativeserving.operator.knative.dev/knative-serving"}) knativeStatus := out.String() - knativeStatusSlice := strings.Split(knativeStatus, " ") + //log.Println(knativeStatus) - dependencies, _ = strconv.ParseBool(knativeStatusSlice[1][7:11]) - deployments, _ = strconv.ParseBool(knativeStatusSlice[4][7:11]) - install, _ = strconv.ParseBool(knativeStatusSlice[7][7:11]) - ready, _ = strconv.ParseBool(knativeStatusSlice[10][7:11]) + dependencies, _ = strconv.ParseBool(knativeStatus[21:26]) + deployments, _ = strconv.ParseBool(knativeStatus[46:51]) + install, _ = strconv.ParseBool(knativeStatus[68:72]) + ready, _ = strconv.ParseBool(knativeStatus[78:82]) - log.Print("knative Serving Install Status:\nDependenciesInstalled=" + knativeStatusSlice[1][7:11] + "\n" + - "DeploymentsAvaliable=" + knativeStatusSlice[4][7:11] + "\n" + "InstallSucceeded=" + knativeStatusSlice[7][7:11] + - "\n" + "Ready=" + knativeStatusSlice[10][7:11] + "\n") + log.Print("knative Serving Install Status:\nDependenciesInstalled=" + knativeStatus[21:26] + "\n" + + "DeploymentsAvaliable=" + knativeStatus[46:51] + "\n" + "InstallSucceeded=" + knativeStatus[68:72] + + "\n" + "Ready=" + knativeStatus[78:82] + "\n") out.Reset() - time.Sleep(5 * time.Second) + time.Sleep(10 * time.Second) } @@ -140,9 +138,15 @@ func knativeStatus() { co.SwitchContext("knative-serving") cmd := get.NewCmdGet("kubectl", co.CurrentFactory, IOStreams) - cmd.Flags().Set("template", "'{{range .status.conditions}}{{printf \"%s=%s\" .type .status}}{{end}}'") + cmd.Flags().Set("template", "{{range .status.conditions}}{{printf \"%s=%s\" .type .status}}{{end}}") cmd.Run(cmd, []string{co.Commands[0]}) - log.Print(out.String()) + //log.Print(out.String()) + knativeStatus := out.String() + out.Reset() + + log.Print("knative Serving Install Status:\nDependenciesInstalled=" + knativeStatus[21:26] + "\n" + + "DeploymentsAvaliable=" + knativeStatus[46:51] + "\n" + "InstallSucceeded=" + knativeStatus[68:72] + + "\n" + "Ready=" + knativeStatus[78:82] + "\n") out.Reset() co.SwitchContext("knative-eventing") diff --git a/cmd/knative-source.go b/cmd/knative-source.go index c79e6ce..61a4d81 100644 --- a/cmd/knative-source.go +++ b/cmd/knative-source.go @@ -92,7 +92,9 @@ func source(source string, sink string) { } defer os.Remove(tmpFile.Name()) - myOutput := utils.RemoteSed(`/^ *sink:/,/^ name:/s/name: .*/name: `+sink+`/`, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/sources/kafka.yaml") + sedCommands := []string{`/^ *sink:/,/^ name:/s/name: .*/name: ` + sink + `/`} + + myOutput := utils.RemoteSed(sedCommands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/knative/sources/kafka.yaml") tmpFile.Write(myOutput.Bytes()) log.Println("the Source file: ", myOutput.String()) diff --git a/cmd/login.go b/cmd/login.go index 7d67089..a15784e 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -28,8 +28,8 @@ import ( func login() { //download Enmasse v0.30.3 - folderName := utils.DownloadAndUncompress("oc.gz", "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz") - log.Println("oc Source folder: ", folderName) + _ = utils.DownloadAndUncompress("oc.gz", "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz") + log.Println("oc Source folder: ", "oc") //Login to OC fmt.Print("Enter Openshift Username: ") var user string @@ -43,12 +43,13 @@ func login() { fmt.Println() - cmd := exec.Command("bash", "-c", "echo "+user+" "+string(password)+"| ./"+folderName+" login") + cmd := exec.Command("bash", "-c", "echo "+user+" "+string(password)+"| ./oc login") cmd.Stdout = os.Stdout err = cmd.Run() if err != nil { log.Fatal(err) } + os.Remove("oc") } diff --git a/cmd/templates/namespace.go b/cmd/templates/namespace.go deleted file mode 100644 index e69de29..0000000 diff --git a/cmd/tensorflowServing-destroy.go b/cmd/tensorflowServing-destroy.go new file mode 100644 index 0000000..72655f6 --- /dev/null +++ b/cmd/tensorflowServing-destroy.go @@ -0,0 +1,80 @@ +/* +Copyright © 2020 NAME HERE + +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. +*/ +package cmd + +import ( + "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/kubectl/pkg/cmd/delete" + "log" +) + +func tensorflowServingDestroy() { + + co := utils.NewCommandOptions() + + co.Commands = append(co.Commands, "tensorflow-deployment") + co.Commands = append(co.Commands, "coco-service") + + IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() + + co.SwitchContext(tensorflowServingNamespaceFlag) + + //Reload config flags after switching context + + log.Println("Provision Tensorflow Serving Pod") + for commandNumber, command := range co.Commands { + cmd := delete.NewCmdDelete(co.CurrentFactory, IOStreams) + if commandNumber == 0 { + cmd.Run(cmd, []string{"deployment", command}) + } else { + cmd.Run(cmd, []string{"service", command}) + } + log.Print(out.String()) + out.Reset() + } +} + +// tensorflowServingDestroyCmd represents the tensorflowServingDestroy command +var tensorflowServingDestroyCmd = &cobra.Command{ + Use: "destroy", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + log.Println("tensorflowServingDestroy called") + tensorflowServingDestroy() + }, +} + +func init() { + tensorflowServingCmd.AddCommand(tensorflowServingDestroyCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // tensorflowServingDestroyCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // tensorflowServingDestroyCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/tensorflowServing-setup.go b/cmd/tensorflowServing-setup.go new file mode 100644 index 0000000..f81fc8b --- /dev/null +++ b/cmd/tensorflowServing-setup.go @@ -0,0 +1,78 @@ +/* +Copyright © 2020 NAME HERE + +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. +*/ +package cmd + +import ( + "github.com/IoTCLI/cmd/utils" + "github.com/spf13/cobra" + "k8s.io/cli-runtime/pkg/genericclioptions" + "k8s.io/kubectl/pkg/cmd/apply" + "log" +) + +func tensorflowServingSetup() { + + co := utils.NewCommandOptions() + + co.Commands = append(co.Commands, "https://raw.githubusercontent.com/redhat-iot/iot-dev/master/yamls/tensorflow/setup/tensorflowServing.yaml") + + IOStreams, _, out, _ := genericclioptions.NewTestIOStreams() + + co.SwitchContext(tensorflowServingNamespaceFlag) + + //Reload config flags after switching context + + log.Println("Provision Tensorflow Serving Pod") + for _, command := range co.Commands { + cmd := apply.NewCmdApply("kubectl", co.CurrentFactory, IOStreams) + err := cmd.Flags().Set("filename", command) + if err != nil { + log.Fatal(err) + } + cmd.Run(cmd, []string{}) + log.Print(out.String()) + out.Reset() + } +} + +// tensorflowServingSetupCmd represents the tensorflowServingSetup command +var tensorflowServingSetupCmd = &cobra.Command{ + Use: "setup", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + log.Println("tensorflowServing Setup called") + tensorflowServingSetup() + }, +} + +func init() { + tensorflowServingCmd.AddCommand(tensorflowServingSetupCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // tensorflowServingSetupCmd.PersistentFlags().String("foo", "", "A help for foo") + + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: +} diff --git a/cmd/tensorflowServing.go b/cmd/tensorflowServing.go new file mode 100644 index 0000000..ae9a49e --- /dev/null +++ b/cmd/tensorflowServing.go @@ -0,0 +1,55 @@ +/* +Copyright © 2020 NAME HERE + +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. +*/ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var ( + tensorflowServingNamespaceFlag string +) + +// tensorflowServingCmd represents the tensorflowServing command +var tensorflowServingCmd = &cobra.Command{ + Use: "tensorflowServing", + Short: "A brief description of your command", + Long: `A longer description that spans multiple lines and likely contains examples +and usage of using your command. For example: + +Cobra is a CLI library for Go that empowers applications. +This application is a tool to generate the needed files +to quickly create a Cobra application.`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("tensorflowServing called") + }, +} + +func init() { + rootCmd.AddCommand(tensorflowServingCmd) + + // Here you will define your flags and configuration settings. + + // Cobra supports Persistent Flags which will work for this command + // and all subcommands, e.g.: + // tensorflowServingCmd.PersistentFlags().String("foo", "", "A help for foo") + tensorflowServingCmd.PersistentFlags().StringVarP(&tensorflowServingNamespaceFlag, "namespace", "n", "default", "Option to specify namespace for Tensorflow Serving Deployment, defaults to 'default'") + // Cobra supports local flags which will only run when this command + // is called directly, e.g.: + // tensorflowServingCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} diff --git a/cmd/utils/emulate-sed.go b/cmd/utils/emulate-sed.go index b132c2e..f80d932 100644 --- a/cmd/utils/emulate-sed.go +++ b/cmd/utils/emulate-sed.go @@ -14,18 +14,29 @@ import ( //RemoteSed ... //Use this function to emulate the bash Sed command in golang -func RemoteSed(command string, url string) *bytes.Buffer { +func RemoteSed(commands []string, url string) *bytes.Buffer { resp, err := http.Get(url) if err != nil { log.Fatal(err) } defer resp.Body.Close() + originalFile := new(bytes.Buffer) + originalFile.ReadFrom(resp.Body) + //editedFile := new(bytes.Buffer) - engine, err := sed.New(strings.NewReader(command)) - myOutput := new(bytes.Buffer) - myOutput.ReadFrom(engine.Wrap(resp.Body)) - return myOutput + for _, command := range commands { + tempFile := new(bytes.Buffer) + engine, err := sed.New(strings.NewReader(command)) + if err != nil { + log.Fatal(err) + } + tempFile.ReadFrom(engine.Wrap(originalFile)) + originalFile.Reset() + originalFile = tempFile + + } + return originalFile } diff --git a/cmd/utils/yaml-utils-test.txt b/cmd/utils/yaml-utils-test.txt new file mode 100644 index 0000000..7be5d29 --- /dev/null +++ b/cmd/utils/yaml-utils-test.txt @@ -0,0 +1,3255 @@ +apiVersion: v1 +items: +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.130.0.57" + ], + "dns": {}, + "default-route": [ + "10.130.0.1" + ] + }] + openshift.io/scc: restricted + prometheus.io/port: "9283" + prometheus.io/scrape: "true" + creationTimestamp: "2020-04-21T21:58:54Z" + generateName: rook-ceph-mgr-a-59f5b66c5f- + labels: + app: rook-ceph-mgr + ceph_daemon_id: a + instance: a + mgr: a + pod-template-hash: 59f5b66c5f + rook_cluster: rook-ceph + name: rook-ceph-mgr-a-59f5b66c5f-rdwd6 + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-mgr-a-59f5b66c5f + uid: fc6c697f-af38-4b1e-8d46-6a1c740dfe27 + resourceVersion: "4273796" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-mgr-a-59f5b66c5f-rdwd6 + uid: cf3fcfd9-93d1-420c-9b56-8d119f754b6c + spec: + affinity: {} + containers: + - args: + - --foreground + - --id + - a + command: + - ceph-mgr + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: ROOK_CLUSTER_NAME + value: rook-ceph + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mgr + ports: + - containerPort: 6800 + name: mgr + protocol: TCP + - containerPort: 9283 + name: http-metrics + protocol: TCP + - containerPort: 8443 + name: dashboard + protocol: TCP + resources: {} + securityContext: + capabilities: + drop: + - KILL + - MKNOD + - SETGID + - SETUID + runAsUser: 1000810000 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-mgr-token-wp659 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: rook-ceph-mgr-dockercfg-qs5gl + initContainers: + - args: + - ceph + - mgr-init + - --config-dir=/var/lib/rook + - --mgr-name=a + env: + - name: ROOK_MGR_KEYRING + valueFrom: + secretKeyRef: + key: keyring + name: rook-ceph-mgr-a + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_MGR_MODULE_SERVER_ADDR + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CEPH_VERSION_NAME + value: mimic + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + capabilities: + drop: + - KILL + - MKNOD + - SETGID + - SETUID + runAsUser: 1000810000 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-mgr-token-wp659 + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-mgr + serviceAccountName: rook-ceph-mgr + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - emptyDir: {} + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - name: rook-ceph-mgr-token-wp659 + secret: + defaultMode: 420 + secretName: rook-ceph-mgr-token-wp659 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:59:04Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:59:05Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:59:05Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:58:54Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://9375ad6e5032971ba563ef6260b53a93114af4f1cd9c4ae73b1ecdd0c51cec17 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mgr + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T21:59:04Z" + hostIP: 10.1.0.35 + initContainerStatuses: + - containerID: cri-o://d21e4b9b9a725f8a7d019d713a62ee736bae1b8c3e38982ddc7874063dfb4cbf + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://d21e4b9b9a725f8a7d019d713a62ee736bae1b8c3e38982ddc7874063dfb4cbf + exitCode: 0 + finishedAt: "2020-04-21T21:59:03Z" + reason: Completed + startedAt: "2020-04-21T21:58:49Z" + phase: Running + podIP: 10.130.0.57 + podIPs: + - ip: 10.130.0.57 + qosClass: BestEffort + startTime: "2020-04-21T21:58:46Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.129.0.171" + ], + "dns": {}, + "default-route": [ + "10.129.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T21:57:04Z" + generateName: rook-ceph-mon-a-5669964977- + labels: + app: rook-ceph-mon + ceph_daemon_id: a + mon: a + mon_cluster: rook-ceph + pod-template-hash: "5669964977" + rook_cluster: rook-ceph + name: rook-ceph-mon-a-5669964977-pj7wm + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-mon-a-5669964977 + uid: 5c556d97-0f1d-4ef9-9d8c-d4bb7dc9e335 + resourceVersion: "4273245" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-mon-a-5669964977-pj7wm + uid: ed8e7c7f-f191-4144-bb58-c2d99609707f + spec: + affinity: {} + containers: + - args: + - --foreground + - --public-addr + - 172.30.211.70:6790 + - --name + - mon.a + - --mon-data + - /var/lib/rook/mon-a/data + command: + - ceph-mon + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon + ports: + - containerPort: 6790 + name: client + protocol: TCP + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: default-dockercfg-phmd8 + initContainers: + - args: + - ceph + - mon-init + - --config-dir=/var/lib/rook + - --name=a + - --port=6790 + - --fsid=22c67427-f4fc-42c8-b97b-24e1705a7196 + env: + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + value: 172.30.211.70 + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - /var/lib/rook/mon-a/monmap + - --create + - --clobber + - --fsid + - 22c67427-f4fc-42c8-b97b-24e1705a7196 + - --add + - a + - 172.30.211.70:6790 + command: + - /usr/bin/monmaptool + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: monmap-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - --mkfs + - --monmap + - /var/lib/rook/mon-a/monmap + - --name + - mon.a + - --mon-data + - /var/lib/rook/mon-a/data + command: + - ceph-mon + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon-fs-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-jfbd6 + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-jfbd6 + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - name: default-token-j8ssz + secret: + defaultMode: 420 + secretName: default-token-j8ssz + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:22Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:23Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:23Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:04Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://b68348d4eb74a856445f6a4c91818bbc4b8a6fe461afa99c0d60d0b2c0ec8e86 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T21:57:22Z" + hostIP: 10.1.0.13 + initContainerStatuses: + - containerID: cri-o://bb60b98194bb157c8f3406625f1cc03079483d496e10c8314741e7ac3681cf4a + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://bb60b98194bb157c8f3406625f1cc03079483d496e10c8314741e7ac3681cf4a + exitCode: 0 + finishedAt: "2020-04-21T21:57:04Z" + reason: Completed + startedAt: "2020-04-21T21:57:04Z" + - containerID: cri-o://ad9e2d0f19eb84273a861307770e09a8241623776bdcbdbfc0dbc6fdb162d23a + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: monmap-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://ad9e2d0f19eb84273a861307770e09a8241623776bdcbdbfc0dbc6fdb162d23a + exitCode: 0 + finishedAt: "2020-04-21T21:57:20Z" + reason: Completed + startedAt: "2020-04-21T21:57:20Z" + - containerID: cri-o://b9a9342d979fc54324f20b73782af4d37863f96d0f31204cd9afd403b062324e + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon-fs-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://b9a9342d979fc54324f20b73782af4d37863f96d0f31204cd9afd403b062324e + exitCode: 0 + finishedAt: "2020-04-21T21:57:22Z" + reason: Completed + startedAt: "2020-04-21T21:57:21Z" + phase: Running + podIP: 10.129.0.171 + podIPs: + - ip: 10.129.0.171 + qosClass: BestEffort + startTime: "2020-04-21T21:57:00Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.130.0.56" + ], + "dns": {}, + "default-route": [ + "10.130.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T21:57:29Z" + generateName: rook-ceph-mon-b-85bfd6f7bf- + labels: + app: rook-ceph-mon + ceph_daemon_id: b + mon: b + mon_cluster: rook-ceph + pod-template-hash: 85bfd6f7bf + rook_cluster: rook-ceph + name: rook-ceph-mon-b-85bfd6f7bf-b5kxg + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-mon-b-85bfd6f7bf + uid: 5df5c1d7-03ed-47b1-8c65-fbb115bfbc8f + resourceVersion: "4273330" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-mon-b-85bfd6f7bf-b5kxg + uid: ef37b724-a07c-4ae1-b14a-8b47357dd47c + spec: + affinity: {} + containers: + - args: + - --foreground + - --public-addr + - 172.30.180.181:6790 + - --name + - mon.b + - --mon-data + - /var/lib/rook/mon-b/data + command: + - ceph-mon + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon + ports: + - containerPort: 6790 + name: client + protocol: TCP + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: default-dockercfg-phmd8 + initContainers: + - args: + - ceph + - mon-init + - --config-dir=/var/lib/rook + - --name=b + - --port=6790 + - --fsid=22c67427-f4fc-42c8-b97b-24e1705a7196 + env: + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + value: 172.30.180.181 + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - /var/lib/rook/mon-b/monmap + - --create + - --clobber + - --fsid + - 22c67427-f4fc-42c8-b97b-24e1705a7196 + - --add + - a + - 172.30.211.70:6790 + - --add + - b + - 172.30.180.181:6790 + command: + - /usr/bin/monmaptool + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: monmap-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - --mkfs + - --monmap + - /var/lib/rook/mon-b/monmap + - --name + - mon.b + - --mon-data + - /var/lib/rook/mon-b/data + command: + - ceph-mon + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon-fs-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-qmjmh + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - name: default-token-j8ssz + secret: + defaultMode: 420 + secretName: default-token-j8ssz + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:27Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:28Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:28Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:29Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://0433a989e6f15a3d8be4068b33b6fac6783b7077650c5f07b5c9fc298985ae3b + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T21:57:27Z" + hostIP: 10.1.0.35 + initContainerStatuses: + - containerID: cri-o://6e84d7c67fe3285570e470aefbf08d411df6fa49dd6ada88644930bec632abf8 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://6e84d7c67fe3285570e470aefbf08d411df6fa49dd6ada88644930bec632abf8 + exitCode: 0 + finishedAt: "2020-04-21T21:57:25Z" + reason: Completed + startedAt: "2020-04-21T21:57:25Z" + - containerID: cri-o://731e89c2faab127b470aadc83b7e2a901bdb3f93ebbbef071a5d9762c7d78d01 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: monmap-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://731e89c2faab127b470aadc83b7e2a901bdb3f93ebbbef071a5d9762c7d78d01 + exitCode: 0 + finishedAt: "2020-04-21T21:57:25Z" + reason: Completed + startedAt: "2020-04-21T21:57:25Z" + - containerID: cri-o://adfdd90ce3e6c94c75374bf91fea80667374c3ae0ceaa491a4cecf574ad0f683 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon-fs-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://adfdd90ce3e6c94c75374bf91fea80667374c3ae0ceaa491a4cecf574ad0f683 + exitCode: 0 + finishedAt: "2020-04-21T21:57:26Z" + reason: Completed + startedAt: "2020-04-21T21:57:26Z" + phase: Running + podIP: 10.130.0.56 + podIPs: + - ip: 10.130.0.56 + qosClass: BestEffort + startTime: "2020-04-21T21:57:22Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.131.0.27" + ], + "dns": {}, + "default-route": [ + "10.131.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T21:57:41Z" + generateName: rook-ceph-mon-c-f6bc79758- + labels: + app: rook-ceph-mon + ceph_daemon_id: c + mon: c + mon_cluster: rook-ceph + pod-template-hash: f6bc79758 + rook_cluster: rook-ceph + name: rook-ceph-mon-c-f6bc79758-smn8p + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-mon-c-f6bc79758 + uid: 85f3e6aa-3934-4777-ab74-4c6456d28dc2 + resourceVersion: "4273485" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-mon-c-f6bc79758-smn8p + uid: 77acdea0-51f7-4a83-bb5f-3f35da7ca6eb + spec: + affinity: {} + containers: + - args: + - --foreground + - --public-addr + - 172.30.52.100:6790 + - --name + - mon.c + - --mon-data + - /var/lib/rook/mon-c/data + command: + - ceph-mon + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon + ports: + - containerPort: 6790 + name: client + protocol: TCP + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: default-dockercfg-phmd8 + initContainers: + - args: + - ceph + - mon-init + - --config-dir=/var/lib/rook + - --name=c + - --port=6790 + - --fsid=22c67427-f4fc-42c8-b97b-24e1705a7196 + env: + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + value: 172.30.52.100 + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - /var/lib/rook/mon-c/monmap + - --create + - --clobber + - --fsid + - 22c67427-f4fc-42c8-b97b-24e1705a7196 + - --add + - a + - 172.30.211.70:6790 + - --add + - b + - 172.30.180.181:6790 + - --add + - c + - 172.30.52.100:6790 + command: + - /usr/bin/monmaptool + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: monmap-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + - args: + - --mkfs + - --monmap + - /var/lib/rook/mon-c/monmap + - --name + - mon.c + - --mon-data + - /var/lib/rook/mon-c/data + command: + - ceph-mon + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: mon-fs-init + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-r7nbp + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-r7nbp + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - name: default-token-j8ssz + secret: + defaultMode: 420 + secretName: default-token-j8ssz + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:10Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:11Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:11Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:41Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://6edc8590f52af090cbdfbd6a070ebe567f1b5f7f75561bd71119e365a3e4e553 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T21:57:11Z" + hostIP: 10.1.0.16 + initContainerStatuses: + - containerID: cri-o://f021b682dd96509d42d217ad883966484761859230037a3765ff5ad97fbdd15c + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://f021b682dd96509d42d217ad883966484761859230037a3765ff5ad97fbdd15c + exitCode: 0 + finishedAt: "2020-04-21T21:56:56Z" + reason: Completed + startedAt: "2020-04-21T21:56:56Z" + - containerID: cri-o://67e7d0c06d931d36d51bd1b72bb465107137bd4eb3e62c805c8c0a60aa048005 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: monmap-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://67e7d0c06d931d36d51bd1b72bb465107137bd4eb3e62c805c8c0a60aa048005 + exitCode: 0 + finishedAt: "2020-04-21T21:57:09Z" + reason: Completed + startedAt: "2020-04-21T21:57:09Z" + - containerID: cri-o://a73d8d11ad39a96c0620ff8cd1f90148cb62a8da45bb175891fb67cf203ff3ed + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: mon-fs-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://a73d8d11ad39a96c0620ff8cd1f90148cb62a8da45bb175891fb67cf203ff3ed + exitCode: 0 + finishedAt: "2020-04-21T21:57:10Z" + reason: Completed + startedAt: "2020-04-21T21:57:09Z" + phase: Running + podIP: 10.131.0.27 + podIPs: + - ip: 10.131.0.27 + qosClass: BestEffort + startTime: "2020-04-21T21:56:54Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.129.0.173" + ], + "dns": {}, + "default-route": [ + "10.129.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:01:42Z" + generateName: rook-ceph-osd-0-765d9cd445- + labels: + app: rook-ceph-osd + ceph-osd-id: "0" + pod-template-hash: 765d9cd445 + rook_cluster: rook-ceph + name: rook-ceph-osd-0-765d9cd445-qx8br + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-osd-0-765d9cd445 + uid: 0f83f56d-49b5-4325-8e56-1f1aee50b4e5 + resourceVersion: "4274710" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-0-765d9cd445-qx8br + uid: 31698a62-bc9c-49c6-a409-e95024c1f257 + spec: + affinity: {} + containers: + - args: + - --foreground + - --id + - "0" + - --conf + - /var/lib/rook/osd0/rook-ceph.config + - --osd-data + - /var/lib/rook/osd0 + - --keyring + - /var/lib/rook/osd0/keyring + - --cluster + - rook-ceph + - --osd-uuid + - 95e6e518-69d8-44e2-8bb5-49abc664d17e + - --osd-journal=/var/lib/rook/osd0/journal + command: + - ceph-osd + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-jfbd6 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: TINI_SUBREAPER + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: ROOK_OSD_UUID + value: 95e6e518-69d8-44e2-8bb5-49abc664d17e + - name: ROOK_OSD_ID + value: "0" + - name: ROOK_OSD_STORE_TYPE + value: filestore + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: osd + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + hostPID: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + initContainers: + - args: + - ceph + - osd + - init + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-jfbd6 + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + - name: TINI_SUBREAPER + - name: ROOK_OSD_ID + value: "0" + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-jfbd6 + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-jfbd6 + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:44Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:45Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:45Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:42Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://b0def410ea4de55a4ce93c86407ad0a59536836f631ec1122dc3deeb171c8f6a + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: osd + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T22:01:44Z" + hostIP: 10.1.0.13 + initContainerStatuses: + - containerID: cri-o://6572125d5a3f4a448c302af0035b8a86cc7537806cff8e095dc12711cad2368b + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://6572125d5a3f4a448c302af0035b8a86cc7537806cff8e095dc12711cad2368b + exitCode: 0 + finishedAt: "2020-04-21T22:01:42Z" + reason: Completed + startedAt: "2020-04-21T22:01:42Z" + - containerID: cri-o://0e39f27a97308c1e0b669a9b46556deb5792dc040581d3e285202181694dbc9f + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://0e39f27a97308c1e0b669a9b46556deb5792dc040581d3e285202181694dbc9f + exitCode: 0 + finishedAt: "2020-04-21T22:01:43Z" + reason: Completed + startedAt: "2020-04-21T22:01:43Z" + phase: Running + podIP: 10.129.0.173 + podIPs: + - ip: 10.129.0.173 + qosClass: BestEffort + startTime: "2020-04-21T22:01:39Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.130.0.59" + ], + "dns": {}, + "default-route": [ + "10.130.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:02:11Z" + generateName: rook-ceph-osd-1-7b9cfb9964- + labels: + app: rook-ceph-osd + ceph-osd-id: "1" + pod-template-hash: 7b9cfb9964 + rook_cluster: rook-ceph + name: rook-ceph-osd-1-7b9cfb9964-tnm5j + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-osd-1-7b9cfb9964 + uid: 099f874d-e6e7-4c10-9731-387974fa5171 + resourceVersion: "4274975" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-1-7b9cfb9964-tnm5j + uid: 1d31b7e5-7781-4f16-8376-d001c164066b + spec: + affinity: {} + containers: + - args: + - --foreground + - --id + - "1" + - --conf + - /var/lib/rook/osd1/rook-ceph.config + - --osd-data + - /var/lib/rook/osd1 + - --keyring + - /var/lib/rook/osd1/keyring + - --cluster + - rook-ceph + - --osd-uuid + - acbc2909-fbab-40db-94c5-68831ec1229b + - --osd-journal=/var/lib/rook/osd1/journal + command: + - ceph-osd + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-qmjmh + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: TINI_SUBREAPER + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: ROOK_OSD_UUID + value: acbc2909-fbab-40db-94c5-68831ec1229b + - name: ROOK_OSD_ID + value: "1" + - name: ROOK_OSD_STORE_TYPE + value: filestore + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: osd + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + hostPID: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + initContainers: + - args: + - ceph + - osd + - init + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-qmjmh + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + - name: TINI_SUBREAPER + - name: ROOK_OSD_ID + value: "1" + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-qmjmh + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:02:07Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:02:08Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:02:08Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:02:11Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://0925db04bb2f12f9bfb085665ca42e87cdce976dc5bc9a0196a7fa07053846fb + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: osd + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T22:02:08Z" + hostIP: 10.1.0.35 + initContainerStatuses: + - containerID: cri-o://f0bcda797950ea6b7e12de993f68a59b715c2c9472a0ce8be9f819bb4a47eb9c + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://f0bcda797950ea6b7e12de993f68a59b715c2c9472a0ce8be9f819bb4a47eb9c + exitCode: 0 + finishedAt: "2020-04-21T22:02:06Z" + reason: Completed + startedAt: "2020-04-21T22:02:05Z" + - containerID: cri-o://e43cc96f941bec886cfab8477113dae2f45db36f5017e2027dc413b2236284ad + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://e43cc96f941bec886cfab8477113dae2f45db36f5017e2027dc413b2236284ad + exitCode: 0 + finishedAt: "2020-04-21T22:02:07Z" + reason: Completed + startedAt: "2020-04-21T22:02:07Z" + phase: Running + podIP: 10.130.0.59 + podIPs: + - ip: 10.130.0.59 + qosClass: BestEffort + startTime: "2020-04-21T22:02:03Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.131.0.29" + ], + "dns": {}, + "default-route": [ + "10.131.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:02:25Z" + generateName: rook-ceph-osd-2-69ff64744d- + labels: + app: rook-ceph-osd + ceph-osd-id: "2" + pod-template-hash: 69ff64744d + rook_cluster: rook-ceph + name: rook-ceph-osd-2-69ff64744d-p7gm2 + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-osd-2-69ff64744d + uid: a7547ad5-a814-49b0-bf7c-19e17e819939 + resourceVersion: "4275077" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-2-69ff64744d-p7gm2 + uid: 7abd111a-fe38-4ee2-9c19-c2014afe20d6 + spec: + affinity: {} + containers: + - args: + - --foreground + - --id + - "2" + - --conf + - /var/lib/rook/osd2/rook-ceph.config + - --osd-data + - /var/lib/rook/osd2 + - --keyring + - /var/lib/rook/osd2/keyring + - --cluster + - rook-ceph + - --osd-uuid + - d353eefe-68eb-4ae5-9425-a7c9053e0086 + - --osd-journal=/var/lib/rook/osd2/journal + command: + - ceph-osd + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-r7nbp + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: TINI_SUBREAPER + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: ROOK_OSD_UUID + value: d353eefe-68eb-4ae5-9425-a7c9053e0086 + - name: ROOK_OSD_ID + value: "2" + - name: ROOK_OSD_STORE_TYPE + value: filestore + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: osd + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + hostPID: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + initContainers: + - args: + - ceph + - osd + - init + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-r7nbp + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + - name: TINI_SUBREAPER + - name: ROOK_OSD_ID + value: "2" + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-r7nbp + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-r7nbp + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:42Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:43Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:43Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:02:25Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://b6b520e6c3b85ac8d9b3835c2c6443bbd92499f5982cc71a74b394ad6fcb19e0 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: osd + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T22:01:42Z" + hostIP: 10.1.0.16 + initContainerStatuses: + - containerID: cri-o://a5f8bea1929e68facdb7e8152d725c93c71617c6b388e2e4ff99cf680335dec6 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://a5f8bea1929e68facdb7e8152d725c93c71617c6b388e2e4ff99cf680335dec6 + exitCode: 0 + finishedAt: "2020-04-21T22:01:40Z" + reason: Completed + startedAt: "2020-04-21T22:01:40Z" + - containerID: cri-o://012a5ad33b9f6f4ce44330383a234933667349f46c7330099fb608d087620970 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://012a5ad33b9f6f4ce44330383a234933667349f46c7330099fb608d087620970 + exitCode: 0 + finishedAt: "2020-04-21T22:01:42Z" + reason: Completed + startedAt: "2020-04-21T22:01:41Z" + phase: Running + podIP: 10.131.0.29 + podIPs: + - ip: 10.131.0.29 + qosClass: BestEffort + startTime: "2020-04-21T22:01:38Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: "" + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:01:10Z" + generateName: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-jfbd6- + labels: + app: rook-ceph-osd-prepare + controller-uid: ed7b1627-35c0-46d3-b004-5132a2ce3364 + job-name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-jfbd6 + rook_cluster: rook-ceph + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-jfbd6-nxgmt + namespace: rook-ceph + ownerReferences: + - apiVersion: batch/v1 + blockOwnerDeletion: true + controller: true + kind: Job + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-jfbd6 + uid: ed7b1627-35c0-46d3-b004-5132a2ce3364 + resourceVersion: "4274653" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-jfbd6-nxgmt + uid: 10c20d8c-67be-42cc-823a-d724fc369f63 + spec: + affinity: {} + containers: + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - -- + - /rook/rook + - ceph + - osd + - provision + command: + - /rook/tini + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-jfbd6 + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: provision + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + nodeName: astoycos-ocp-vlft2-worker-jfbd6 + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-jfbd6 + priority: 0 + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:06Z" + reason: PodCompleted + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:06Z" + reason: PodCompleted + status: "False" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:06Z" + reason: PodCompleted + status: "False" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:10Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://9a5d73cfa829473f4f1de456714289bcb12931f720917856fa12eb0f59cab13f + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://9a5d73cfa829473f4f1de456714289bcb12931f720917856fa12eb0f59cab13f + exitCode: 0 + finishedAt: "2020-04-21T22:01:09Z" + reason: Completed + startedAt: "2020-04-21T22:01:09Z" + - containerID: cri-o://05edd36480a122449cc6e805f0f16e0cfd27edca60e71a911d6cd870b6a55519 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: provision + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://05edd36480a122449cc6e805f0f16e0cfd27edca60e71a911d6cd870b6a55519 + exitCode: 0 + finishedAt: "2020-04-21T22:01:39Z" + reason: Completed + startedAt: "2020-04-21T22:01:10Z" + hostIP: 10.1.0.13 + phase: Succeeded + podIP: 10.129.0.172 + podIPs: + - ip: 10.129.0.172 + qosClass: BestEffort + startTime: "2020-04-21T22:01:06Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: "" + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:01:10Z" + generateName: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-qmjmh- + labels: + app: rook-ceph-osd-prepare + controller-uid: 0886ab99-f932-4705-8ddd-e1d2f6c90c4d + job-name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-qmjmh + rook_cluster: rook-ceph + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-qmjmh-2szlf + namespace: rook-ceph + ownerReferences: + - apiVersion: batch/v1 + blockOwnerDeletion: true + controller: true + kind: Job + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-qmjmh + uid: 0886ab99-f932-4705-8ddd-e1d2f6c90c4d + resourceVersion: "4274994" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-qmjmh-2szlf + uid: af30e30b-5494-4bb4-b4ae-30e78e47b1cb + spec: + affinity: {} + containers: + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - -- + - /rook/rook + - ceph + - osd + - provision + command: + - /rook/tini + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-qmjmh + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: provision + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + nodeName: astoycos-ocp-vlft2-worker-qmjmh + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:02Z" + reason: PodCompleted + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:02Z" + reason: PodCompleted + status: "False" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:02Z" + reason: PodCompleted + status: "False" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:10Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://9571735b7a05726acd032ef3f26fca1caa3a1578f391eb3470448240b6209497 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://9571735b7a05726acd032ef3f26fca1caa3a1578f391eb3470448240b6209497 + exitCode: 0 + finishedAt: "2020-04-21T22:01:05Z" + reason: Completed + startedAt: "2020-04-21T22:01:05Z" + - containerID: cri-o://7512d0d887ed6f5498f88c09711089a5233225dd26147642d31878365c4c2353 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: provision + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://7512d0d887ed6f5498f88c09711089a5233225dd26147642d31878365c4c2353 + exitCode: 0 + finishedAt: "2020-04-21T22:02:03Z" + reason: Completed + startedAt: "2020-04-21T22:01:05Z" + hostIP: 10.1.0.35 + phase: Succeeded + podIP: 10.130.0.58 + podIPs: + - ip: 10.130.0.58 + qosClass: BestEffort + startTime: "2020-04-21T22:01:02Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.131.0.28" + ], + "dns": {}, + "default-route": [ + "10.131.0.1" + ] + }] + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T22:01:10Z" + generateName: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-r7nbp- + labels: + app: rook-ceph-osd-prepare + controller-uid: 1dabaa36-5b6f-49cd-b87a-90d01789d087 + job-name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-r7nbp + rook_cluster: rook-ceph + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-r7nbp-q9jb6 + namespace: rook-ceph + ownerReferences: + - apiVersion: batch/v1 + blockOwnerDeletion: true + controller: true + kind: Job + name: rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-r7nbp + uid: 1dabaa36-5b6f-49cd-b87a-90d01789d087 + resourceVersion: "4275038" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-osd-prepare-astoycos-ocp-vlft2-worker-r7nbp-q9jb6 + uid: 9b848582-ff69-41dd-805d-0889cabdbe3a + spec: + affinity: {} + containers: + - args: + - ceph + - osd + - copybins + env: + - name: ROOK_PATH + value: /rook + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: copy-bins + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + - args: + - -- + - /rook/rook + - ceph + - osd + - provision + command: + - /rook/tini + env: + - name: ROOK_NODE_NAME + value: astoycos-ocp-vlft2-worker-r7nbp + - name: ROOK_CLUSTER_ID + value: a94c7d79-798a-49d2-b838-2628e5019de5 + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + - name: ROOK_CONFIG_DIR + value: /var/lib/rook + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + - name: ROOK_FSID + valueFrom: + secretKeyRef: + key: fsid + name: rook-ceph-mon + - name: ROOK_OSD_DATABASE_SIZE + value: "1024" + - name: ROOK_OSD_JOURNAL_SIZE + value: "1024" + - name: ROOK_OSDS_PER_DEVICE + value: "1" + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: provision + resources: {} + securityContext: + privileged: true + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsUser: 0 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /rook + name: rook-binaries + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: rook-ceph-osd-token-nqs62 + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: rook-ceph-osd-dockercfg-fjpfw + nodeName: astoycos-ocp-vlft2-worker-r7nbp + nodeSelector: + kubernetes.io/hostname: astoycos-ocp-vlft2-worker-r7nbp + priority: 0 + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: rook-ceph-osd + serviceAccountName: rook-ceph-osd + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /var/lib/rook + type: "" + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - emptyDir: {} + name: rook-binaries + - name: rook-ceph-osd-token-nqs62 + secret: + defaultMode: 420 + secretName: rook-ceph-osd-token-nqs62 + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:00:22Z" + reason: PodCompleted + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:00:22Z" + reason: PodCompleted + status: "False" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:00:22Z" + reason: PodCompleted + status: "False" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:01:10Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://acacce8d2e84a1fb349181a0b7be82bec851eece98ba028251f1ca4ac686b223 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: copy-bins + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://acacce8d2e84a1fb349181a0b7be82bec851eece98ba028251f1ca4ac686b223 + exitCode: 0 + finishedAt: "2020-04-21T22:00:25Z" + reason: Completed + startedAt: "2020-04-21T22:00:25Z" + - containerID: cri-o://39f46bb0efe9bf347991e8a0f5780fd767e14096ecea46dd1e8f0fe538f82eec + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: provision + ready: false + restartCount: 0 + started: false + state: + terminated: + containerID: cri-o://39f46bb0efe9bf347991e8a0f5780fd767e14096ecea46dd1e8f0fe538f82eec + exitCode: 0 + finishedAt: "2020-04-21T22:01:37Z" + reason: Completed + startedAt: "2020-04-21T22:00:26Z" + hostIP: 10.1.0.16 + phase: Succeeded + podIP: 10.131.0.28 + podIPs: + - ip: 10.131.0.28 + qosClass: BestEffort + startTime: "2020-04-21T22:00:22Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + k8s.v1.cni.cncf.io/networks-status: |- + [{ + "name": "openshift-sdn", + "interface": "eth0", + "ips": [ + "10.130.0.60" + ], + "dns": {}, + "default-route": [ + "10.130.0.1" + ] + }] + openshift.io/scc: restricted + creationTimestamp: "2020-04-21T22:07:50Z" + generateName: rook-ceph-rgw-my-store-8585c445b4- + labels: + app: rook-ceph-rgw + pod-template-hash: 8585c445b4 + rook_cluster: rook-ceph + rook_object_store: my-store + name: rook-ceph-rgw-my-store-8585c445b4-4dgk7 + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-rgw-my-store-8585c445b4 + uid: 79831b17-d772-47b2-bc18-29903bba6b4d + resourceVersion: "4276760" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-rgw-my-store-8585c445b4-4dgk7 + uid: bca470b7-bbf9-4701-8d09-08dc3c182183 + spec: + affinity: {} + containers: + - args: + - --foreground + - --name=client.radosgw.gateway + - --rgw-mime-types-file=/var/lib/rook/rgw/mime.types + command: + - radosgw + env: + - name: POD_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.name + - name: POD_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + image: ceph/ceph:v13.2.4-20190109 + imagePullPolicy: IfNotPresent + name: rgw + resources: {} + securityContext: + capabilities: + drop: + - KILL + - MKNOD + - SETGID + - SETUID + runAsUser: 1000810000 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + imagePullSecrets: + - name: default-dockercfg-phmd8 + initContainers: + - args: + - ceph + - rgw + - --config-dir=/var/lib/rook + - --rgw-name=my-store + - --rgw-port=8080 + - --rgw-secure-port=0 + env: + - name: ROOK_RGW_KEYRING + valueFrom: + secretKeyRef: + key: keyring + name: rook-ceph-rgw-my-store + - name: ROOK_PRIVATE_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_PUBLIC_IP + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: status.podIP + - name: ROOK_CLUSTER_NAME + value: rook-ceph + - name: ROOK_MON_ENDPOINTS + valueFrom: + configMapKeyRef: + key: data + name: rook-ceph-mon-endpoints + - name: ROOK_MON_SECRET + valueFrom: + secretKeyRef: + key: mon-secret + name: rook-ceph-mon + - name: ROOK_CEPH_CONFIG_OVERRIDE + value: /etc/rook/config/override.conf + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: config-init + resources: {} + securityContext: + capabilities: + drop: + - KILL + - MKNOD + - SETGID + - SETUID + runAsUser: 1000810000 + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /var/lib/rook + name: rook-data + - mountPath: /etc/ceph + name: ceph-default-config-dir + - mountPath: /etc/rook/config + name: rook-config-override + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + nodeName: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - emptyDir: {} + name: rook-data + - emptyDir: {} + name: ceph-default-config-dir + - configMap: + defaultMode: 420 + items: + - key: config + path: override.conf + name: rook-config-override + name: rook-config-override + - name: default-token-j8ssz + secret: + defaultMode: 420 + secretName: default-token-j8ssz + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:07:45Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:07:46Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:07:46Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T22:07:50Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://689a2a902b6c0e6204d8c2f35961bcdfc7970e557839b18a2f83ecd20d1535b0 + image: docker.io/ceph/ceph:v13.2.4-20190109 + imageID: docker.io/ceph/ceph@sha256:67d0a25ddde36ae0e308617780976f2436f239f6e4a4396a388fe435487d1535 + lastState: {} + name: rgw + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T22:07:46Z" + hostIP: 10.1.0.35 + initContainerStatuses: + - containerID: cri-o://b607e24d1f1748ffbf349a53a9bb25290f6c34e909cfcd6a54f029ae9b4ea150 + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: config-init + ready: true + restartCount: 0 + state: + terminated: + containerID: cri-o://b607e24d1f1748ffbf349a53a9bb25290f6c34e909cfcd6a54f029ae9b4ea150 + exitCode: 0 + finishedAt: "2020-04-21T22:07:45Z" + reason: Completed + startedAt: "2020-04-21T22:07:45Z" + phase: Running + podIP: 10.130.0.60 + podIPs: + - ip: 10.130.0.60 + qosClass: BestEffort + startTime: "2020-04-21T22:07:42Z" +- apiVersion: v1 + kind: Pod + metadata: + annotations: + openshift.io/scc: rook-ceph + creationTimestamp: "2020-04-21T21:56:30Z" + generateName: rook-ceph-tools-78bddc766- + labels: + app: rook-ceph-tools + pod-template-hash: 78bddc766 + name: rook-ceph-tools-78bddc766-fglfd + namespace: rook-ceph + ownerReferences: + - apiVersion: apps/v1 + blockOwnerDeletion: true + controller: true + kind: ReplicaSet + name: rook-ceph-tools-78bddc766 + uid: 0c833ded-9574-46b6-b630-7d2525a00192 + resourceVersion: "4273331" + selfLink: /api/v1/namespaces/rook-ceph/pods/rook-ceph-tools-78bddc766-fglfd + uid: 1bbff728-5fbe-46c7-9e56-a5ca76cade73 + spec: + containers: + - args: + - -g + - -- + - /usr/local/bin/toolbox.sh + command: + - /tini + env: + - name: ROOK_ADMIN_SECRET + valueFrom: + secretKeyRef: + key: admin-secret + name: rook-ceph-mon + image: rook/ceph:v0.9.3 + imagePullPolicy: IfNotPresent + name: rook-ceph-tools + resources: {} + securityContext: + privileged: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /dev + name: dev + - mountPath: /sys/bus + name: sysbus + - mountPath: /lib/modules + name: libmodules + - mountPath: /etc/rook + name: mon-endpoint-volume + - mountPath: /var/run/secrets/kubernetes.io/serviceaccount + name: default-token-j8ssz + readOnly: true + dnsPolicy: ClusterFirstWithHostNet + enableServiceLinks: true + hostNetwork: true + imagePullSecrets: + - name: default-dockercfg-phmd8 + nodeName: astoycos-ocp-vlft2-worker-qmjmh + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 1000810000 + seLinuxOptions: + level: s0:c28,c27 + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - hostPath: + path: /dev + type: "" + name: dev + - hostPath: + path: /sys/bus + type: "" + name: sysbus + - hostPath: + path: /lib/modules + type: "" + name: libmodules + - configMap: + defaultMode: 420 + items: + - key: data + path: mon-endpoints + name: rook-ceph-mon-endpoints + name: mon-endpoint-volume + - name: default-token-j8ssz + secret: + defaultMode: 420 + secretName: default-token-j8ssz + status: + conditions: + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:56:23Z" + status: "True" + type: Initialized + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:28Z" + status: "True" + type: Ready + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:57:28Z" + status: "True" + type: ContainersReady + - lastProbeTime: null + lastTransitionTime: "2020-04-21T21:56:30Z" + status: "True" + type: PodScheduled + containerStatuses: + - containerID: cri-o://b7a420e44ada0d3a3f62649d00b888335ecee39f730d1a5492fcf8d4ccab2bfb + image: docker.io/rook/ceph:v0.9.3 + imageID: docker.io/rook/ceph@sha256:38ba0ae4e3a0a0c3b5e5a4605f58d47e997f06b2a19ad2a35d4a2bd9268d3b30 + lastState: {} + name: rook-ceph-tools + ready: true + restartCount: 0 + started: true + state: + running: + startedAt: "2020-04-21T21:57:28Z" + hostIP: 10.1.0.35 + phase: Running + podIP: 10.1.0.35 + podIPs: + - ip: 10.1.0.35 + qosClass: BestEffort + startTime: "2020-04-21T21:56:23Z" +kind: List +metadata: + resourceVersion: "" + selfLink: "" diff --git a/cmd/utils/yaml-utils.go b/cmd/utils/yaml-utils.go new file mode 100644 index 0000000..43d06d8 --- /dev/null +++ b/cmd/utils/yaml-utils.go @@ -0,0 +1,83 @@ +package utils + +import ( + "log" + + ypg "gopkg.in/yaml.v2" +) + +//PodStatus ... +type PodStatus struct { + podCount int + Pending int + Running int + Succeeded int + Failed int + Unknown int +} + +func NewpodStatus() *PodStatus { + return &PodStatus{ + podCount: 0, + Pending: 0, + Running: 0, + Succeeded: 0, + Failed: 0, + Unknown: 0, + } +} + +//CountPods ... +func (podStatus *PodStatus) CountPods(yaml []byte) { + //Make sure all counts are 0 + podStatus.podCount = 0 + podStatus.Pending = 0 + podStatus.Running = 0 + podStatus.Succeeded = 0 + podStatus.Failed = 0 + podStatus.Unknown = 0 + + m := make(map[string]interface{}) + //mItems := make(map[string]interface{}) + + err := ypg.Unmarshal([]byte(yaml), &m) + if err != nil { + log.Fatalf("error: %v", err) + } + //fmt.Printf("--- m:\n%v\n\n", m["items"].(string)) + for key, itemMap := range m { + if key == "items" { + for key := range itemMap.([]interface{}) { + kind := itemMap.([]interface{})[key].(map[interface{}]interface{})["kind"].(string) + statusMap := itemMap.([]interface{})[key].(map[interface{}]interface{})["status"] + if kind == "Pod" { + for statusKey, phase := range statusMap.(map[interface{}]interface{}) { + if statusKey == "phase" { + if phase.(string) == "Running" { + podStatus.Running++ + podStatus.podCount++ + } else if phase.(string) == "Succeeded" { + podStatus.Succeeded++ + podStatus.podCount++ + } else if phase.(string) == "Pending" { + podStatus.Pending++ + podStatus.podCount++ + } else if phase.(string) == "Failed" { + podStatus.Failed++ + podStatus.podCount++ + } else if phase.(string) == "Unknown" { + podStatus.Unknown++ + podStatus.podCount++ + } else { + continue + } + + } + } + } + + } + } + + } +} diff --git a/cmd/utils/yaml-utils_test.go b/cmd/utils/yaml-utils_test.go new file mode 100644 index 0000000..4bc39f4 --- /dev/null +++ b/cmd/utils/yaml-utils_test.go @@ -0,0 +1,19 @@ +package utils + +import ( + "io/ioutil" + "testing" +) + +func TestCountPods(t *testing.T) { + file, _ := ioutil.ReadFile("yaml-utils-test.txt") + podStatus := NewpodStatus() + podStatus.CountPods(file) + + if podStatus.Running != 9 { + t.Errorf("Failed") + } else if podStatus.Succeeded != 3 { + t.Errorf("Failed") + } + +} diff --git a/go.mod b/go.mod index ac72731..a0b0dab 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.2.8 k8s.io/cli-runtime v0.18.1 k8s.io/client-go v0.18.1 k8s.io/kubectl v0.18.1 diff --git a/yamls/knative/config/knative-serving.yaml b/yamls/knative/config/knative-serving.yaml deleted file mode 100644 index 8564902..0000000 --- a/yamls/knative/config/knative-serving.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: knative-serving ---- -apiVersion: operator.knative.dev/v1alpha1 -kind: KnativeServing -metadata: - name: knative-serving - namespace: knative-serving \ No newline at end of file diff --git a/yamls/knative/config/operatorgroup.yaml b/yamls/knative/config/operatorgroup.yaml deleted file mode 100644 index 6131807..0000000 --- a/yamls/knative/config/operatorgroup.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: operators.coreos.com/v1 -kind: OperatorGroup -metadata: - name: global-operators - namespace: openshift-operators diff --git a/yamls/knative/config/sub.yaml b/yamls/knative/config/sub.yaml deleted file mode 100644 index ab3bd6d..0000000 --- a/yamls/knative/config/sub.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: serverless-operator - namespace: openshift-operators -spec: - channel: techpreview - installPlanApproval: Automatic - name: serverless-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - startingCSV: serverless-operator.v1.5.0 \ No newline at end of file diff --git a/yamls/knative/controller-service-account.yaml b/yamls/knative/controller-service-account.yaml deleted file mode 100644 index c40620c..0000000 --- a/yamls/knative/controller-service-account.yaml +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2018 The Knative Authors -# -# 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 -# -# https://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. - -apiVersion: v1 -kind: ServiceAccount -metadata: - name: controller - namespace: knative-serving - labels: - serving.knative.dev/release: devel ---- -kind: ClusterRole -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: knative-serving-admin - labels: - serving.knative.dev/release: devel -aggregationRule: - clusterRoleSelectors: - - matchLabels: - serving.knative.dev/controller: "true" -rules: [] # Rules are automatically filled in by the controller manager. ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: knative-serving-controller-admin - labels: - serving.knative.dev/release: devel -subjects: - - kind: ServiceAccount - name: controller - namespace: knative-serving -roleRef: - kind: ClusterRole - name: knative-serving-admin - apiGroup: rbac.authorization.k8s.io \ No newline at end of file diff --git a/yamls/knative/services/video.yaml b/yamls/knative/services/video-analytics.yaml similarity index 95% rename from yamls/knative/services/video.yaml rename to yamls/knative/services/video-analytics.yaml index e88c10f..81073c9 100644 --- a/yamls/knative/services/video.yaml +++ b/yamls/knative/services/video-analytics.yaml @@ -1,7 +1,7 @@ apiVersion: serving.knative.dev/v1 kind: Service metadata: - name: video-service + name: video-analytics spec: template: spec: diff --git a/yamls/knative/services/video-serving.yaml b/yamls/knative/services/video-serving.yaml index 654c017..f004376 100644 --- a/yamls/knative/services/video-serving.yaml +++ b/yamls/knative/services/video-serving.yaml @@ -10,8 +10,8 @@ spec: - image: quay.io/astoycos/serving-display:latest env: - name: CEPH_ENDPOINT - value: 'http://ceph-route-rook-ceph.apps.astoycos-ocp.shiftstack.com' + value: '' - name: S3_ID - value: '87KR4A1W77FA02MOW9MQ' + value: '' - name: S3_SECRET_KEY - value: 'wC9TuE9AK6INqEiUNvSVKDMwvab1AQgsUTE7rAU2' \ No newline at end of file + value: '' \ No newline at end of file