templates

package
v0.0.0-...-672e703 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CSIOperatorConfigName = "ceph-csi-operator-config"

Ceph CSI Operator Config

View Source
const CephFsDriverName = "openshift-storage.cephfs.csi.ceph.com"
View Source
const RBDDriverName = "openshift-storage.rbd.csi.ceph.com"
View Source
const SCCName = "ceph-csi-op-scc"

security context constraints

View Source
const (
	SubscriptionWebhookName = "subscription.ocs.openshift.io"
)
View Source
const (
	// should be <namePrefix from config/default/kustomization><.metadata.name from config/manager/webhook_service.yaml>
	WebhookServiceName = "ocs-client-operator-webhook-server"
)

Variables

View Source
var CSIOperatorConfigSpec = csiopv1a1.OperatorConfigSpec{
	DriverSpecDefaults: &csiopv1a1.DriverSpec{
		Log: &csiopv1a1.LogSpec{
			Verbosity: 5,
			Rotation: &csiopv1a1.LogRotationSpec{
				Periodicity: csiopv1a1.DailyPeriod,
				MaxLogSize:  resource.MustParse("500M"),
				MaxFiles:    7,
				LogHostPath: "/var/lib/cephcsi",
			},
		},
		AttachRequired:  ptr.To(true),
		DeployCsiAddons: ptr.To(true),
		FsGroupPolicy:   storagev1.FileFSGroupPolicy,
		ControllerPlugin: &csiopv1a1.ControllerPluginSpec{
			Privileged: ptr.To(true),
			Resources: csiopv1a1.ControllerPluginResourcesSpec{
				LogRotator: &corev1.ResourceRequirements{
					Requests: corev1.ResourceList{
						corev1.ResourceCPU:    resource.MustParse("100m"),
						corev1.ResourceMemory: resource.MustParse("32Mi"),
					},
				},
			},
			PodCommonSpec: csiopv1a1.PodCommonSpec{
				PrioritylClassName: ptr.To("system-cluster-critical"),
				ImagePullPolicy:    corev1.PullIfNotPresent,
				Tolerations: []corev1.Toleration{
					{
						Effect:   corev1.TaintEffectNoSchedule,
						Key:      "node.ocs.openshift.io/storage",
						Operator: corev1.TolerationOpEqual,
						Value:    "true",
					},
				},
			},
			Replicas: ptr.To(int32(2)),
		},
		NodePlugin: &csiopv1a1.NodePluginSpec{
			Resources: csiopv1a1.NodePluginResourcesSpec{
				LogRotator: &corev1.ResourceRequirements{
					Requests: corev1.ResourceList{
						corev1.ResourceCPU:    resource.MustParse("100m"),
						corev1.ResourceMemory: resource.MustParse("32Mi"),
					},
				},
			},
			KubeletDirPath: "/var/lib/kubelet",
			PodCommonSpec: csiopv1a1.PodCommonSpec{
				PrioritylClassName: ptr.To("system-node-critical"),
				ImagePullPolicy:    corev1.PullIfNotPresent,
				Tolerations: []corev1.Toleration{
					{
						Key:      "node-role.kubernetes.io/master",
						Operator: corev1.TolerationOpExists,
						Effect:   corev1.TaintEffectNoSchedule,
					},
					{
						Effect:   corev1.TaintEffectNoSchedule,
						Key:      "node.ocs.openshift.io/storage",
						Operator: corev1.TolerationOpEqual,
						Value:    "true",
					},
				},
			},
		},
	},
}
View Source
var SubscriptionValidatingWebhook = admrv1.ValidatingWebhook{
	ClientConfig: admrv1.WebhookClientConfig{
		Service: &admrv1.ServiceReference{
			Name: "ocs-client-operator-webhook-server",
			Path: ptr.To("/validate-subscription"),
			Port: ptr.To(int32(443)),
		},
	},
	Rules: []admrv1.RuleWithOperations{
		{
			Rule: admrv1.Rule{
				APIGroups:   []string{"operators.coreos.com"},
				APIVersions: []string{"v1alpha1"},
				Resources:   []string{"subscriptions"},
				Scope:       ptr.To(admrv1.NamespacedScope),
			},
			Operations: []admrv1.OperationType{admrv1.Update},
		},
	},
	SideEffects:             ptr.To(admrv1.SideEffectClassNone),
	TimeoutSeconds:          ptr.To(int32(30)),
	AdmissionReviewVersions: []string{"v1"},

	FailurePolicy: ptr.To(admrv1.Fail),
}
View Source
var WebhookService = corev1.Service{
	Spec: corev1.ServiceSpec{
		Ports: []corev1.ServicePort{
			{
				Name:       "https",
				Port:       443,
				Protocol:   corev1.ProtocolTCP,
				TargetPort: intstr.FromInt32(7443),
			},
		},
		Selector: map[string]string{
			"app": "ocs-client-operator",
		},
		Type: corev1.ServiceTypeClusterIP,
	},
}

should match the spec at config/manager/webhook_service.yaml

Functions

func SetSecurityContextConstraintsDesiredState

func SetSecurityContextConstraintsDesiredState(scc *secv1.SecurityContextConstraints, ns string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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