|
| 1 | +package kubernetes |
| 2 | + |
| 3 | +import ( |
| 4 | + apps "k8s.io/api/apps/v1beta1" |
| 5 | + cert "k8s.io/api/certificates/v1beta1" |
| 6 | + api "k8s.io/api/core/v1" |
| 7 | + discovery "k8s.io/api/discovery/v1beta1" |
| 8 | + networking "k8s.io/api/networking/v1beta1" |
| 9 | + rbac "k8s.io/api/rbac/v1beta1" |
| 10 | +) |
| 11 | + |
| 12 | +// knownLabelAnnotations is a map of known internal labels and |
| 13 | +// annotations that we want to strip out to avoid unneccessary diffs. |
| 14 | +// See: https://kubernetes.io/docs/reference/labels-annotations-taints |
| 15 | +var knownLabelsAnnotations = map[string]string{ |
| 16 | + // core |
| 17 | + api.LabelHostname: "", |
| 18 | + api.LabelZoneFailureDomain: "", |
| 19 | + api.LabelZoneRegion: "", |
| 20 | + api.LabelZoneFailureDomainStable: "", |
| 21 | + api.LabelZoneRegionStable: "", |
| 22 | + api.LabelInstanceType: "", |
| 23 | + api.LabelInstanceTypeStable: "", |
| 24 | + api.LabelOSStable: "", |
| 25 | + api.LabelArchStable: "", |
| 26 | + api.LabelWindowsBuild: "", |
| 27 | + api.LabelNamespaceSuffixKubelet: "", |
| 28 | + api.LabelNamespaceSuffixNode: "", |
| 29 | + api.LabelNamespaceNodeRestriction: "", |
| 30 | + api.IsHeadlessService: "", |
| 31 | + api.BetaStorageClassAnnotation: "", |
| 32 | + api.MountOptionAnnotation: "", |
| 33 | + api.ResourceDefaultNamespacePrefix: "", |
| 34 | + api.ServiceAccountNameKey: "", |
| 35 | + api.ServiceAccountUIDKey: "", |
| 36 | + api.PodPresetOptOutAnnotationKey: "", |
| 37 | + api.MirrorPodAnnotationKey: "", |
| 38 | + api.TolerationsAnnotationKey: "", |
| 39 | + api.TaintsAnnotationKey: "", |
| 40 | + api.SeccompPodAnnotationKey: "", |
| 41 | + api.SeccompContainerAnnotationKeyPrefix: "", |
| 42 | + api.AppArmorBetaContainerAnnotationKeyPrefix: "", |
| 43 | + api.AppArmorBetaDefaultProfileAnnotationKey: "", |
| 44 | + api.AppArmorBetaAllowedProfilesAnnotationKey: "", |
| 45 | + api.PreferAvoidPodsAnnotationKey: "", |
| 46 | + api.NonConvertibleAnnotationPrefix: "", |
| 47 | + api.AnnotationLoadBalancerSourceRangesKey: "", |
| 48 | + api.EndpointsLastChangeTriggerTime: "", |
| 49 | + api.MigratedPluginsAnnotationKey: "", |
| 50 | + api.TaintNodeNotReady: "", |
| 51 | + api.TaintNodeUnreachable: "", |
| 52 | + api.TaintNodeUnschedulable: "", |
| 53 | + api.TaintNodeMemoryPressure: "", |
| 54 | + api.TaintNodeDiskPressure: "", |
| 55 | + api.TaintNodeNetworkUnavailable: "", |
| 56 | + api.TaintNodePIDPressure: "", |
| 57 | + |
| 58 | + // networking |
| 59 | + networking.AnnotationIsDefaultIngressClass: "", |
| 60 | + |
| 61 | + // discovery |
| 62 | + discovery.LabelServiceName: "", |
| 63 | + discovery.LabelManagedBy: "", |
| 64 | + discovery.LabelSkipMirror: "", |
| 65 | + |
| 66 | + // certificates |
| 67 | + cert.KubeAPIServerClientSignerName: "", |
| 68 | + cert.KubeAPIServerClientKubeletSignerName: "", |
| 69 | + cert.KubeletServingSignerName: "", |
| 70 | + cert.LegacyUnknownSignerName: "", |
| 71 | + |
| 72 | + // apps |
| 73 | + apps.StatefulSetPodNameLabel: "", |
| 74 | + |
| 75 | + // RBAC |
| 76 | + rbac.AutoUpdateAnnotationKey: "", |
| 77 | + |
| 78 | + // NOTE the annotations below are baked into the internal |
| 79 | + // controller package so we can't import their consts here |
| 80 | + |
| 81 | + // deployment |
| 82 | + "deployment.kubernetes.io/revision": "", |
| 83 | + "deployment.kubernetes.io/revision-history": "", |
| 84 | + "deployment.kubernetes.io/desired-replicas": "", |
| 85 | + "deployment.kubernetes.io/max-replicas": "", |
| 86 | + |
| 87 | + // persistentvolume |
| 88 | + "pv.kubernetes.io/bind-completed": "", |
| 89 | + "pv.kubernetes.io/bound-by-controller": "", |
| 90 | + "volume.kubernetes.io/selected-node": "", |
| 91 | + "kubernetes.io/no-provisioner": "", |
| 92 | + "pv.kubernetes.io/provisioned-by": "", |
| 93 | + "pv.kubernetes.io/migrated-to": "", |
| 94 | + "volume.beta.kubernetes.io/storage-provisioner": "", |
| 95 | + "volume.kubernetes.io/storage-resizer": "", |
| 96 | + |
| 97 | + // GKE ingress |
| 98 | + "ingress.kubernetes.io/backends": "", |
| 99 | + "ingress.kubernetes.io/https-forwarding-rule": "", |
| 100 | + "ingress.kubernetes.io/https-target-proxy": "", |
| 101 | + "ingress.kubernetes.io/forwarding-rule": "", |
| 102 | + "ingress.kubernetes.io/target-proxy": "", |
| 103 | + "ingress.kubernetes.io/ssl-cert": "", |
| 104 | + "ingress.kubernetes.io/url-map": "", |
| 105 | + |
| 106 | + "deprecated.daemonset.template.generation": "", |
| 107 | +} |
0 commit comments