-
Notifications
You must be signed in to change notification settings - Fork 154
/
resources.go
1874 lines (1647 loc) · 84.9 KB
/
resources.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright 2020 The Kubermatic Kubernetes Platform contributors.
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.
*/
package resources
import (
"context"
"crypto/ecdsa"
"crypto/rsa"
"crypto/x509"
"encoding/json"
"errors"
"fmt"
"net"
"os"
"time"
"github.com/minio/minio-go/v7"
"go.uber.org/zap"
appskubermaticv1 "k8c.io/kubermatic/v2/pkg/apis/apps.kubermatic/v1"
kubermaticv1 "k8c.io/kubermatic/v2/pkg/apis/kubermatic/v1"
kubermaticlog "k8c.io/kubermatic/v2/pkg/log"
"k8c.io/kubermatic/v2/pkg/resources/certificates/triple"
"k8c.io/kubermatic/v2/pkg/util/s3"
"k8c.io/reconciler/pkg/reconciling"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/rand"
"k8s.io/apimachinery/pkg/util/sets"
corev1lister "k8s.io/client-go/listers/core/v1"
certutil "k8s.io/client-go/util/cert"
ctrlruntimeclient "sigs.k8s.io/controller-runtime/pkg/client"
)
const (
// ApiServer secure port.
APIServerSecurePort = 6443
NodeLocalDNSCacheAddress = "169.254.20.10"
)
const (
// ApiserverDeploymentName is the name of the apiserver deployment.
ApiserverDeploymentName = "apiserver"
// ControllerManagerDeploymentName is the name for the controller manager deployment.
ControllerManagerDeploymentName = "controller-manager"
// SchedulerDeploymentName is the name for the scheduler deployment.
SchedulerDeploymentName = "scheduler"
// OperatingSystemManagerDeploymentName is the name for the operating-system-manager deployment.
OperatingSystemManagerDeploymentName = "operating-system-manager"
// OperatingSystemManagerContainerName is the name for the container created within the operating-system-manager deployment.
OperatingSystemManagerContainerName = "operating-system-manager"
// OperatingSystemManagerWebhookDeploymentName is the name for the operating-system-manager webhook deployment.
OperatingSystemManagerWebhookDeploymentName = "operating-system-manager-webhook"
// OperatingSystemManagerWebhookServiceName is the name for the operating-system-manager webhook service.
OperatingSystemManagerWebhookServiceName = "operating-system-manager-webhook"
// MachineControllerDeploymentName is the name for the machine-controller deployment.
MachineControllerDeploymentName = "machine-controller"
// MachineControllerWebhookDeploymentName is the name for the machine-controller webhook deployment.
MachineControllerWebhookDeploymentName = "machine-controller-webhook"
// MetricsServerDeploymentName is the name for the metrics-server deployment.
MetricsServerDeploymentName = "metrics-server"
// OpenVPNServerDeploymentName is the name for the openvpn server deployment.
OpenVPNServerDeploymentName = "openvpn-server"
// DNSResolverDeploymentName is the name of the dns resolver deployment.
DNSResolverDeploymentName = "dns-resolver"
// DNSResolverConfigMapName is the name of the dns resolvers configmap.
DNSResolverConfigMapName = "dns-resolver"
// DNSResolverServiceName is the name of the dns resolvers service.
DNSResolverServiceName = "dns-resolver"
// DNSResolverPodDisruptionBudetName is the name of the dns resolvers pdb.
DNSResolverPodDisruptionBudetName = "dns-resolver"
// KubeStateMetricsDeploymentName is the name of the kube-state-metrics deployment.
KubeStateMetricsDeploymentName = "kube-state-metrics"
// UserClusterControllerDeploymentName is the name of the usercluster-controller deployment.
UserClusterControllerDeploymentName = "usercluster-controller"
// UserClusterControllerContainerName is the name of the container within the usercluster-controller deployment.
UserClusterControllerContainerName = "usercluster-controller"
// ClusterAutoscalerDeploymentName is the name of the cluster-autoscaler deployment.
ClusterAutoscalerDeploymentName = "cluster-autoscaler"
// KubernetesDashboardDeploymentName is the name of the Kubernetes Dashboard deployment.
KubernetesDashboardDeploymentName = "kubernetes-dashboard"
// KubeLBDeploymentName is the name of the KubeLB deployment.
KubeLBDeploymentName = "kubelb-ccm"
// MetricsScraperDeploymentName is the name of dashboard-metrics-scraper deployment.
MetricsScraperDeploymentName = "dashboard-metrics-scraper"
// MetricsScraperServiceName is the name of dashboard-metrics-scraper service.
MetricsScraperServiceName = "dashboard-metrics-scraper"
// PrometheusStatefulSetName is the name for the prometheus StatefulSet.
PrometheusStatefulSetName = "prometheus"
// EtcdStatefulSetName is the name for the etcd StatefulSet.
EtcdStatefulSetName = "etcd"
// EtcdDefaultBackupConfigName is the name for the default (preinstalled) EtcdBackupConfig of a cluster.
EtcdDefaultBackupConfigName = "default-backups"
// EtcdTLSEnabledAnnotation is the annotation assigned to etcd Pods that run with a TLS peer endpoint.
EtcdTLSEnabledAnnotation = "etcd.kubermatic.k8c.io/tls-peer-enabled"
// EncryptionConfigurationSecretName is the name of secret storing the API server's EncryptionConfiguration.
EncryptionConfigurationSecretName = "apiserver-encryption-configuration"
// EncryptionConfigurationKeyName is the name of the secret key that is used to store the configuration file for encryption-at-rest.
EncryptionConfigurationKeyName = "encryption-configuration.yaml"
// NodePortProxyEnvoyDeploymentName is the name of the nodeport-proxy deployment in the user cluster.
NodePortProxyEnvoyDeploymentName = "nodeport-proxy-envoy"
// NodePortProxyEnvoyContainerName is the name of the envoy container in the nodeport-proxy deployment.
NodePortProxyEnvoyContainerName = "envoy"
// ApiserverServiceName is the name for the apiserver service.
ApiserverServiceName = "apiserver-external"
// FrontLoadBalancerServiceName is the name of the LoadBalancer service that fronts everything
// when using exposeStrategy "LoadBalancer".
FrontLoadBalancerServiceName = "front-loadbalancer"
// MetricsServerServiceName is the name for the metrics-server service.
MetricsServerServiceName = "metrics-server"
// MetricsServerExternalNameServiceName is the name for the metrics-server service inside the user cluster.
MetricsServerExternalNameServiceName = "metrics-server"
// EtcdServiceName is the name for the etcd service.
EtcdServiceName = "etcd"
// EtcdDefragCronJobName is the name for the defrag cronjob deployment.
EtcdDefragCronJobName = "etcd-defragger"
// OpenVPNServerServiceName is the name for the openvpn server service.
OpenVPNServerServiceName = "openvpn-server"
// MachineControllerWebhookServiceName is the name of the machine-controller webhook service.
MachineControllerWebhookServiceName = "machine-controller-webhook"
// MetricsServerAPIServiceName is the name for the metrics-server APIService.
MetricsServerAPIServiceName = "v1beta1.metrics.k8s.io"
// AdminKubeconfigSecretName is the name for the secret containing the private ca key.
AdminKubeconfigSecretName = "admin-kubeconfig"
// ViewerKubeconfigSecretName is the name for the secret containing the viewer kubeconfig.
ViewerKubeconfigSecretName = "viewer-kubeconfig"
// SchedulerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the scheduler.
SchedulerKubeconfigSecretName = "scheduler-kubeconfig"
// KubeLBCCMCertUsername is the name of the user coming from kubeconfig cert.
KubeLBCCMCertUsername = "kubermatic:kubelb-ccm"
// KubeletDnatControllerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the kubeletdnatcontroller.
KubeletDnatControllerKubeconfigSecretName = "kubeletdnatcontroller-kubeconfig"
// KubeStateMetricsKubeconfigSecretName is the name for the secret containing the kubeconfig used by kube-state-metrics.
KubeStateMetricsKubeconfigSecretName = "kube-state-metrics-kubeconfig"
// MetricsServerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the metrics-server.
MetricsServerKubeconfigSecretName = "metrics-server"
// ControllerManagerKubeconfigSecretName is the name of the secret containing the kubeconfig used by controller manager.
ControllerManagerKubeconfigSecretName = "controllermanager-kubeconfig"
// OperatingSystemManagerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the osm.
OperatingSystemManagerKubeconfigSecretName = "operatingsystemmanager-kubeconfig"
// OperatingSystemManagerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the osm webhook.
OperatingSystemManagerWebhookKubeconfigSecretName = "operatingsystemmanager-webhook-kubeconfig"
// MachineControllerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the machinecontroller.
MachineControllerKubeconfigSecretName = "machinecontroller-kubeconfig"
// CloudControllerManagerKubeconfigSecretName is the name for the secret containing the kubeconfig used by the external cloud provider.
CloudControllerManagerKubeconfigSecretName = "cloud-controller-manager-kubeconfig"
// MachineControllerWebhookServingCertSecretName is the name for the secret containing the serving cert for the
// machine-controller webhook.
MachineControllerWebhookServingCertSecretName = "machinecontroller-webhook-serving-cert"
// MachineControllerWebhookServingCertCertKeyName is the name for the key that contains the cert.
MachineControllerWebhookServingCertCertKeyName = "cert.pem"
// MachineControllerWebhookServingCertKeyKeyName is the name for the key that contains the key.
MachineControllerWebhookServingCertKeyKeyName = "key.pem"
// OperatingSystemManagerWebhookServingCertSecretName is the name for the operating-system-manager webhook TLS server certificate secret.
OperatingSystemManagerWebhookServingCertSecretName = "operating-system-manager-webhook-serving-cert"
// OperatingSystemManagerWebhookServingCertCertKeyName is the name for the key that contains the cert.
OperatingSystemManagerWebhookServingCertCertKeyName = "tls.crt"
// OperatingSystemManagerWebhookServingCertCertKeyName is the name for the key that contains the private key.
OperatingSystemManagerWebhookServingCertKeyKeyName = "tls.key"
// PrometheusApiserverClientCertificateSecretName is the name for the secret containing the client certificate used by prometheus to access the apiserver.
PrometheusApiserverClientCertificateSecretName = "prometheus-apiserver-certificate"
// ClusterAutoscalerKubeconfigSecretName is the name of the kubeconfig secret used for
// the cluster-autoscaler.
ClusterAutoscalerKubeconfigSecretName = "cluster-autoscaler-kubeconfig"
// KubernetesDashboardKubeconfigSecretName is the name of the kubeconfig secret user for Kubernetes Dashboard.
KubernetesDashboardKubeconfigSecretName = "kubernetes-dashboard-kubeconfig"
// WEBTerminalKubeconfigSecretName is the name of the kubeconfig secret user for WEB terminal tools pod.
WEBTerminalKubeconfigSecretName = "web-terminal-kubeconfig"
// ImagePullSecretName specifies the name of the dockercfg secret used to access the private repo.
ImagePullSecretName = "dockercfg"
// FrontProxyCASecretName is the name for the secret containing the front proxy ca.
FrontProxyCASecretName = "front-proxy-ca"
// CASecretName is the name for the secret containing the root ca.
CASecretName = "ca"
// ApiserverTLSSecretName is the name for the secrets required for the apiserver tls.
ApiserverTLSSecretName = "apiserver-tls"
// KubeletClientCertificatesSecretName is the name for the secret containing the kubelet client certificates.
KubeletClientCertificatesSecretName = "kubelet-client-certificates"
// ServiceAccountKeySecretName is the name for the secret containing the service account key.
ServiceAccountKeySecretName = "service-account-key"
// TokensSecretName is the name for the secret containing the user tokens.
TokensSecretName = "tokens"
// ViewerTokenSecretName is the name for the secret containing the viewer token.
ViewerTokenSecretName = "viewer-token"
// OpenVPNCASecretName is the name of the secret that contains the OpenVPN CA.
OpenVPNCASecretName = "openvpn-ca"
// OpenVPNServerCertificatesSecretName is the name for the secret containing the openvpn server certificates.
OpenVPNServerCertificatesSecretName = "openvpn-server-certificates"
// OpenVPNClientCertificatesSecretName is the name for the secret containing the openvpn client certificates.
OpenVPNClientCertificatesSecretName = "openvpn-client-certificates"
// CloudConfigSecretName is the name for the secret containing the cloud-config inside the user cluster.
CloudConfigSecretName = "cloud-config"
// CSICloudConfigSecretName is the name for the secret containing the cloud-config used by the csi driver inside the user cluster.
CSICloudConfigSecretName = "cloud-config-csi"
// EtcdTLSCertificateSecretName is the name for the secret containing the etcd tls certificate used for transport security.
EtcdTLSCertificateSecretName = "etcd-tls-certificate"
// ApiserverEtcdClientCertificateSecretName is the name for the secret containing the client certificate used by the apiserver for authenticating against etcd.
ApiserverEtcdClientCertificateSecretName = "apiserver-etcd-client-certificate"
// ApiserverFrontProxyClientCertificateSecretName is the name for the secret containing the apiserver's client certificate for proxy auth.
ApiserverFrontProxyClientCertificateSecretName = "apiserver-proxy-client-certificate"
// GoogleServiceAccountSecretName is the name of the secret that contains the Google Service Account.
GoogleServiceAccountSecretName = "google-service-account"
// GoogleServiceAccountVolumeName is the name of the volume containing the Google Service Account secret.
GoogleServiceAccountVolumeName = "google-service-account-volume"
// AuditLogVolumeName is the name of the volume that hold the audit log of the apiserver.
AuditLogVolumeName = "audit-log"
// KubernetesDashboardKeyHolderSecretName is the name of the secret that contains JWE token encryption key
// used by the Kubernetes Dashboard.
KubernetesDashboardKeyHolderSecretName = "kubernetes-dashboard-key-holder"
// KubernetesDashboardCsrfTokenSecretName is the name of the secret that contains CSRF token used by
// the Kubernetes Dashboard.
KubernetesDashboardCsrfTokenSecretName = "kubernetes-dashboard-csrf"
// CABundleConfigMapName is the name for the configmap that contains the CA bundle for all usercluster components.
CABundleConfigMapName = "ca-bundle"
// CABundleConfigMapKey is the key under which a ConfigMap must contain a PEM-encoded collection of certificates.
CABundleConfigMapKey = "ca-bundle.pem"
// CloudConfigSeedSecretName is the name for the secret containing the cloud-config inside the usercluster namespace
// on the seed cluster. Not to be confused with CloudConfigSecretName, which is the copy of this Secret inside the
// usercluster.
CloudConfigSeedSecretName = "cloud-config"
// CloudConfigKey is the key under which the cloud-config in the cloud-config Secret can be found.
CloudConfigKey = "config"
// OpenVPNClientConfigsConfigMapName is the name for the ConfigMap containing the OpenVPN client config used within the user cluster.
OpenVPNClientConfigsConfigMapName = "openvpn-client-configs"
// OpenVPNClientConfigConfigMapName is the name for the ConfigMap containing the OpenVPN client config used by the client inside the user cluster.
OpenVPNClientConfigConfigMapName = "openvpn-client-config"
// ClusterInfoConfigMapName is the name for the ConfigMap containing the cluster-info used by the bootstrap token mechanism.
ClusterInfoConfigMapName = "cluster-info"
// PrometheusConfigConfigMapName is the name for the configmap containing the prometheus config.
PrometheusConfigConfigMapName = "prometheus"
// AuditConfigMapName is the name for the configmap that contains the content of the file that will be passed to the apiserver with the flag "--audit-policy-file".
AuditConfigMapName = "audit-config"
// FluentBitSecretName is the name of the secret that contains the fluent-bit configuration mounted
// into kube-apisever and used by the "audit-logs" sidecar to ship audit logs.
FluentBitSecretName = "audit-logs-fluentbit"
// AdmissionControlConfigMapName is the name for the configmap that contains the Admission Controller config file.
AdmissionControlConfigMapName = "adm-control"
// PrometheusServiceAccountName is the name for the Prometheus serviceaccount.
PrometheusServiceAccountName = "prometheus"
// PrometheusRoleName is the name for the Prometheus role.
PrometheusRoleName = "prometheus"
// PrometheusRoleBindingName is the name for the Prometheus rolebinding.
PrometheusRoleBindingName = "prometheus"
// CloudControllerManagerRoleBindingName is the name for the cloud controller manager rolebinding.
CloudControllerManagerRoleBindingName = "cloud-controller-manager"
// DefaultServiceAccountName is the name of Kubernetes default service accounts.
DefaultServiceAccountName = "default"
// OperatingSystemManagerCertUsername is the name of the user coming from kubeconfig cert.
OperatingSystemManagerCertUsername = "operating-system-manager"
// OperatingSystemManagerWebhookCertUsername is the name of the user coming from the kubeconfig cert.
OperatingSystemManagerWebhookCertUsername = "operating-system-manager-webhook"
// MachineControllerCertUsername is the name of the user coming from kubeconfig cert.
MachineControllerCertUsername = "machine-controller"
// KubeStateMetricsCertUsername is the name of the user coming from kubeconfig cert.
KubeStateMetricsCertUsername = "kube-state-metrics"
// MetricsServerCertUsername is the name of the user coming from kubeconfig cert.
MetricsServerCertUsername = "metrics-server"
// MetricsServerServiceAccountName is the name of the metrics server service account.
MetricsServerServiceAccountName = "metrics-server"
// ControllerManagerCertUsername is the name of the user coming from kubeconfig cert.
ControllerManagerCertUsername = "system:kube-controller-manager"
// CloudControllerManagerCertUsername is the name of the user coming from kubeconfig cert.
CloudControllerManagerCertUsername = "system:cloud-controller-manager"
// SchedulerCertUsername is the name of the user coming from kubeconfig cert.
SchedulerCertUsername = "system:kube-scheduler"
// KubeletDnatControllerCertUsername is the name of the user coming from kubeconfig cert.
KubeletDnatControllerCertUsername = "kubermatic:kubeletdnat-controller"
// PrometheusCertUsername is the name of the user coming from kubeconfig cert.
PrometheusCertUsername = "prometheus"
// ClusterAutoscalerCertUsername is the name of the user coming from the CA kubeconfig cert.
ClusterAutoscalerCertUsername = "kubermatic:cluster-autoscaler"
// KubernetesDashboardCertUsername is the name of the user coming from kubeconfig cert.
KubernetesDashboardCertUsername = "kubermatic:kubernetes-dashboard"
// MetricsScraperServiceAccountUsername is the name of the user coming from kubeconfig cert.
MetricsScraperServiceAccountUsername = "dashboard-metrics-scraper"
// KubeletDnatControllerClusterRoleName is the name for the KubeletDnatController cluster role.
KubeletDnatControllerClusterRoleName = "system:kubermatic-kubeletdnat-controller"
// KubeletDnatControllerClusterRoleBindingName is the name for the KubeletDnatController clusterrolebinding.
KubeletDnatControllerClusterRoleBindingName = "system:kubermatic-kubeletdnat-controller"
// ClusterInfoReaderRoleName is the name for the role which allows reading the cluster-info ConfigMap.
ClusterInfoReaderRoleName = "cluster-info"
// MachineControllerRoleName is the name for the MachineController roles.
MachineControllerRoleName = "machine-controller"
// OperatingSystemManagerRoleName is the name for the OperatingSystemManager roles.
OperatingSystemManagerRoleName = "operating-system-manager"
// MachineControllerRoleBindingName is the name for the MachineController rolebinding.
MachineControllerRoleBindingName = "machine-controller"
// OperatingSystemManagerRoleBindingName is the name for the OperatingSystemManager rolebinding.
OperatingSystemManagerRoleBindingName = "operating-system-manager"
// ClusterInfoAnonymousRoleBindingName is the name for the RoleBinding giving access to the cluster-info ConfigMap to anonymous users.
ClusterInfoAnonymousRoleBindingName = "cluster-info"
// MetricsServerAuthReaderRoleName is the name for the metrics server role.
MetricsServerAuthReaderRoleName = "metrics-server-auth-reader"
// MachineControllerClusterRoleName is the name for the MachineController cluster role.
MachineControllerClusterRoleName = "system:kubermatic-machine-controller"
// OperatingSystemManagerClusterRoleName is the name for the OperatingSystemManager cluster role.
OperatingSystemManagerClusterRoleName = "system:kubermatic-operating-system-manager"
// KubeStateMetricsClusterRoleName is the name for the KubeStateMetrics cluster role.
KubeStateMetricsClusterRoleName = "system:kubermatic-kube-state-metrics"
// MetricsServerClusterRoleName is the name for the metrics server cluster role.
MetricsServerClusterRoleName = "system:metrics-server"
// PrometheusClusterRoleName is the name for the Prometheus cluster role.
PrometheusClusterRoleName = "external-prometheus"
// MachineControllerClusterRoleBindingName is the name for the MachineController ClusterRoleBinding.
MachineControllerClusterRoleBindingName = "system:kubermatic-machine-controller"
// OperatingSystemManagerClusterRoleBindingName is the name for the OperatingSystemManager ClusterRoleBinding.
OperatingSystemManagerClusterRoleBindingName = "system:kubermatic-operating-system-manager"
// KubeStateMetricsClusterRoleBindingName is the name for the KubeStateMetrics ClusterRoleBinding.
KubeStateMetricsClusterRoleBindingName = "system:kubermatic-kube-state-metrics"
// PrometheusClusterRoleBindingName is the name for the Prometheus ClusterRoleBinding.
PrometheusClusterRoleBindingName = "system:external-prometheus"
// MetricsServerResourceReaderClusterRoleBindingName is the name for the metrics server ClusterRoleBinding.
MetricsServerResourceReaderClusterRoleBindingName = "system:metrics-server"
// ClusterAutoscalerClusterRoleName is the name of the clusterrole for the cluster autoscaler.
ClusterAutoscalerClusterRoleName = "system:kubermatic-cluster-autoscaler"
// ClusterAutoscalerClusterRoleBindingName is the name of the clusterrolebinding for the CA.
ClusterAutoscalerClusterRoleBindingName = "system:kubermatic-cluster-autoscaler"
// KubernetesDashboardRoleName is the name of the role for the Kubernetes Dashboard.
KubernetesDashboardRoleName = "system:kubernetes-dashboard"
// KubernetesDashboardRoleBindingName is the name of the role binding for the Kubernetes Dashboard.
KubernetesDashboardRoleBindingName = "system:kubernetes-dashboard"
// MetricsScraperClusterRoleName is the name of the role for the dashboard-metrics-scraper.
MetricsScraperClusterRoleName = "system:dashboard-metrics-scraper"
// MetricsScraperClusterRoleBindingName is the name of the role binding for the dashboard-metrics-scraper.
MetricsScraperClusterRoleBindingName = "system:dashboard-metrics-scraper"
// EtcdPodDisruptionBudgetName is the name of the PDB for the etcd StatefulSet.
EtcdPodDisruptionBudgetName = "etcd"
// ApiserverPodDisruptionBudgetName is the name of the PDB for the apiserver deployment.
ApiserverPodDisruptionBudgetName = "apiserver"
// MetricsServerPodDisruptionBudgetName is the name of the PDB for the metrics-server deployment.
MetricsServerPodDisruptionBudgetName = "metrics-server"
// KubermaticNamespace is the main kubermatic namespace.
KubermaticNamespace = "kubermatic"
// KubermaticWebhookServiceName is the name of the kuberamtic webhook service in seed cluster.
KubermaticWebhookServiceName = "kubermatic-webhook"
// GatekeeperControllerDeploymentName is the name of the gatekeeper controller deployment.
GatekeeperControllerDeploymentName = "gatekeeper-controller-manager"
// GatekeeperAuditDeploymentName is the name of the gatekeeper audit deployment.
GatekeeperAuditDeploymentName = "gatekeeper-audit"
// GatekeeperWebhookServiceName is the name of the gatekeeper webhook service.
GatekeeperWebhookServiceName = "gatekeeper-webhook-service"
// GatekeeperWebhookServerCertSecretName is the name of the gatekeeper webhook cert secret name.
GatekeeperWebhookServerCertSecretName = "gatekeeper-webhook-server-cert"
// GatekeeperPodDisruptionBudgetName is the name of the PDB for the gatekeeper controller manager.
GatekeeperPodDisruptionBudgetName = "gatekeeper-controller-manager"
// GatekeeperRoleName is the name for the Gatekeeper role.
GatekeeperRoleName = "gatekeeper-manager-role"
// GatekeeperRoleBindingName is the name for the Gatekeeper rolebinding.
GatekeeperRoleBindingName = "gatekeeper-manager-rolebinding"
// GatekeeperServiceAccountName is the name for the Gatekeeper service account.
GatekeeperServiceAccountName = "gatekeeper-admin"
// GatekeeperNamespace is the main gatkeeper namespace where the gatekeeper config is stored.
GatekeeperNamespace = "gatekeeper-system"
// ExperimentalEnableMutation enables gatekeeper to validate created kubernetes resources and also modify them based on defined mutation policies.
ExperimentalEnableMutation = false
// AuditMatchKindOnly enables gatekeeper to only audit resources in OPA cache.
AuditMatchKindOnly = false
// ConstraintViolationsLimit defines the maximum number of audit violations reported on a constraint.
ConstraintViolationsLimit = 20
// GatekeeperExemptNamespaceLabel label key for exempting namespaces from Gatekeeper checks.
GatekeeperExemptNamespaceLabel = "admission.gatekeeper.sh/ignore"
// ClusterCloudCredentialsSecretName is the name the Secret in the cluster namespace that contains
// the cloud provider credentials. This Secret is a copy of the credentials secret from the KKP
// namespace (which has a dynamic name).
ClusterCloudCredentialsSecretName = "cloud-credentials"
// CloudInitSettingsNamespace are used in order to reach, authenticate and be authorized by the api server, to fetch
// the machine provisioning cloud-init.
CloudInitSettingsNamespace = "cloud-init-settings"
// DefaultOwnerReadOnlyMode represents file mode with read permission for owner only.
DefaultOwnerReadOnlyMode = 0400
// DefaultAllReadOnlyMode represents file mode with read permissions for all.
DefaultAllReadOnlyMode = 0444
// AppLabelKey defines the label key app which should be used within resources.
AppLabelKey = "app"
// ClusterLabelKey defines the label key for the cluster name.
ClusterLabelKey = "cluster"
// VersionLabel is the label containing the application's version.
VersionLabel = "app.kubernetes.io/version"
// EtcdClusterSize defines the size of the etcd to use.
EtcdClusterSize = 3
// RegistryK8SGCR defines the kubernetes specific docker registry at google.
RegistryK8SGCR = "k8s.gcr.io"
// RegistryK8S defines the (new) official registry hosted by the Kubernetes project.
RegistryK8S = "registry.k8s.io"
// RegistryEUGCR defines the docker registry at google EU.
RegistryEUGCR = "eu.gcr.io"
// RegistryUSGCR defines the docker registry at google US.
RegistryUSGCR = "us.gcr.io"
// RegistryGCR defines the kubernetes docker registry at google.
RegistryGCR = "gcr.io"
// RegistryDocker defines the default docker.io registry.
RegistryDocker = "docker.io"
// RegistryQuay defines the image registry from coreos/redhat - quay.
RegistryQuay = "quay.io"
// RegistryMCR defines the image registry at Microsoft.
RegistryMCR = "mcr.microsoft.com"
// RegistryAnexia defines the anexia specific docker registry.
RegistryAnexia = "anx-cr.io"
// TopologyKeyHostname defines the topology key for the node hostname.
TopologyKeyHostname = "kubernetes.io/hostname"
// TopologyKeyZone defines the topology key for the node's cloud provider zone.
TopologyKeyZone = "topology.kubernetes.io/zone"
// ClusterAutoscalerSafeToEvictVolumesAnnotation is an annotation that contains a comma-separated
// list of hostPath/emptyDir volumes that should not block the pod from being evicted by the
// cluster-autoscaler.
// See https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node
// for more information.
ClusterAutoscalerSafeToEvictVolumesAnnotation = "cluster-autoscaler.kubernetes.io/safe-to-evict-local-volumes"
// MachineCRDName defines the CRD name for machine objects.
MachineCRDName = "machines.cluster.k8s.io"
// MachineSetCRDName defines the CRD name for machineset objects.
MachineSetCRDName = "machinesets.cluster.k8s.io"
// MachineDeploymentCRDName defines the CRD name for machinedeployment objects.
MachineDeploymentCRDName = "machinedeployments.cluster.k8s.io"
// MachineControllerMutatingWebhookConfigurationName is the name of the machine-controllers mutating webhook
// configuration.
MachineControllerMutatingWebhookConfigurationName = "machine-controller.kubermatic.io"
// OperatingSystemManagerMutatingWebhookConfigurationName is the name of OSM's mutating webhook configuration.
OperatingSystemManagerMutatingWebhookConfigurationName = "operating-system-manager.kubermatic.io"
// OperatingSystemManagerOperatingSystemProfileCRDName defines the CRD name for OSM operatingSysatemProfile objects.
OperatingSystemManagerOperatingSystemProfileCRDName = "operatingsystemprofiles.operatingsystemmanager.k8c.io"
// OperatingSystemManagerOperatingSystemConfigCRDName defines the CRD name for OSM operatingSystemConfig objects.
OperatingSystemManagerOperatingSystemConfigCRDName = "operatingsystemconfigs.operatingsystemmanager.k8c.io"
// OperatingSystemManagerValidatingWebhookConfigurationName is the name of OSM's validating webhook configuration.
OperatingSystemManagerValidatingWebhookConfigurationName = "operating-system-manager.kubermatic.io"
// GatekeeperValidatingWebhookConfigurationName is the name of the gatekeeper validating webhook
// configuration.
GatekeeperValidatingWebhookConfigurationName = "gatekeeper-validating-webhook-configuration"
GatekeeperMutatingWebhookConfigurationName = "gatekeeper-mutating-webhook-configuration"
// InternalUserClusterAdminKubeconfigSecretName is the name of the secret containing an admin kubeconfig that can only be used from
// within the seed cluster.
InternalUserClusterAdminKubeconfigSecretName = "internal-admin-kubeconfig"
// InternalUserClusterAdminKubeconfigCertUsername is the name of the user coming from kubeconfig cert.
InternalUserClusterAdminKubeconfigCertUsername = "kubermatic-controllers"
// IPVSProxyMode defines the ipvs kube-proxy mode.
IPVSProxyMode = "ipvs"
// IPTablesProxyMode defines the iptables kube-proxy mode.
IPTablesProxyMode = "iptables"
// EBPFProxyMode defines the eBPF proxy mode (disables kube-proxy and requires CNI support).
EBPFProxyMode = "ebpf"
// PodNodeSelectorAdmissionPlugin defines PodNodeSelector admission plugin.
PodNodeSelectorAdmissionPlugin = "PodNodeSelector"
// EventRateLimitAdmisionPlugin defines the EventRateLimit admission plugin.
EventRateLimitAdmissionPlugin = "EventRateLimit"
// KubeVirtInfraSecretName is the name for the secret containing the kubeconfig of the kubevirt infra cluster.
KubeVirtInfraSecretName = "cloud-controller-manager-infra-kubeconfig"
// KubeVirtInfraSecretKey infra kubeconfig.
KubeVirtInfraSecretKey = "infra-kubeconfig"
// KubeVirtCSISecretName is the name for the secret containing the kubeconfig of the kubevirt infra cluster for the CSI controller.
KubeVirtCSISecretName = "csi-infra-kubeconfig"
// KubeVirtCSISecretKey is the key in the previous secret.
KubeVirtCSISecretKey = "kubeconfig"
// KubeVirtCSINamespaceKey is the key name of the field containing the infra cluster namespace in the CSI ConfigMap.
KubeVirtCSINamespaceKey = "infraClusterNamespace"
// KubeVirtCSIClusterLabelKey is the key name of the field containing the infra cluster labels in the CSI ConfigMap.
KubeVirtCSIClusterLabelKey = "infraClusterLabels"
// KubeVirtCSIConfigMapName is the name of the configmap for the CSI controller.
KubeVirtCSIConfigMapName = "csi-driver-config"
// KubeVirtCSIControllerName is the name of the deployment of the CSI controller.
KubeVirtCSIControllerName = "csi-controller"
// KubeVirtCSIServiceAccountName is the name of the service account of the CSI controller.
KubeVirtCSIServiceAccountName = "kubevirt-csi"
// KubeVirtCSIClusterRoleName is the name of the deployment of the CSI controller.
KubeVirtCSIClusterRoleName = "kubevirt-csi-controller"
// KubeVirtCSIRoleBindingName is the name of the deployment of the CSI controller.
KubeVirtCSIRoleBindingName = "csi-controller"
// VMwareCloudDirectorCSIControllerName is the name of the deployment of the CSI controller.
VMwareCloudDirectorCSIControllerName = "csi-controller"
// VMwareCloudDirectorCSISecretName is the name for the secret containing the credentials for VMware Cloud Director.
VMwareCloudDirectorCSISecretName = "vcloud-basic-auth"
// VMwareCloudDirectorCSIConfigmapName is the name for the configmap containing the configmap for VMware Cloud Director CSI driver.
VMwareCloudDirectorCSIConfigmapName = "vcloud-csi-configmap"
// VMwareCloudDirectorCSIServiceAccountName is the name of the service account of the CSI controller.
VMwareCloudDirectorCSIServiceAccountName = "vcloud-csi"
// VMwareCloudDirectorCertUsername is the name of the user coming from kubeconfig cert.
VMwareCloudDirectorCSICertUsername = "kubermatic:vcloud-csi"
// VMwareCloudDirectorCSIKubeconfigSecretName is the name for the secret containing the kubeconfig used by the osm.
VMwareCloudDirectorCSIKubeconfigSecretName = "vcloud-csi-kubeconfig"
// DefaultNodePortRange is a Kubernetes cluster's default nodeport range.
DefaultNodePortRange = "30000-32767"
)
const (
// CAKeySecretKey ca.key.
CAKeySecretKey = "ca.key"
// CACertSecretKey ca.crt.
CACertSecretKey = "ca.crt"
// ApiserverTLSKeySecretKey apiserver-tls.key.
ApiserverTLSKeySecretKey = "apiserver-tls.key"
// ApiserverTLSCertSecretKey apiserver-tls.crt.
ApiserverTLSCertSecretKey = "apiserver-tls.crt"
// KubeletClientKeySecretKey kubelet-client.key.
KubeletClientKeySecretKey = "kubelet-client.key"
// KubeletClientCertSecretKey kubelet-client.crt.
KubeletClientCertSecretKey = "kubelet-client.crt"
// ServiceAccountKeySecretKey sa.key.
ServiceAccountKeySecretKey = "sa.key"
// ServiceAccountKeyPublicKey is the public key for the service account signer key.
ServiceAccountKeyPublicKey = "sa.pub"
// KubeconfigSecretKey kubeconfig.
KubeconfigSecretKey = "kubeconfig"
// TokensSecretKey tokens.csv.
TokensSecretKey = "tokens.csv"
// ViewersTokenSecretKey viewersToken.
ViewerTokenSecretKey = "viewerToken"
// OpenVPNCACertKey cert.pem, must match CACertSecretKey, otherwise getClusterCAFromLister doesn't work as it has
// the key hardcoded.
OpenVPNCACertKey = CACertSecretKey
// OpenVPNCAKeyKey key.pem, must match CAKeySecretKey, otherwise getClusterCAFromLister doesn't work as it has
// the key hardcoded.
OpenVPNCAKeyKey = CAKeySecretKey
// OpenVPNServerKeySecretKey server.key.
OpenVPNServerKeySecretKey = "server.key"
// OpenVPNServerCertSecretKey server.crt.
OpenVPNServerCertSecretKey = "server.crt"
// OpenVPNInternalClientKeySecretKey client.key.
OpenVPNInternalClientKeySecretKey = "client.key"
// OpenVPNInternalClientCertSecretKey client.crt.
OpenVPNInternalClientCertSecretKey = "client.crt"
// EtcdTLSCertSecretKey etcd-tls.crt.
EtcdTLSCertSecretKey = "etcd-tls.crt"
// EtcdTLSKeySecretKey etcd-tls.key.
EtcdTLSKeySecretKey = "etcd-tls.key"
EtcdBackupAndRestoreS3AccessKeyIDKey = "ACCESS_KEY_ID"
EtcdBackupAndRestoreS3SecretKeyAccessKeyKey = "SECRET_ACCESS_KEY"
EtcdRestoreS3BucketNameKey = "BUCKET_NAME"
EtcdRestoreS3EndpointKey = "ENDPOINT"
EtcdRestoreDefaultS3SEndpoint = "s3.amazonaws.com"
// ApiserverEtcdClientCertificateCertSecretKey apiserver-etcd-client.crt.
ApiserverEtcdClientCertificateCertSecretKey = "apiserver-etcd-client.crt"
// ApiserverEtcdClientCertificateKeySecretKey apiserver-etcd-client.key.
ApiserverEtcdClientCertificateKeySecretKey = "apiserver-etcd-client.key"
// ApiserverProxyClientCertificateCertSecretKey apiserver-proxy-client.crt.
ApiserverProxyClientCertificateCertSecretKey = "apiserver-proxy-client.crt"
// ApiserverProxyClientCertificateKeySecretKey apiserver-proxy-client.key.
ApiserverProxyClientCertificateKeySecretKey = "apiserver-proxy-client.key"
// BackupEtcdClientCertificateCertSecretKey backup-etcd-client.crt.
BackupEtcdClientCertificateCertSecretKey = "backup-etcd-client.crt"
// BackupEtcdClientCertificateKeySecretKey backup-etcd-client.key.
BackupEtcdClientCertificateKeySecretKey = "backup-etcd-client.key"
// PrometheusClientCertificateCertSecretKey prometheus-client.crt.
PrometheusClientCertificateCertSecretKey = "prometheus-client.crt"
// PrometheusClientCertificateKeySecretKey prometheus-client.key.
PrometheusClientCertificateKeySecretKey = "prometheus-client.key"
// ServingCertSecretKey is the secret key for a generic serving cert.
ServingCertSecretKey = "serving.crt"
// ServingCertKeySecretKey is the secret key for the key of a generic serving cert.
ServingCertKeySecretKey = "serving.key"
// CloudConfigSecretKey is the secret key for cloud-config.
CloudConfigSecretKey = "config"
// NutanixCSIConfigSecretKey is the secret key for nutanix csi secret.
NutanixCSIConfigSecretKey = "key"
// NutanixCSIConfigSecretName is the secret key for nutanix csi secret.
NutanixCSIConfigSecretName = "ntnx-secret"
// VMwareCloudDirectorCSIConfigConfigMapKey is the key for VMware Cloud Director CSI configmap.
VMwareCloudDirectorCSIConfigConfigMapKey = "vcloud-csi-config.yaml"
// VMwareCloudDirectorCSIConfigConfigMapName is the name for VMware Cloud Director CSI configmap.
VMwareCloudDirectorCSIConfigConfigMapName = "vcloud-csi-configmap"
)
const (
minimumCertValidity30d = 30 * 24 * time.Hour
)
const (
ExternalClusterKubeconfigPrefix = "kubeconfig-external-cluster"
// KubeOneNamespacePrefix is the kubeone namespace prefix.
KubeOneNamespacePrefix = "kubeone"
// CredentialPrefix is the prefix used for the secrets containing cloud provider crednentials.
CredentialPrefix = "credential"
// KubeOne secret prefixes.
// don't change this as these prefixes are used for rbac generation.
KubeOneSSHSecretPrefix = "ssh-kubeone-external-cluster"
KubeOneManifestSecretPrefix = "manifest-kubeone-external-cluster"
// KubOne ConfigMap name.
KubeOneScriptConfigMapName = "kubeone"
// KubeOne secret keys.
KubeOneManifest = "manifest"
KubeOneSSHPrivateKey = "id_rsa"
KubeOneSSHPassphrase = "passphrase"
ContainerRuntimeDocker = "docker"
ContainerRuntimeContainerd = "containerd"
// KubeOne natively-supported providers.
KubeOneAWS = "aws"
KubeOneGCP = "gcp"
KubeOneAzure = "azure"
KubeOneDigitalOcean = "digitalocean"
KubeOneHetzner = "hetzner"
KubeOneNutanix = "nutanix"
KubeOneVMwareCloudDirector = "vmwareCloudDirector"
KubeOneOpenStack = "openstack"
KubeOneEquinix = "equinix"
KubeOneVSphere = "vsphere"
KubeOneImage = "quay.io/kubermatic/kubeone"
KubeOneImageTag = "v1.7.2"
KubeOneScript = `
#!/usr/bin/env bash
eval ` + "`" + "ssh-agent" + "`" + ` > /dev/null
printf "#!/bin/sh\necho $PASSPHRASE" > script_returning_pass
chmod +x script_returning_pass
DISPLAY=1 SSH_ASKPASS="./script_returning_pass" ssh-add ~/.ssh/id_rsa > /dev/null 2> /dev/null
rm ${SSH_ASKPASS} -f
`
)
const (
AWSAccessKeyID = "accessKeyId"
AWSSecretAccessKey = "secretAccessKey"
AWSAssumeRoleARN = "assumeRoleARN"
AWSAssumeRoleExternalID = "assumeRoleExternalID"
AzureTenantID = "tenantID"
AzureSubscriptionID = "subscriptionID"
AzureClientID = "clientID"
AzureClientSecret = "clientSecret"
DigitaloceanToken = "token"
GCPServiceAccount = "serviceAccount"
HetznerToken = "token"
OpenstackUsername = "username"
OpenstackPassword = "password"
OpenstackTenant = "tenant"
OpenstackTenantID = "tenantID"
OpenstackProject = "project"
OpenstackProjectID = "projectID"
OpenstackDomain = "domain"
OpenstackApplicationCredentialID = "applicationCredentialID"
OpenstackApplicationCredentialSecret = "applicationCredentialSecret"
OpenstackToken = "token"
// Below OpenStack constant is added for KubeOne Clusters.
OpenstackAuthURL = "authURL"
OpenstackRegion = "region"
PacketAPIKey = "apiKey"
PacketProjectID = "projectID"
KubeVirtKubeconfig = "kubeConfig"
VsphereUsername = "username"
VspherePassword = "password"
VsphereInfraManagementUserUsername = "infraManagementUserUsername"
VsphereInfraManagementUserPassword = "infraManagementUserPassword"
// Below VSphere constant is added for KubeOne Clusters.
VsphereServer = "server"
AlibabaAccessKeyID = "accessKeyId"
AlibabaAccessKeySecret = "accessKeySecret"
AnexiaToken = "token"
NutanixUsername = "username"
NutanixPassword = "password"
NutanixCSIUsername = "csiUsername"
NutanixCSIPassword = "csiPassword"
NutanixProxyURL = "proxyURL"
// Below Nutanix constant are added for KubeOne Clusters.
NutanixCSIEndpoint = "csiEndpoint"
NutanixClusterName = "clusterName"
NutanixAllowInsecure = "allowInsecure"
NutanixEndpoint = "endpoint"
NutanixPort = "port"
// VMware Cloud Director provider constants.
VMwareCloudDirectorUsername = "username"
VMwareCloudDirectorAPIToken = "apiToken"
VMwareCloudDirectorPassword = "password"
VMwareCloudDirectorOrganization = "organization"
VMwareCloudDirectorVDC = "vdc"
VMwareCloudDirectorURL = "url"
ServiceAccountTokenType = "kubernetes.io/service-account-token"
ServiceAccountTokenAnnotation = "kubernetes.io/service-account.name"
UserSSHKeys = "usersshkeys"
)
const (
CoreDNSClusterRoleName = "system:coredns"
CoreDNSClusterRoleBindingName = "system:coredns"
CoreDNSServiceAccountName = "coredns"
CoreDNSServiceName = "kube-dns"
CoreDNSConfigMapName = "coredns"
CoreDNSDeploymentName = "coredns"
CoreDNSPodDisruptionBudgetName = "coredns"
)
const (
EnvoyAgentConfigMapName = "envoy-agent"
EnvoyAgentConfigFileName = "envoy.yaml"
EnvoyAgentDaemonSetName = "envoy-agent"
EnvoyAgentCreateInterfaceInitContainerName = "create-dummy-interface"
EnvoyAgentAssignAddressContainerName = "assign-address"
EnvoyAgentDeviceSetupImage = "kubermatic/network-interface-manager"
// Default tunneling agent IP address.
DefaultTunnelingAgentIP = "100.64.30.10"
)
const (
NodeLocalDNSServiceAccountName = "node-local-dns"
NodeLocalDNSConfigMapName = "node-local-dns"
NodeLocalDNSDaemonSetName = "node-local-dns"
DefaultNodeLocalDNSCacheEnabled = true
)
const (
TokenBlacklist = "token-blacklist"
)
const (
ExternalClusterIsImported = "is-imported"
ExternalClusterIsImportedTrue = "true"
ExternalClusterIsImportedFalse = "false"
ExternalClusterKubeconfig = "kubeconfig"
ExternalEKSClusterAccessKeyID = "accessKeyId"
ExternalEKSClusterSecretAccessKey = "secretAccessKey"
ExternalGKEClusterSeriveAccount = "serviceAccount"
GKEUnspecifiedReleaseChannel = "UNSPECIFIED"
GKERapidReleaseChannel = "RAPID"
GKERegularReleaseChannel = "REGULAR"
GKEStableReleaseChannel = "STABLE"
ExternalAKSClusterTenantID = "tenantID"
ExternalAKSClusterSubscriptionID = "subscriptionID"
ExternalAKSClusterClientID = "clientID"
ExternalAKSClusterClientSecret = "clientSecret"
AKSNodepoolNameLabel = "kubernetes.azure.com/agentpool"
EKSNodeGroupNameLabel = "eks.amazonaws.com/nodegroup"
GKENodepoolNameLabel = "cloud.google.com/gke-nodepool"
)
type AKSState string
const (
CreatingAKSState AKSState = "Creating"
RunningAKSState AKSState = "Running"
StartingAKSState AKSState = "Starting"
StoppingAKSState AKSState = "Stopping"
SucceededAKSState AKSState = "Succeeded"
StoppedAKSState AKSState = "Stopped"
FailedAKSState AKSState = "Failed"
DeletingAKSState AKSState = "Deleting"
UpgradingAKSState AKSState = "Upgrading"
)
type AKSMDState string
const (
CreatingAKSMDState AKSMDState = "Creating"
SucceededAKSMDState AKSMDState = "Succeeded"
RunningAKSMDState AKSMDState = "Running"
StoppedAKSMDState AKSMDState = "Stopped"
FailedAKSMDState AKSMDState = "Failed"
DeletingAKSMDState AKSMDState = "Deleting"
UpgradingAKSMDState AKSMDState = "Upgrading"
UpdatingAKSMDState AKSMDState = "Updating"
ScalingAKSMDState AKSMDState = "Scaling"
StartingAKSMDState AKSMDState = "Starting"
)
type EKSState string
const (
CreatingEKSState EKSState = "CREATING"
PendingEKSState EKSState = "PENDING"
ActiveEKSState EKSState = "ACTIVE"
UpdatingEKSState EKSState = "UPDATING"
DeletingEKSState EKSState = "DELETING"
FailedEKSState EKSState = "FAILED"
)
type EKSMDState string
const (
CreatingEKSMDState EKSMDState = "CREATING"
ActiveEKSMDState EKSMDState = "ACTIVE"
UpdatingEKSMDState EKSMDState = "UPDATING"
DeletingEKSMDState EKSMDState = "DELETING"
CreateFailedEKSMDState EKSMDState = "CREATE_FAILED"
DeleteFailedEKSMDState EKSMDState = "DELETE_FAILED"
DegradedEKSMDState EKSMDState = "DEGRADED"
)
type GKEState string
const (
ProvisioningGKEState GKEState = "PROVISIONING"
RunningGKEState GKEState = "RUNNING"
ReconcilingGKEState GKEState = "RECONCILING"
StoppingGKEState GKEState = "STOPPING"
ErrorGKEState GKEState = "ERROR"
DegradedGKEState GKEState = "DEGRADED"
UnspecifiedGKEState GKEState = "STATUS_UNSPECIFIED"
)
type GKEMDState string
const (
ProvisioningGKEMDState GKEMDState = "PROVISIONING"
RunningGKEMDState GKEMDState = "RUNNING"
ReconcilingGKEMDState GKEMDState = "RECONCILING"
StoppingGKEMDState GKEMDState = "STOPPING"
ErrorGKEMDState GKEMDState = "ERROR"
RunningWithErrorGKEMDState GKEMDState = "RUNNING_WITH_ERROR"
UnspecifiedGKEMDState GKEMDState = "STATUS_UNSPECIFIED"
)
const (
EtcdTrustedCAFile = "/etc/etcd/pki/ca/ca.crt"
EtcdCertFile = "/etc/etcd/pki/tls/etcd-tls.crt"
EtcdKeyFile = "/etc/etcd/pki/tls/etcd-tls.key"
EtcdPeerCertFile = "/etc/etcd/pki/tls/etcd-tls.crt"
EtcdPeerKeyFile = "/etc/etcd/pki/tls/etcd-tls.key"
EtcdClientCertFile = "/etc/etcd/pki/client/apiserver-etcd-client.crt"
EtcdClientKeyFile = "/etc/etcd/pki/client/apiserver-etcd-client.key"
)
const (
// CSIMigrationWebhookName is the name of the csi-migration webhook service.
CSIMigrationWebhookName = "csi-migration-webhook"
// CSIMigrationWebhookSecretName defines the name of the secret containing the certificates for the csi-migration admission webhook.
CSIMigrationWebhookSecretName = "csi-migration-webhook-certs"
// CSIMigrationWebhookConfig is the name for the key that contains the webhook config.
CSIMigrationWebhookConfig = "webhook.config"
// CSIMigrationWebhookPort is the port used by the CSI-migration webhook.
CSIMigrationWebhookPort = 8443
// VsphereCSIMigrationWebhookConfigurationWebhookName is the webhook's name in the vSphere CSI_migration WebhookConfiguration.
VsphereCSIMigrationWebhookConfigurationWebhookName = "validation.csi.vsphere.vmware.com"
// CSISnapshotValidationWebhookConfigurationName part of kubernetes-csi external-snapshotter validation webhook.
CSISnapshotValidationWebhookConfigurationName = "validation-webhook.snapshot.storage.k8s.io"
// CSISnapshotValidationWebhookName part of kubernetes-csi external-snapshotter validation webhook.
CSISnapshotValidationWebhookName = "snapshot-validation-service"
CSISnapshotWebhookSecretName = "csi-snapshot-webhook-certs"
// CSIWebhookServingCertCertKeyName is the name for the key that contains the cert.
CSIWebhookServingCertCertKeyName = "cert.pem"
// CSIWebhookServingCertKeyKeyName is the name for the key that contains the key.
CSIWebhookServingCertKeyKeyName = "key.pem"
)
const (
// KubeLBKubeconfigSecretName is the name for the secret containing the kubeconfig used by the kubelb CCM.
KubeLBCCMKubeconfigSecretName = "kubelb-ccm-kubeconfig"
// KubeLBManagerKubeconfigSecretName is the name for the secret containing the kubeconfig for the kubelb management cluster used by the kubelb CCM.
KubeLBManagerKubeconfigSecretName = "kubelb-manager-kubeconfig"
// KubeLBAppName is the name of the kubelb app.
KubeLBAppName = "kubelb-ccm"
)
const (
UserClusterMLANamespace = "mla-system"
MLAComponentName = "mla"
MLALoggingAgentServiceAccountName = "mla-logging-agent"
MLALoggingAgentClusterRoleName = "system:mla:mla-logging-agent"
MLALoggingAgentClusterRoleBindingName = "system:mla:mla-logging-agent"
MLALoggingAgentSecretName = "mla-logging-agent"
MLALoggingAgentDaemonSetName = "mla-logging-agent"
MLAMonitoringAgentConfigMapName = "mla-monitoring-agent"
MLAMonitoringAgentServiceAccountName = "mla-monitoring-agent"
MLAMonitoringAgentClusterRoleName = "system:mla:mla-monitoring-agent"
MLAMonitoringAgentClusterRoleBindingName = "system:mla:mla-monitoring-agent"
MLAMonitoringAgentDeploymentName = "mla-monitoring-agent"
// MLAGatewayExternalServiceName is the name for the MLA Gateway external service.
MLAGatewayExternalServiceName = "mla-gateway-ext"
// MLAGatewaySNIPrefix is the URL prefix which identifies the MLA Gateway endpoint in the external URL if SNI expose strategy is used.
MLAGatewaySNIPrefix = "mla-gateway."
// MLAGatewayCASecretName is the name for the secret containing the MLA Gateway CA certificates.
MLAGatewayCASecretName = "mla-gateway-ca"
MLAGatewayCACertKey = CACertSecretKey
MLAGatewayCAKeyKey = CAKeySecretKey
// MLAGatewayCertificatesSecretName is the name for the secret containing the MLA Gateway certificates.
MLAGatewayCertificatesSecretName = "mla-gateway-certificates"
MLAGatewayKeySecretKey = "gateway.key"
MLAGatewayCertSecretKey = "gateway.crt"
// MLAMonitoringAgentCertificatesSecretName is the name for the secret containing the Monitoring Agent (grafana-agent) client certificates.
MLAMonitoringAgentCertificatesSecretName = "monitoring-agent-certificates"
MLAMonitoringAgentCertificateCommonName = "grafana-agent"
MLAMonitoringAgentClientKeySecretKey = "client.key"
MLAMonitoringAgentClientCertSecretKey = "client.crt"
MLAMonitoringAgentClientCertMountPath = "/etc/ssl/mla"
// MLALoggingAgentCertificatesSecretName is the name for the secret containing the Logging Agent client certificates.
MLALoggingAgentCertificatesSecretName = "logging-agent-certificates"
MLALoggingAgentCertificateCommonName = "logging-agent"
MLALoggingAgentClientKeySecretKey = "client.key"
MLALoggingAgentClientCertSecretKey = "client.crt"
MLALoggingAgentClientCertMountPath = "/etc/ssl/mla"
AlertmanagerName = "alertmanager"
DefaultAlertmanagerConfigSecretName = "alertmanager"
AlertmanagerConfigSecretKey = "alertmanager.yaml"
DefaultAlertmanagerConfig = `
template_files: {}
alertmanager_config: |
route:
receiver: 'null'
receivers:
- name: 'null'
`
// MLAAdminSettingsName specifies a fixed name of the MLA admin settings custom resource in the cluster namespace.
MLAAdminSettingsName = "mla-admin-settings"
// Konnectivity.
KonnectivityDeploymentName = "konnectivity-agent"
KonnectivityClusterRoleBindingName = "system:konnectivity-server"
KonnectivityClusterRoleBindingUsername = "system:konnectivity-server"
KonnectivityServiceAccountName = "system-konnectivity-agent"
KonnectivityAgentContainer = "konnectivity-agent"
KonnectivityServerContainer = "konnectivity-server"
KonnectivityAgentToken = "system-konnectivity-agent-token"
KonnectivityProxyServiceName = "konnectivity-server"
KonnectivityProxyTLSSecretName = "konnectivityproxy-tls"
KonnectivityKubeconfigSecretName = "konnectivity-kubeconfig"
KonnectivityKubeconfigUsername = "system:konnectivity-server"
KonnectivityServerConf = "kubeconfig"
KonnectivityKubeApiserverEgress = "kube-apiserver-egress"
KonnectivityUDS = "konnectivity-uds"
KonnectivityPodDisruptionBudgetName = "konnectivity-agent"
)
const (
// Legacy Prometheus resource names, used only for cleanup/migration purposes.
UserClusterLegacyPrometheusConfigMapName = "prometheus"
UserClusterLegacyPrometheusServiceAccountName = "prometheus"
UserClusterLegacyPrometheusClusterRoleName = "system:mla:prometheus"