diff --git a/cmd/openshift-install/graph.go b/cmd/openshift-install/graph.go index 77a881fb59f..98ace064e25 100644 --- a/cmd/openshift-install/graph.go +++ b/cmd/openshift-install/graph.go @@ -5,6 +5,7 @@ import ( "io" "os" "reflect" + "regexp" "github.com/awalterschulze/gographviz" "github.com/sirupsen/logrus" @@ -49,6 +50,18 @@ func runGraphCmd(cmd *cobra.Command, args []string) error { } } + g.AddAttr("G", "rankdir", "LR") + r := regexp.MustCompile(`[. ]`) + for _, node := range g.Nodes.Nodes { + cluster := r.Split(node.Name, -1)[0][1:] + subgraphName := "cluster_" + cluster + _, ok := g.SubGraphs.SubGraphs[subgraphName] + if !ok { + g.AddSubGraph("G", subgraphName, map[string]string{"label": cluster}) + } + g.AddNode(subgraphName, node.Name, nil) + } + out := os.Stdout if graphOpts.outputFile != "" { f, err := os.Create(graphOpts.outputFile) diff --git a/docs/design/resource_dep.svg b/docs/design/resource_dep.svg index c0b23f360a2..b96324c0543 100644 --- a/docs/design/resource_dep.svg +++ b/docs/design/resource_dep.svg @@ -1,1309 +1,1296 @@ - - - + + G - + + +cluster_Target + +Target + + +cluster_bootkube + +bootkube + + +cluster_bootstrap + +bootstrap + + +cluster_cluster + +cluster + + +cluster_installconfig + +installconfig + + +cluster_kubeconfig + +kubeconfig + + +cluster_machine + +machine + + +cluster_machines + +machines + + +cluster_manifests + +manifests + + +cluster_openshift + +openshift + + +cluster_password + +password + + +cluster_rhcos + +rhcos + + +cluster_tls + +tls + installconfig.InstallConfig - -installconfig.InstallConfig + +installconfig.InstallConfig Target Install Config - -Target Install Config + +Target Install Config installconfig.InstallConfig->Target Install Config - - + + - + manifests.Manifests - -manifests.Manifests + +manifests.Manifests - + installconfig.InstallConfig->manifests.Manifests - - + + - + manifests.Ingress - -manifests.Ingress + +manifests.Ingress - + installconfig.InstallConfig->manifests.Ingress - - + + - + manifests.DNS - -manifests.DNS + +manifests.DNS - + installconfig.InstallConfig->manifests.DNS - - + + - + manifests.Infrastructure - -manifests.Infrastructure + +manifests.Infrastructure - + installconfig.InstallConfig->manifests.Infrastructure - - + + - + manifests.Networking - -manifests.Networking + +manifests.Networking - + installconfig.InstallConfig->manifests.Networking - - + + - + tls.IngressCertKey - -tls.IngressCertKey + +tls.IngressCertKey - + installconfig.InstallConfig->tls.IngressCertKey - - + + - + tls.MCSCertKey - -tls.MCSCertKey + +tls.MCSCertKey - + installconfig.InstallConfig->tls.MCSCertKey - - + + - + manifests.Openshift - -manifests.Openshift + +manifests.Openshift - + installconfig.InstallConfig->manifests.Openshift - - + + - + manifests.ClusterK8sIO - -manifests.ClusterK8sIO + +manifests.ClusterK8sIO - + installconfig.InstallConfig->manifests.ClusterK8sIO - - + + - + machines.Worker - -machines.Worker + +machines.Worker - + installconfig.InstallConfig->machines.Worker - - + + - + installconfig.PlatformCredsCheck - -installconfig.PlatformCredsCheck + +installconfig.PlatformCredsCheck - + installconfig.InstallConfig->installconfig.PlatformCredsCheck - - + + - + rhcos.Image - -rhcos.Image + +rhcos.Image - + installconfig.InstallConfig->rhcos.Image - - + + - + machine.Worker - -machine.Worker + +machine.Worker - + installconfig.InstallConfig->machine.Worker - - + + - + machines.Master - -machines.Master + +machines.Master - + installconfig.InstallConfig->machines.Master - - + + - + machine.Master - -machine.Master + +machine.Master - + installconfig.InstallConfig->machine.Master - - + + + + + +kubeconfig.Admin + +kubeconfig.Admin + + + +installconfig.InstallConfig->kubeconfig.Admin + + - + bootstrap.Bootstrap - -bootstrap.Bootstrap + +bootstrap.Bootstrap - + installconfig.InstallConfig->bootstrap.Bootstrap - - + + - + tls.APIServerCertKey - -tls.APIServerCertKey + +tls.APIServerCertKey - + installconfig.InstallConfig->tls.APIServerCertKey - - - - - -kubeconfig.Admin - -kubeconfig.Admin - - - -installconfig.InstallConfig->kubeconfig.Admin - - + + - + kubeconfig.Kubelet - -kubeconfig.Kubelet + +kubeconfig.Kubelet - + installconfig.InstallConfig->kubeconfig.Kubelet - - + + - + cluster.Metadata - -cluster.Metadata + +cluster.Metadata - + installconfig.InstallConfig->cluster.Metadata - - + + - + cluster.TerraformVariables - -cluster.TerraformVariables + +cluster.TerraformVariables - + installconfig.InstallConfig->cluster.TerraformVariables - - + + - + cluster.Cluster - -cluster.Cluster + +cluster.Cluster - + installconfig.InstallConfig->cluster.Cluster - - + + installconfig.sshPublicKey - -installconfig.sshPublicKey + +installconfig.sshPublicKey installconfig.sshPublicKey->installconfig.InstallConfig - - + + installconfig.baseDomain - -installconfig.baseDomain + +installconfig.baseDomain installconfig.baseDomain->installconfig.InstallConfig - - + + installconfig.platform - -installconfig.platform + +installconfig.platform installconfig.platform->installconfig.InstallConfig - - + + installconfig.platform->installconfig.baseDomain - - + + installconfig.clusterName - -installconfig.clusterName + +installconfig.clusterName installconfig.clusterName->installconfig.InstallConfig - - + + installconfig.pullSecret - -installconfig.pullSecret + +installconfig.pullSecret installconfig.pullSecret->installconfig.InstallConfig - - + + - + -templates.Templates - -templates.Templates +bootkube.KubeCloudConfig + +bootkube.KubeCloudConfig Target Manifest templates - -Target Manifest templates + +Target Manifest templates - + -templates.Templates->Target Manifest templates - - - - - -bootkube.KubeCloudConfig - -bootkube.KubeCloudConfig - - - -bootkube.KubeCloudConfig->templates.Templates - - +bootkube.KubeCloudConfig->Target Manifest templates + + - + bootkube.KubeCloudConfig->manifests.Manifests - - + + - + bootkube.MachineConfigServerTLSSecret - -bootkube.MachineConfigServerTLSSecret + +bootkube.MachineConfigServerTLSSecret - - -bootkube.MachineConfigServerTLSSecret->templates.Templates - - + + +bootkube.MachineConfigServerTLSSecret->Target Manifest templates + + - + bootkube.MachineConfigServerTLSSecret->manifests.Manifests - - - - - -bootkube.OpenshiftServiceCertSignerSecret - -bootkube.OpenshiftServiceCertSignerSecret - - - -bootkube.OpenshiftServiceCertSignerSecret->templates.Templates - - - - - -bootkube.OpenshiftServiceCertSignerSecret->manifests.Manifests - - + + - + bootkube.Pull - -bootkube.Pull + +bootkube.Pull - - -bootkube.Pull->templates.Templates - - + + +bootkube.Pull->Target Manifest templates + + - + bootkube.Pull->manifests.Manifests - - + + - + bootkube.CVOOverrides - -bootkube.CVOOverrides + +bootkube.CVOOverrides - - -bootkube.CVOOverrides->templates.Templates - - + + +bootkube.CVOOverrides->Target Manifest templates + + - + bootkube.CVOOverrides->manifests.Manifests - - + + - + bootkube.HostEtcdServiceEndpointsKubeSystem - -bootkube.HostEtcdServiceEndpointsKubeSystem + +bootkube.HostEtcdServiceEndpointsKubeSystem - - -bootkube.HostEtcdServiceEndpointsKubeSystem->templates.Templates - - + + +bootkube.HostEtcdServiceEndpointsKubeSystem->Target Manifest templates + + - + bootkube.HostEtcdServiceEndpointsKubeSystem->manifests.Manifests - - + + - + bootkube.KubeSystemConfigmapEtcdServingCA - -bootkube.KubeSystemConfigmapEtcdServingCA + +bootkube.KubeSystemConfigmapEtcdServingCA - - -bootkube.KubeSystemConfigmapEtcdServingCA->templates.Templates - - + + +bootkube.KubeSystemConfigmapEtcdServingCA->Target Manifest templates + + - + bootkube.KubeSystemConfigmapEtcdServingCA->manifests.Manifests - - + + - + bootkube.KubeSystemConfigmapRootCA - -bootkube.KubeSystemConfigmapRootCA + +bootkube.KubeSystemConfigmapRootCA - - -bootkube.KubeSystemConfigmapRootCA->templates.Templates - - + + +bootkube.KubeSystemConfigmapRootCA->Target Manifest templates + + - + bootkube.KubeSystemConfigmapRootCA->manifests.Manifests - - + + - + bootkube.KubeSystemSecretEtcdClient - -bootkube.KubeSystemSecretEtcdClient + +bootkube.KubeSystemSecretEtcdClient - - -bootkube.KubeSystemSecretEtcdClient->templates.Templates - - + + +bootkube.KubeSystemSecretEtcdClient->Target Manifest templates + + - + bootkube.KubeSystemSecretEtcdClient->manifests.Manifests - - + + - + bootkube.OpenshiftMachineConfigOperator - -bootkube.OpenshiftMachineConfigOperator + +bootkube.OpenshiftMachineConfigOperator - - -bootkube.OpenshiftMachineConfigOperator->templates.Templates - - + + +bootkube.OpenshiftMachineConfigOperator->Target Manifest templates + + - + bootkube.OpenshiftMachineConfigOperator->manifests.Manifests - - - - - -bootkube.OpenshiftClusterAPINamespace - -bootkube.OpenshiftClusterAPINamespace - - - -bootkube.OpenshiftClusterAPINamespace->templates.Templates - - - - - -bootkube.OpenshiftClusterAPINamespace->manifests.Manifests - - - - - -bootkube.OpenshiftServiceCertSignerNamespace - -bootkube.OpenshiftServiceCertSignerNamespace - - - -bootkube.OpenshiftServiceCertSignerNamespace->templates.Templates - - - - - -bootkube.OpenshiftServiceCertSignerNamespace->manifests.Manifests - - + + - + bootkube.EtcdServiceKubeSystem - -bootkube.EtcdServiceKubeSystem + +bootkube.EtcdServiceKubeSystem - - -bootkube.EtcdServiceKubeSystem->templates.Templates - - + + +bootkube.EtcdServiceKubeSystem->Target Manifest templates + + - + bootkube.EtcdServiceKubeSystem->manifests.Manifests - - + + - + bootkube.HostEtcdServiceKubeSystem - -bootkube.HostEtcdServiceKubeSystem + +bootkube.HostEtcdServiceKubeSystem - - -bootkube.HostEtcdServiceKubeSystem->templates.Templates - - + + +bootkube.HostEtcdServiceKubeSystem->Target Manifest templates + + - + bootkube.HostEtcdServiceKubeSystem->manifests.Manifests - - + + - + openshift.BindingDiscovery - -openshift.BindingDiscovery + +openshift.BindingDiscovery - - -openshift.BindingDiscovery->templates.Templates - - + + +openshift.BindingDiscovery->Target Manifest templates + + - + openshift.BindingDiscovery->manifests.Openshift - - + + - + openshift.CloudCredsSecret - -openshift.CloudCredsSecret + +openshift.CloudCredsSecret - - -openshift.CloudCredsSecret->templates.Templates - - + + +openshift.CloudCredsSecret->Target Manifest templates + + - + openshift.CloudCredsSecret->manifests.Openshift - - + + - + openshift.KubeadminPasswordSecret - -openshift.KubeadminPasswordSecret + +openshift.KubeadminPasswordSecret - - -openshift.KubeadminPasswordSecret->templates.Templates - - + + +openshift.KubeadminPasswordSecret->Target Manifest templates + + - + openshift.KubeadminPasswordSecret->manifests.Openshift - - + + - + openshift.RoleCloudCredsSecretReader - -openshift.RoleCloudCredsSecretReader + +openshift.RoleCloudCredsSecretReader - - -openshift.RoleCloudCredsSecretReader->templates.Templates - - + + +openshift.RoleCloudCredsSecretReader->Target Manifest templates + + - + openshift.RoleCloudCredsSecretReader->manifests.Openshift - - - - - -openshift.InfrastructureCRD - -openshift.InfrastructureCRD - - - -openshift.InfrastructureCRD->templates.Templates - - - - - -openshift.InfrastructureCRD->manifests.Infrastructure - - + + - + Target Manifests - -Target Manifests + +Target Manifests - + manifests.Manifests->Target Manifests - - + + - + manifests.Manifests->bootstrap.Bootstrap - - + + - + installconfig.ClusterID - -installconfig.ClusterID + +installconfig.ClusterID - + installconfig.ClusterID->manifests.Manifests - - + + - + installconfig.ClusterID->machines.Worker - - + + - + installconfig.ClusterID->machines.Master - - + + - + installconfig.ClusterID->cluster.Metadata - - + + - + installconfig.ClusterID->cluster.TerraformVariables - - + + - + installconfig.ClusterID->cluster.Cluster - - + + - + manifests.Ingress->manifests.Manifests - - + + - + manifests.DNS->manifests.Manifests - - + + - + manifests.Infrastructure->manifests.Manifests - - + + + + + +openshift.InfrastructureCRD + +openshift.InfrastructureCRD + + + +openshift.InfrastructureCRD->manifests.Infrastructure + + - + manifests.Networking->manifests.Manifests - - + + - + manifests.Networking->manifests.ClusterK8sIO - - + + + + + +openshift.NetworkCRDs + +openshift.NetworkCRDs + + + +openshift.NetworkCRDs->manifests.Networking + + - + tls.RootCA - -tls.RootCA + +tls.RootCA - + tls.RootCA->manifests.Manifests - - + + - + tls.EtcdCA - -tls.EtcdCA + +tls.EtcdCA - + tls.RootCA->tls.EtcdCA - - + + - + tls.KubeCA - -tls.KubeCA + +tls.KubeCA - + tls.RootCA->tls.KubeCA - - - - - -tls.ServiceServingCA - -tls.ServiceServingCA - - - -tls.RootCA->tls.ServiceServingCA - - + + - + tls.RootCA->tls.MCSCertKey - - + + - + tls.RootCA->machine.Worker - - + + - + tls.RootCA->machine.Master - - + + + + + +tls.RootCA->kubeconfig.Admin + + - + tls.RootCA->bootstrap.Bootstrap - - + + - + tls.AggregatorCA - -tls.AggregatorCA + +tls.AggregatorCA - + tls.RootCA->tls.AggregatorCA - - + + - + tls.JournalCertKey - -tls.JournalCertKey + +tls.JournalCertKey - + tls.RootCA->tls.JournalCertKey - - - - - -tls.RootCA->kubeconfig.Admin - - + + - + tls.RootCA->kubeconfig.Kubelet - - + + - + tls.EtcdCA->manifests.Manifests - - + + - + tls.EtcdClientCertKey - -tls.EtcdClientCertKey + +tls.EtcdClientCertKey - + tls.EtcdCA->tls.EtcdClientCertKey - - + + - + tls.EtcdCA->bootstrap.Bootstrap - - + + - + tls.IngressCertKey->manifests.Manifests - - + + - + tls.KubeCA->manifests.Manifests - - + + - + tls.KubeCA->tls.IngressCertKey - - + + - + tls.KubeletCertKey - -tls.KubeletCertKey + +tls.KubeletCertKey - + tls.KubeCA->tls.KubeletCertKey - - - - - -tls.KubeCA->bootstrap.Bootstrap - - - - - -tls.KubeCA->tls.APIServerCertKey - - + + - + tls.AdminCertKey - -tls.AdminCertKey + +tls.AdminCertKey - + tls.KubeCA->tls.AdminCertKey - - + + - - -tls.ServiceServingCA->manifests.Manifests - - + + +tls.KubeCA->bootstrap.Bootstrap + + - + -tls.ServiceServingCA->bootstrap.Bootstrap - - +tls.KubeCA->tls.APIServerCertKey + + - + tls.EtcdClientCertKey->manifests.Manifests - - + + - + tls.EtcdClientCertKey->bootstrap.Bootstrap - - + + - + tls.MCSCertKey->manifests.Manifests - - + + - + tls.MCSCertKey->bootstrap.Bootstrap - - + + - + tls.KubeletCertKey->manifests.Manifests - - + + - + tls.KubeletCertKey->bootstrap.Bootstrap - - + + - + tls.KubeletCertKey->kubeconfig.Kubelet - - + + - + manifests.Openshift->Target Manifests - - + + - + manifests.Openshift->bootstrap.Bootstrap - - + + - + manifests.ClusterK8sIO->manifests.Openshift - - + + - + machines.Worker->manifests.Openshift - - + + - + installconfig.PlatformCredsCheck->machines.Worker - - + + - + installconfig.PlatformCredsCheck->machines.Master - - + + - + installconfig.PlatformCredsCheck->cluster.Cluster - - + + - + rhcos.Image->machines.Worker - - + + - + rhcos.Image->machines.Master - - + + - + rhcos.Image->cluster.TerraformVariables - - + + - + machine.Worker->machines.Worker - - + + - + Target Ignition Configs - -Target Ignition Configs + +Target Ignition Configs - + machine.Worker->Target Ignition Configs - - + + - + machines.Master->manifests.Openshift - - + + + + + +machines.Master->cluster.TerraformVariables + + - + machine.Master->machines.Master - - + + - + machine.Master->Target Ignition Configs - - + + - + machine.Master->cluster.TerraformVariables - - + + - + password.KubeadminPassword - -password.KubeadminPassword + +password.KubeadminPassword - + password.KubeadminPassword->manifests.Openshift - - + + - + password.KubeadminPassword->cluster.Cluster - - + + + + + +kubeconfig.Admin->Target Ignition Configs + + + + + +kubeconfig.Admin->bootstrap.Bootstrap + + + + + +Target Cluster + +Target Cluster + + + +kubeconfig.Admin->Target Cluster + + + + + +tls.AdminCertKey->kubeconfig.Admin + + + + + +tls.AdminCertKey->bootstrap.Bootstrap + + - + bootstrap.Bootstrap->Target Ignition Configs - - + + - + bootstrap.Bootstrap->cluster.TerraformVariables - - + + - + tls.AggregatorCA->bootstrap.Bootstrap - - + + - + tls.APIServerProxyCertKey - -tls.APIServerProxyCertKey + +tls.APIServerProxyCertKey - + tls.AggregatorCA->tls.APIServerProxyCertKey - - + + - + tls.APIServerCertKey->bootstrap.Bootstrap - - + + - + tls.APIServerProxyCertKey->bootstrap.Bootstrap - - - - - -tls.AdminCertKey->bootstrap.Bootstrap - - - - - -tls.AdminCertKey->kubeconfig.Admin - - + + - + tls.ServiceAccountKeyPair - -tls.ServiceAccountKeyPair + +tls.ServiceAccountKeyPair - + tls.ServiceAccountKeyPair->bootstrap.Bootstrap - - + + - + tls.JournalCertKey->bootstrap.Bootstrap - - - - - -Target Cluster - -Target Cluster + + - + tls.JournalCertKey->Target Cluster - - - - - -kubeconfig.Admin->bootstrap.Bootstrap - - - - - -kubeconfig.Admin->Target Ignition Configs - - - - - -kubeconfig.Admin->Target Cluster - - + + - + kubeconfig.Kubelet->bootstrap.Bootstrap - - + + - + cluster.Metadata->Target Ignition Configs - - + + - + cluster.Metadata->Target Cluster - - + + - + cluster.TerraformVariables->Target Cluster - - + + - + cluster.TerraformVariables->cluster.Cluster - - + + - + cluster.Cluster->Target Cluster - - + +