templates

package
v0.0.0-...-16423e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OSDSizeInTiB = 4
)

Variables

View Source
var CephNetworkPolicyTemplate = netv1.NetworkPolicy{
	Spec: netv1.NetworkPolicySpec{
		Ingress: []netv1.NetworkPolicyIngressRule{
			{
				From: []netv1.NetworkPolicyPeer{
					{
						NamespaceSelector: &metav1.LabelSelector{
							MatchLabels: map[string]string{
								"policy-group.network.openshift.io/host-network": "",
							},
						},
					},
				},
			},
		},
		PolicyTypes: []netv1.PolicyType{
			netv1.PolicyTypeIngress,
		},
		PodSelector: metav1.LabelSelector{
			MatchExpressions: []metav1.LabelSelectorRequirement{
				{
					Key:      "app",
					Operator: metav1.LabelSelectorOpIn,
					Values: []string{
						"rook-ceph-mds",
						"rook-ceph-osd",
						"rook-ceph-mgr",
						"rook-ceph-mon",
						"rook-ceph-crashcollector",
					},
				},
			},
		},
	},
}
View Source
var ProviderApiServerNetworkPolicyTemplate = netv1.NetworkPolicy{
	Spec: netv1.NetworkPolicySpec{
		Ingress: []netv1.NetworkPolicyIngressRule{
			{
				Ports: []netv1.NetworkPolicyPort{
					{
						Port:     &ProviderApiServerPort,
						Protocol: &ProviderApiServerProtocol,
					},
				},
			},
		},
		PolicyTypes: []netv1.PolicyType{
			netv1.PolicyTypeIngress,
		},
		PodSelector: metav1.LabelSelector{
			MatchExpressions: []metav1.LabelSelectorRequirement{
				{
					Key:      "app",
					Operator: metav1.LabelSelectorOpIn,
					Values: []string{
						"ocsProviderApiServer",
					},
				},
			},
		},
	},
}
View Source
var ProviderApiServerPort = intstr.FromInt(50051)
View Source
var ProviderApiServerProtocol = corev1.ProtocolTCP
View Source
var StorageClusterTemplate = ocsv1.StorageCluster{
	Spec: ocsv1.StorageClusterSpec{

		LabelSelector: &metav1.LabelSelector{
			MatchExpressions: []metav1.LabelSelectorRequirement{{
				Key:      "node-role.kubernetes.io/worker",
				Operator: metav1.LabelSelectorOpExists,
			}, {
				Key:      "node-role.kubernetes.io/infra",
				Operator: metav1.LabelSelectorOpDoesNotExist,
			}},
		},
		ManageNodes: false,
		MonPVCTemplate: &corev1.PersistentVolumeClaim{
			Spec: corev1.PersistentVolumeClaimSpec{
				StorageClassName: utils.ToPointer("gp3-csi"),
				Resources: corev1.ResourceRequirements{
					Requests: corev1.ResourceList{
						"storage": resource.MustParse("50Gi"),
					},
				},
				AccessModes: []corev1.PersistentVolumeAccessMode{
					corev1.ReadWriteOnce,
				},
			},
		},
		Resources: map[string]corev1.ResourceRequirements{
			"mds":            df.GetResourceRequirements("mds"),
			"mgr":            df.GetResourceRequirements("mgr"),
			"mon":            df.GetResourceRequirements("mon"),
			"crashcollector": df.GetResourceRequirements("crashcollector"),
		},
		BackingStorageClasses: []ocsv1.BackingStorageClass{{
			ObjectMeta: metav1.ObjectMeta{
				Name: backingStorageClassName,
			},
			Provisioner: "ebs.csi.aws.com",
			Parameters: map[string]string{
				"iops":       "12000",
				"throughput": "250",
				"type":       "gp3",
			},
		}},
		StorageProfiles: []ocsv1.StorageProfile{{
			DeviceClass: "ssd",
			Name:        "default-storage-profile",
			BlockPoolConfiguration: ocsv1.BlockPoolConfigurationSpec{
				Parameters: map[string]string{
					"pg_autoscale_mode": "off",
					"pg_num":            "128",
					"pgp_num":           "128",
					"target_size_ratio": ".49",
				},
			},
			SharedFilesystemConfiguration: ocsv1.SharedFilesystemConfigurationSpec{
				Parameters: map[string]string{
					"pg_autoscale_mode": "off",
					"pg_num":            "512",
					"pgp_num":           "512",
				},
			},
		}},
		DefaultStorageProfile: "default-storage-profile",
		StorageDeviceSets: []ocsv1.StorageDeviceSet{{
			Name:        "default",
			Count:       1,
			Replica:     3,
			DeviceClass: "ssd",
			DataPVCTemplate: corev1.PersistentVolumeClaim{
				Spec: corev1.PersistentVolumeClaimSpec{
					StorageClassName: utils.ToPointer(backingStorageClassName),
					AccessModes: []corev1.PersistentVolumeAccessMode{
						corev1.ReadWriteOnce,
					},
					VolumeMode: utils.ToPointer(corev1.PersistentVolumeBlock),
					Resources: corev1.ResourceRequirements{
						Requests: corev1.ResourceList{
							"storage": resource.MustParse(fmt.Sprintf("%dTi", OSDSizeInTiB)),
						},
					},
				},
			},
			Placement: rook.Placement{
				TopologySpreadConstraints: []corev1.TopologySpreadConstraint{
					commonTSC,
				},
			},
			PreparePlacement: rook.Placement{
				TopologySpreadConstraints: []corev1.TopologySpreadConstraint{
					commonTSC,
					preparePlacementTSC,
				},
			},
			Portable:  true,
			Resources: df.GetResourceRequirements("sds"),
		}},
		MultiCloudGateway: &ocsv1.MultiCloudGatewaySpec{
			ReconcileStrategy: "ignore",
		},
		HostNetwork:                 true,
		AllowRemoteStorageConsumers: true,
		ManagedResources: ocsv1.ManagedResourcesSpec{
			CephBlockPools: ocsv1.ManageCephBlockPools{
				ReconcileStrategy:    "ignore",
				DisableStorageClass:  true,
				DisableSnapshotClass: true,
			},
			CephFilesystems: ocsv1.ManageCephFilesystems{
				DisableStorageClass:  true,
				DisableSnapshotClass: true,
			},
		},
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL