Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a cluster UUID persisted to a ConfigMap #1805

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert some changes
The ConfigMap is antrea=cluster-identity. At the moment it only stores
a UUID value. The UUID is meant to be generated by the Antrea
Controller, and there is no longer a way for a user to provide it
through config. In theory, a user can populate the ConfigMap directly
before starting the Controller, and Antrea will use that value (it will
not be overridden). There is no longer a cluster name.

Also added an end-to-end test.
  • Loading branch information
antoninbas committed Mar 2, 2021
commit fca1da9a9dc0d44cf0740056bd06bdfdb2e4101c
29 changes: 7 additions & 22 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,12 @@ kind: ClusterRole
metadata:
labels:
app: antrea
name: antrea-cluster-id-reader
name: antrea-cluster-identity-reader
rules:
- apiGroups:
- ""
resourceNames:
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1175,7 +1175,7 @@ rules:
- ""
resourceNames:
- antrea-ca
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1319,7 +1319,7 @@ kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-cluster-id
name: antrea-cluster-identity
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1519,27 +1519,12 @@ data:

# TLS min version from: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
#tlsMinVersion:

# A name used to identify the cluster. The name will be written to the antrea-cluster-id ConfigMap.
# If no name is provided in this configuration, the Antrea Controller will auto-generate one. The
# auto-generated name will be persistent across Antrea Controller restarts and upgrades. It is
# recommended not to update this parameter during the lifetime of the cluster.
#clusterName: ""

# UUID used to identify the cluster. It should be globally unique. The UUID will be written to the
# antrea-cluster-id ConfigMap. If no UUID is provided in this configuration, the Antrea Controller
# will auto-generate a random one (version 4 UUID, as per RFC 4122). The auto-generated UUID will be
# persistent across Antrea Controller restarts and upgrades. Most users should not provide their own
# UUID and this parameter should not be updated during the lifetime of the cluster. If the parameter
# is updated during the lifetime of the cluster, the Antrea Controller will log an error until the
# "uuid" key of the antrea-cluster-id ConfigMap is manually deleted.
#clusterUUID: ""
kind: ConfigMap
metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1659,7 +1644,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -1923,7 +1908,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
29 changes: 7 additions & 22 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,12 @@ kind: ClusterRole
metadata:
labels:
app: antrea
name: antrea-cluster-id-reader
name: antrea-cluster-identity-reader
rules:
- apiGroups:
- ""
resourceNames:
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1175,7 +1175,7 @@ rules:
- ""
resourceNames:
- antrea-ca
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1319,7 +1319,7 @@ kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-cluster-id
name: antrea-cluster-identity
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1519,27 +1519,12 @@ data:

# TLS min version from: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
#tlsMinVersion:

# A name used to identify the cluster. The name will be written to the antrea-cluster-id ConfigMap.
# If no name is provided in this configuration, the Antrea Controller will auto-generate one. The
# auto-generated name will be persistent across Antrea Controller restarts and upgrades. It is
# recommended not to update this parameter during the lifetime of the cluster.
#clusterName: ""

# UUID used to identify the cluster. It should be globally unique. The UUID will be written to the
# antrea-cluster-id ConfigMap. If no UUID is provided in this configuration, the Antrea Controller
# will auto-generate a random one (version 4 UUID, as per RFC 4122). The auto-generated UUID will be
# persistent across Antrea Controller restarts and upgrades. Most users should not provide their own
# UUID and this parameter should not be updated during the lifetime of the cluster. If the parameter
# is updated during the lifetime of the cluster, the Antrea Controller will log an error until the
# "uuid" key of the antrea-cluster-id ConfigMap is manually deleted.
#clusterUUID: ""
kind: ConfigMap
metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1659,7 +1644,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -1925,7 +1910,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-btkfhfc9kk
name: antrea-config-m6cb2mk6f8
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
29 changes: 7 additions & 22 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,12 @@ kind: ClusterRole
metadata:
labels:
app: antrea
name: antrea-cluster-id-reader
name: antrea-cluster-identity-reader
rules:
- apiGroups:
- ""
resourceNames:
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1175,7 +1175,7 @@ rules:
- ""
resourceNames:
- antrea-ca
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1319,7 +1319,7 @@ kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-cluster-id
name: antrea-cluster-identity
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1519,27 +1519,12 @@ data:

