k8c.io/api/v3@v3.0.0-20230904060738-b0a93889c0b6/pkg/apis/kubermatic/v1/const.go (about) 1 /* 2 Copyright 2023 The Kubermatic Kubernetes Platform contributors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package v1 18 19 import ( 20 "k8s.io/apimachinery/pkg/util/sets" 21 ) 22 23 // +kubebuilder:validation:Enum=alibaba;anexia;aws;azure;bringyourown;digitalocean;gcp;hetzner;kubevirt;nutanix;openstack;packet;vmwareclouddirector;vsphere 24 25 // CloudProvider defines the cloud provider where the a cluster's nodes are running. 26 // Note that these constants may match the machine-controller's constant, but don't 27 // have to. Use the functions in the helper package to translate between the two. 28 type CloudProvider string 29 30 func (p CloudProvider) String() string { 31 return string(p) 32 } 33 34 const ( 35 CloudProviderFake CloudProvider = "fake" 36 CloudProviderAlibaba CloudProvider = "alibaba" 37 CloudProviderAnexia CloudProvider = "anexia" 38 CloudProviderAWS CloudProvider = "aws" 39 CloudProviderAzure CloudProvider = "azure" 40 CloudProviderBringYourOwn CloudProvider = "bringyourown" 41 CloudProviderDigitalocean CloudProvider = "digitalocean" 42 CloudProviderGCP CloudProvider = "gcp" 43 CloudProviderHetzner CloudProvider = "hetzner" 44 CloudProviderKubeVirt CloudProvider = "kubevirt" 45 CloudProviderNutanix CloudProvider = "nutanix" 46 CloudProviderOpenStack CloudProvider = "openstack" 47 CloudProviderPacket CloudProvider = "packet" 48 CloudProviderVMwareCloudDirector CloudProvider = "vmwareclouddirector" 49 CloudProviderVSphere CloudProvider = "vsphere" 50 ) 51 52 var AllCloudProviders = sets.New( 53 CloudProviderFake, 54 CloudProviderAlibaba, 55 CloudProviderAnexia, 56 CloudProviderAWS, 57 CloudProviderAzure, 58 CloudProviderBringYourOwn, 59 CloudProviderDigitalocean, 60 CloudProviderGCP, 61 CloudProviderHetzner, 62 CloudProviderKubeVirt, 63 CloudProviderNutanix, 64 CloudProviderOpenStack, 65 CloudProviderPacket, 66 CloudProviderVMwareCloudDirector, 67 CloudProviderVSphere, 68 ) 69 70 // +kubebuilder:validation:Enum=aks;eks;gke;bringyourown;kubeone 71 72 type ExternalClusterProvider string 73 74 func (p ExternalClusterProvider) String() string { 75 return string(p) 76 } 77 78 const ( 79 ExternalClusterProviderAKS ExternalClusterProvider = "aks" 80 ExternalClusterProviderEKS ExternalClusterProvider = "eks" 81 ExternalClusterProviderGKE ExternalClusterProvider = "gke" 82 ExternalClusterProviderBringYourOwn ExternalClusterProvider = "bringyourown" 83 ExternalClusterProviderKubeOne ExternalClusterProvider = "kubeone" 84 ) 85 86 var AllExternalClusterProviders = sets.New( 87 ExternalClusterProviderAKS, 88 ExternalClusterProviderEKS, 89 ExternalClusterProviderGKE, 90 ExternalClusterProviderBringYourOwn, 91 ExternalClusterProviderKubeOne, 92 ) 93 94 // +kubebuilder:validation:Enum=ubuntu;centos;amzn2;rhel;flatcar;rockylinux 95 96 // OperatingSystem defines the a node's operating system. Note that these constants may 97 // match the machine-controller's constant, but don't have to. Use the functions in 98 // the helper package to translate between the two. 99 type OperatingSystem string 100 101 func (o OperatingSystem) String() string { 102 return string(o) 103 } 104 105 const ( 106 OperatingSystemUbuntu OperatingSystem = "ubuntu" 107 OperatingSystemCentOS OperatingSystem = "centos" 108 OperatingSystemAmazonLinux2 OperatingSystem = "amzn2" 109 OperatingSystemRHEL OperatingSystem = "rhel" 110 OperatingSystemFlatcar OperatingSystem = "flatcar" 111 OperatingSystemRockyLinux OperatingSystem = "rockylinux" 112 ) 113 114 var AllOperatingSystems = sets.New( 115 OperatingSystemUbuntu, 116 OperatingSystemCentOS, 117 OperatingSystemAmazonLinux2, 118 OperatingSystemRHEL, 119 OperatingSystemFlatcar, 120 OperatingSystemRockyLinux, 121 ) 122 123 // +kubebuilder:validation:Enum=NodePort;LoadBalancer;Tunneling 124 125 // ExposeStrategy is the strategy used to expose a cluster control plane. 126 // Possible values are `NodePort`, `LoadBalancer` or `Tunneling` (requires a feature gate). 127 type ExposeStrategy string 128 129 func (s ExposeStrategy) String() string { 130 return string(s) 131 } 132 133 const ( 134 // ExposeStrategyNodePort creates a NodePort with a "nodeport-proxy.k8s.io/expose": "true" annotation to expose 135 // all clusters on one central Service of type LoadBalancer via the NodePort proxy. 136 ExposeStrategyNodePort ExposeStrategy = "NodePort" 137 // ExposeStrategyLoadBalancer creates a LoadBalancer service per cluster. 138 ExposeStrategyLoadBalancer ExposeStrategy = "LoadBalancer" 139 // ExposeStrategyTunneling allows to reach the control plane components by 140 // tunneling L4 traffic (TCP only is supported at the moment). 141 // The traffic is encapsulated by mean of an agent deployed on the worker 142 // nodes. 143 // The traffic is decapsulated and forwarded to the recipients by 144 // mean of a proxy deployed on the Seed Cluster. 145 // The same proxy is also capable of routing TLS traffic without 146 // termination, this is to allow the Kubelet to reach the control plane 147 // before the agents are running. 148 // 149 // This strategy has the inconvenience of requiring an agent on worker 150 // nodes, but has the notable advantage of requiring one single entry point 151 // (e.g. Service of type LoadBalancer) without consuming one or more ports 152 // for each user cluster. 153 ExposeStrategyTunneling ExposeStrategy = "Tunneling" 154 ) 155 156 // AllExposeStrategies is a set containing all the expose strategies. 157 var AllExposeStrategies = sets.New( 158 ExposeStrategyNodePort, 159 ExposeStrategyLoadBalancer, 160 ExposeStrategyTunneling, 161 ) 162 163 // +kubebuilder:validation:Enum=canal;cilium;none 164 165 // CNIPluginType defines the type of CNI plugin installed. 166 type CNIPluginType string 167 168 func (c CNIPluginType) String() string { 169 return string(c) 170 } 171 172 const ( 173 // CNIPluginTypeCanal corresponds to Canal CNI plugin (i.e. Flannel + 174 // Calico for policy enforcement). 175 CNIPluginTypeCanal CNIPluginType = "canal" 176 177 // CNIPluginTypeCilium corresponds to Cilium CNI plugin. 178 CNIPluginTypeCilium CNIPluginType = "cilium" 179 180 // CNIPluginTypeNone corresponds to no CNI plugin managed by KKP 181 // (cluster users are responsible for managing the CNI in the cluster themselves). 182 CNIPluginTypeNone CNIPluginType = "none" 183 )