Documentation ¶
Overview ¶
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2020 Red Hat, Inc. *
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2018 Red Hat, Inc. *
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2018 Red Hat, Inc. *
* This file is part of the KubeVirt project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright 2019 Red Hat, Inc. *
Index ¶
- Constants
- func AddVersionSeparatorPrefix(version string) string
- func GetAllSCC(namespace string) []*secv1.SecurityContextConstraints
- func LoadCertificates(secret *k8sv1.Secret) (serverCrt *tls.Certificate, err error)
- func MergeCABundle(currentCert *tls.Certificate, currentBundle []byte, ...) ([]byte, int, error)
- func NewApiServerDeployment(namespace string, repository string, imagePrefix string, version string, ...) (*appsv1.Deployment, error)
- func NewApiServerService(namespace string) *corev1.Service
- func NewCACertSecret(operatorNamespace string) *k8sv1.Secret
- func NewCertSecrets(installNamespace string, operatorNamespace string) []*k8sv1.Secret
- func NewControllerDeployment(namespace string, repository string, imagePrefix string, ...) (*appsv1.Deployment, error)
- func NewHandlerDaemonSet(namespace string, repository string, imagePrefix string, version string, ...) (*appsv1.DaemonSet, error)
- func NewKubeVirtCAConfigMap(operatorNamespace string) *k8sv1.ConfigMap
- func NewKubeVirtCR(namespace string, pullPolicy corev1.PullPolicy) *virtv1.KubeVirt
- func NewKubeVirtControllerSCC(namespace string) *secv1.SecurityContextConstraints
- func NewKubeVirtCrd() *extv1beta1.CustomResourceDefinition
- func NewKubeVirtHandlerSCC(namespace string) *secv1.SecurityContextConstraints
- func NewKubeVirtPriorityClassCR() *schedulingv1.PriorityClass
- func NewKubevirtConfigMap(namespace string) *corev1.ConfigMap
- func NewNodeLabellerConfigMap(namespace string) *corev1.ConfigMap
- func NewOperatorDeployment(namespace string, repository string, imagePrefix string, version string, ...) (*appsv1.Deployment, error)
- func NewOperatorWebhookService(operatorNamespace string) *corev1.Service
- func NewOpertorValidatingWebhookConfiguration(operatorNamespace string) *v1beta1.ValidatingWebhookConfiguration
- func NewPodDisruptionBudgetForDeployment(deployment *appsv1.Deployment) *v1beta1.PodDisruptionBudget
- func NewPresetCrd() *extv1beta1.CustomResourceDefinition
- func NewPrometheusRuleCR(namespace string) *promv1.PrometheusRule
- func NewPrometheusRuleSpec(ns string) *promv1.PrometheusRuleSpec
- func NewPrometheusService(namespace string) *corev1.Service
- func NewReplicaSetCrd() *extv1beta1.CustomResourceDefinition
- func NewServiceMonitorCR(namespace string, monitorNamespace string, insecureSkipVerify bool) *promv1.ServiceMonitor
- func NewVirtAPIAPIServices(installNamespace string) []*v1beta1.APIService
- func NewVirtAPIMutatingWebhookConfiguration(installNamespace string) *v1beta1.MutatingWebhookConfiguration
- func NewVirtAPIValidatingWebhookConfiguration(installNamespace string) *v1beta1.ValidatingWebhookConfiguration
- func NewVirtualMachineCrd() *extv1beta1.CustomResourceDefinition
- func NewVirtualMachineInstanceCrd() *extv1beta1.CustomResourceDefinition
- func NewVirtualMachineInstanceMigrationCrd() *extv1beta1.CustomResourceDefinition
- func NextRotationDeadline(cert *tls.Certificate, ca *tls.Certificate) time.Time
- func PopulateSecretWithCertificate(secret *k8sv1.Secret, caCert *tls.Certificate, duration *metav1.Duration) (err error)
- func ValidateSecret(secret *k8sv1.Secret) error
- type CertificateCreationCallback
Constants ¶
const ( KubeVirtCASecretName = "kubevirt-ca" VirtHandlerCertSecretName = "kubevirt-virt-handler-certs" VirtHandlerServerCertSecretName = "kubevirt-virt-handler-server-certs" VirtOperatorCertSecretName = "kubevirt-operator-certs" VirtApiCertSecretName = "kubevirt-virt-api-certs" VirtControllerCertSecretName = "kubevirt-controller-certs" CABundleKey = "ca-bundle" )
const (
KUBEVIRT_PROMETHEUS_RULE_NAME = "prometheus-kubevirt-rules"
)
const KubeVirtOperatorValidatingWebhookName = "virt-operator-validator"
const KubevirtOperatorWebhookServiceName = "kubevirt-operator-webhook"
const MigrationCreateValidatePath = "/migration-validate-create"
const MigrationMutatePath = "/migration-mutate-create"
const MigrationUpdateValidatePath = "/migration-validate-update"
const VMICreateValidatePath = "/virtualmachineinstances-validate-create"
const VMIMutatePath = "/virtualmachineinstances-mutate"
const VMIPresetValidatePath = "/vmipreset-validate"
const VMIRSValidatePath = "/virtualmachinereplicaset-validate"
const VMIUpdateValidatePath = "/virtualmachineinstances-validate-update"
const VMMutatePath = "/virtualmachines-mutate"
const VMValidatePath = "/virtualmachines-validate"
const VirtAPIMutatingWebhookName = "virt-api-mutator"
const VirtAPIValidatingWebhookName = "virt-api-validator"
const VirtApiServiceName = "virt-api"
const VirtControllerServiceName = "virt-controller"
const VirtHandlerServiceName = "virt-controller"
const VirtOperatorServiceName = "kubevirt-operator-webhook"
Variables ¶
This section is empty.
Functions ¶
func AddVersionSeparatorPrefix ¶ added in v0.20.0
func GetAllSCC ¶ added in v0.20.0
func GetAllSCC(namespace string) []*secv1.SecurityContextConstraints
func LoadCertificates ¶ added in v0.29.0
func LoadCertificates(secret *k8sv1.Secret) (serverCrt *tls.Certificate, err error)
func MergeCABundle ¶ added in v0.29.0
func NewApiServerDeployment ¶
func NewApiServerService ¶
func NewCACertSecret ¶ added in v0.29.0
func NewCertSecrets ¶ added in v0.29.0
func NewControllerDeployment ¶
func NewHandlerDaemonSet ¶
func NewKubeVirtCAConfigMap ¶ added in v0.29.0
func NewKubeVirtCR ¶
func NewKubeVirtCR(namespace string, pullPolicy corev1.PullPolicy) *virtv1.KubeVirt
Used by manifest generation
func NewKubeVirtControllerSCC ¶ added in v0.20.0
func NewKubeVirtControllerSCC(namespace string) *secv1.SecurityContextConstraints
func NewKubeVirtCrd ¶
func NewKubeVirtCrd() *extv1beta1.CustomResourceDefinition
Used by manifest generation If you change something here, you probably need to change the CSV manifest too, see /manifests/release/kubevirt.VERSION.csv.yaml.in
func NewKubeVirtHandlerSCC ¶ added in v0.20.0
func NewKubeVirtHandlerSCC(namespace string) *secv1.SecurityContextConstraints
func NewKubeVirtPriorityClassCR ¶ added in v0.29.0
func NewKubeVirtPriorityClassCR() *schedulingv1.PriorityClass
NewKubeVirtPriorityClassCR is used for manifest generation
func NewKubevirtConfigMap ¶ added in v0.29.0
NewKubevirtConfigMap returns base config map
func NewNodeLabellerConfigMap ¶ added in v0.29.0
NewNodeLabellerConfigMap returns configmap with configuration of obsolete cpus and minCPU for node labeller
func NewOperatorDeployment ¶ added in v0.16.0
func NewOperatorDeployment(namespace string, repository string, imagePrefix string, version string, pullPolicy corev1.PullPolicy, verbosity string, kubeVirtVersionEnv string, virtApiShaEnv string, virtControllerShaEnv string, virtHandlerShaEnv string, virtLauncherShaEnv string) (*appsv1.Deployment, error)
Used for manifest generation only
func NewOperatorWebhookService ¶ added in v0.29.0
func NewOpertorValidatingWebhookConfiguration ¶ added in v0.29.0
func NewOpertorValidatingWebhookConfiguration(operatorNamespace string) *v1beta1.ValidatingWebhookConfiguration
func NewPodDisruptionBudgetForDeployment ¶ added in v0.20.0
func NewPodDisruptionBudgetForDeployment(deployment *appsv1.Deployment) *v1beta1.PodDisruptionBudget
func NewPresetCrd ¶
func NewPresetCrd() *extv1beta1.CustomResourceDefinition
func NewPrometheusRuleCR ¶ added in v0.26.0
func NewPrometheusRuleCR(namespace string) *promv1.PrometheusRule
NewPrometheusRuleCR returns a PrometheusRule with a group of alerts for the KubeVirt deployment.
func NewPrometheusRuleSpec ¶ added in v0.26.0
func NewPrometheusRuleSpec(ns string) *promv1.PrometheusRuleSpec
NewPrometheusRuleSpec makes a prometheus rule spec for kubevirt
func NewPrometheusService ¶
func NewReplicaSetCrd ¶
func NewReplicaSetCrd() *extv1beta1.CustomResourceDefinition
func NewServiceMonitorCR ¶ added in v0.20.6
func NewServiceMonitorCR(namespace string, monitorNamespace string, insecureSkipVerify bool) *promv1.ServiceMonitor
func NewVirtAPIAPIServices ¶ added in v0.29.0
func NewVirtAPIAPIServices(installNamespace string) []*v1beta1.APIService
func NewVirtAPIMutatingWebhookConfiguration ¶ added in v0.29.0
func NewVirtAPIMutatingWebhookConfiguration(installNamespace string) *v1beta1.MutatingWebhookConfiguration
func NewVirtAPIValidatingWebhookConfiguration ¶ added in v0.29.0
func NewVirtAPIValidatingWebhookConfiguration(installNamespace string) *v1beta1.ValidatingWebhookConfiguration
func NewVirtualMachineCrd ¶
func NewVirtualMachineCrd() *extv1beta1.CustomResourceDefinition
func NewVirtualMachineInstanceCrd ¶
func NewVirtualMachineInstanceCrd() *extv1beta1.CustomResourceDefinition
func NewVirtualMachineInstanceMigrationCrd ¶
func NewVirtualMachineInstanceMigrationCrd() *extv1beta1.CustomResourceDefinition
func NextRotationDeadline ¶ added in v0.29.0
func NextRotationDeadline(cert *tls.Certificate, ca *tls.Certificate) time.Time
nextRotationDeadline returns a value for the threshold at which the current certificate should be rotated, 80% of the expiration of the certificate.
func PopulateSecretWithCertificate ¶ added in v0.29.0
func ValidateSecret ¶ added in v0.29.0
Types ¶
type CertificateCreationCallback ¶ added in v0.29.0
type CertificateCreationCallback func(secret *k8sv1.Secret, caCert *tls.Certificate, duration time.Duration) (cert *x509.Certificate, key *rsa.PrivateKey)