# TLS min version from: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
#tlsMinVersion:

# A name used to identify the cluster. The name will be written to the antrea-cluster-id ConfigMap.
# If no name is provided in this configuration, the Antrea Controller will auto-generate one. The
# auto-generated name will be persistent across Antrea Controller restarts and upgrades. It is
# recommended not to update this parameter during the lifetime of the cluster.
#clusterName: ""

# UUID used to identify the cluster. It should be globally unique. The UUID will be written to the
# antrea-cluster-id ConfigMap. If no UUID is provided in this configuration, the Antrea Controller
# will auto-generate a random one (version 4 UUID, as per RFC 4122). The auto-generated UUID will be
# persistent across Antrea Controller restarts and upgrades. Most users should not provide their own
# UUID and this parameter should not be updated during the lifetime of the cluster. If the parameter
# is updated during the lifetime of the cluster, the Antrea Controller will log an error until the
# "uuid" key of the antrea-cluster-id ConfigMap is manually deleted.
#clusterUUID: ""
kind: ConfigMap
metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-28hh2t495c
name: antrea-config-mk65mt7755
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1659,7 +1644,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-28hh2t495c
name: antrea-config-mk65mt7755
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -1926,7 +1911,7 @@ spec:
path: /home/kubernetes/bin
name: host-cni-bin
- configMap:
name: antrea-config-28hh2t495c
name: antrea-config-mk65mt7755
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
29 changes: 7 additions & 22 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1096,12 +1096,12 @@ kind: ClusterRole
metadata:
labels:
app: antrea
name: antrea-cluster-id-reader
name: antrea-cluster-identity-reader
rules:
- apiGroups:
- ""
resourceNames:
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1175,7 +1175,7 @@ rules:
- ""
resourceNames:
- antrea-ca
- antrea-cluster-id
- antrea-cluster-identity
resources:
- configmaps
verbs:
Expand Down Expand Up @@ -1319,7 +1319,7 @@ kind: ConfigMap
metadata:
labels:
app: antrea
name: antrea-cluster-id
name: antrea-cluster-identity
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1524,27 +1524,12 @@ data:

# TLS min version from: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
#tlsMinVersion:

# A name used to identify the cluster. The name will be written to the antrea-cluster-id ConfigMap.
# If no name is provided in this configuration, the Antrea Controller will auto-generate one. The
# auto-generated name will be persistent across Antrea Controller restarts and upgrades. It is
# recommended not to update this parameter during the lifetime of the cluster.
#clusterName: ""

# UUID used to identify the cluster. It should be globally unique. The UUID will be written to the
# antrea-cluster-id ConfigMap. If no UUID is provided in this configuration, the Antrea Controller
# will auto-generate a random one (version 4 UUID, as per RFC 4122). The auto-generated UUID will be
# persistent across Antrea Controller restarts and upgrades. Most users should not provide their own
# UUID and this parameter should not be updated during the lifetime of the cluster. If the parameter
# is updated during the lifetime of the cluster, the Antrea Controller will log an error until the
# "uuid" key of the antrea-cluster-id ConfigMap is manually deleted.
#clusterUUID: ""
kind: ConfigMap
metadata:
annotations: {}
labels:
app: antrea
name: antrea-config-c95t5dft27
name: antrea-config-b789kb895m
namespace: kube-system
---
apiVersion: v1
Expand Down Expand Up @@ -1673,7 +1658,7 @@ spec:
key: node-role.kubernetes.io/master
volumes:
- configMap:
name: antrea-config-c95t5dft27
name: antrea-config-b789kb895m
name: antrea-config
- name: antrea-controller-tls
secret:
Expand Down Expand Up @@ -1972,7 +1957,7 @@ spec:
operator: Exists
volumes:
- configMap:
name: antrea-config-c95t5dft27
name: antrea-config-b789kb895m
name: antrea-config
- hostPath:
path: /etc/cni/net.d
Expand Down
Loading