Skip to content

Commit 2eb3b6a

Browse files
Google APIscopybara-github
authored andcommitted
feat: add a new field PENDING under DeploymentState enum
feat: add a new field `cluster` under `MembershipSpec` to support Config Sync cluster name selector feat: add a new field `management` under `MembershipSpec` to support auto upgrade feat: add a new field `enabled` under `ConfigSync` to support Config Sync installation feat: add a new field `gcp_service_account_email` under `ConfigSync` to exporting metrics feat: add a new field `prevent_drift` under `ConfigSync` to support Config Sync admission webhook drift prevention feat: add a new field `oci` to support OCI repo configuration docs: update comment for field `secret_type` docs: update comment for field `gcp_service_account_email` docs: update comment for field `cluster_name` docs: update comment for field `sync_state` docs: update comment for field `secret_type` PiperOrigin-RevId: 642785216
1 parent 40a290b commit 2eb3b6a

1 file changed

Lines changed: 147 additions & 16 deletions

File tree

google/cloud/gkehub/v1/configmanagement/configmanagement.proto

Lines changed: 147 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ enum DeploymentState {
3939

4040
// Deployment was attempted to be installed, but has errors
4141
ERROR = 3;
42+
43+
// Deployment is installing or terminating
44+
PENDING = 4;
4245
}
4346

4447
// **Anthos Config Management**: State for a single cluster.
4548
message MembershipState {
46-
// The user-defined name for the cluster used by ClusterSelectors to group
47-
// clusters together. This should match Membership's membership_name,
48-
// unless the user installed ACM on the cluster manually prior to enabling
49-
// the ACM hub feature.
50-
// Unique within a Anthos Config Management installation.
49+
// This field is set to the `cluster_name` field of the Membership Spec if it
50+
// is not empty. Otherwise, it is set to the cluster's fleet membership name.
5151
string cluster_name = 1;
5252

5353
// Membership configuration in the cluster. This represents the actual state
@@ -71,6 +71,18 @@ message MembershipState {
7171
// **Anthos Config Management**: Configuration for a single cluster.
7272
// Intended to parallel the ConfigManagement CR.
7373
message MembershipSpec {
74+
// Whether to automatically manage the Feature.
75+
enum Management {
76+
// Unspecified
77+
MANAGEMENT_UNSPECIFIED = 0;
78+
79+
// Google will manage the Feature for the cluster.
80+
MANAGEMENT_AUTOMATIC = 1;
81+
82+
// User will manually manage the Feature for the cluster.
83+
MANAGEMENT_MANUAL = 2;
84+
}
85+
7486
// Config Sync configuration for the cluster.
7587
ConfigSync config_sync = 1;
7688

@@ -82,6 +94,18 @@ message MembershipSpec {
8294

8395
// Version of ACM installed.
8496
string version = 10;
97+
98+
// The user-specified cluster name used by Config Sync cluster-name-selector
99+
// annotation or ClusterSelector, for applying configs to only a subset
100+
// of clusters.
101+
// Omit this field if the cluster's fleet membership name is used by Config
102+
// Sync cluster-name-selector annotation or ClusterSelector.
103+
// Set this field if a name different from the cluster's fleet membership name
104+
// is used by Config Sync cluster-name-selector annotation or ClusterSelector.
105+
string cluster = 11;
106+
107+
// Enables automatic Feature management.
108+
Management management = 12;
85109
}
86110

87111
// Configuration for Config Sync
@@ -90,8 +114,33 @@ message ConfigSync {
90114
GitConfig git = 7;
91115

92116
// Specifies whether the Config Sync Repo is
93-
// in hierarchical or unstructured mode.
117+
// in "hierarchical" or "unstructured" mode.
94118
string source_format = 8;
119+
120+
// Enables the installation of ConfigSync.
121+
// If set to true, ConfigSync resources will be created and the other
122+
// ConfigSync fields will be applied if exist.
123+
// If set to false, all other ConfigSync fields will be ignored, ConfigSync
124+
// resources will be deleted.
125+
// If omitted, ConfigSync resources will be managed depends on the presence
126+
// of the git or oci field.
127+
optional bool enabled = 10;
128+
129+
// Set to true to enable the Config Sync admission webhook to prevent drifts.
130+
// If set to `false`, disables the Config Sync admission webhook and does not
131+
// prevent drifts.
132+
bool prevent_drift = 11;
133+
134+
// OCI repo configuration for the cluster
135+
OciConfig oci = 12;
136+
137+
// The Email of the Google Cloud Service Account (GSA) used for exporting
138+
// Config Sync metrics to Cloud Monitoring when Workload Identity is enabled.
139+
// The GSA should have the Monitoring Metric Writer
140+
// (roles/monitoring.metricWriter) IAM role.
141+
// The Kubernetes ServiceAccount `default` in the namespace
142+
// `config-management-monitoring` should be bound to the GSA.
143+
string metrics_gcp_service_account_email = 15;
95144
}
96145

97146
// Git repo configuration for a single cluster.
@@ -112,17 +161,40 @@ message GitConfig {
112161
// Git revision (tag or hash) to check out. Default HEAD.
113162
string sync_rev = 5;
114163

115-
// Type of secret configured for access to the Git repo.
164+
// Type of secret configured for access to the Git repo. Must be one of ssh,
165+
// cookiefile, gcenode, token, gcpserviceaccount or none. The
166+
// validation of this is case-sensitive. Required.
116167
string secret_type = 6;
117168

118169
// URL for the HTTPS proxy to be used when communicating with the Git repo.
119170
string https_proxy = 7;
120171

121-
// The GCP Service Account Email used for auth when secret_type is
172+
// The Google Cloud Service Account Email used for auth when secret_type is
122173
// gcpServiceAccount.
123174
string gcp_service_account_email = 8;
124175
}
125176

177+
// OCI repo configuration for a single cluster
178+
message OciConfig {
179+
// The OCI image repository URL for the package to sync from.
180+
// e.g. `LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY_NAME/PACKAGE_NAME`.
181+
string sync_repo = 1;
182+
183+
// The absolute path of the directory that contains
184+
// the local resources. Default: the root directory of the image.
185+
string policy_dir = 2;
186+
187+
// Period in seconds between consecutive syncs. Default: 15.
188+
int64 sync_wait_secs = 3;
189+
190+
// Type of secret configured for access to the Git repo.
191+
string secret_type = 4;
192+
193+
// The Google Cloud Service Account Email used for auth when secret_type is
194+
// gcpServiceAccount.
195+
string gcp_service_account_email = 5;
196+
}
197+
126198
// Configuration for Policy Controller
127199
message PolicyController {
128200
// Enables the installation of Policy Controller.
@@ -208,6 +280,41 @@ message InstallError {
208280

209281
// State information for ConfigSync
210282
message ConfigSyncState {
283+
// CRDState representing the state of a CRD
284+
enum CRDState {
285+
// CRD's state cannot be determined
286+
CRD_STATE_UNSPECIFIED = 0;
287+
288+
// CRD is not installed
289+
NOT_INSTALLED = 1;
290+
291+
// CRD is installed
292+
INSTALLED = 2;
293+
294+
// CRD is terminating (i.e., it has been deleted and is cleaning up)
295+
TERMINATING = 3;
296+
297+
// CRD is installing
298+
INSTALLING = 4;
299+
}
300+
301+
enum State {
302+
// CS's state cannot be determined.
303+
STATE_UNSPECIFIED = 0;
304+
305+
// CS is not installed.
306+
CONFIG_SYNC_NOT_INSTALLED = 1;
307+
308+
// The expected CS version is installed successfully.
309+
CONFIG_SYNC_INSTALLED = 2;
310+
311+
// CS encounters errors.
312+
CONFIG_SYNC_ERROR = 3;
313+
314+
// CS is installing or terminating.
315+
CONFIG_SYNC_PENDING = 4;
316+
}
317+
211318
// The version of ConfigSync deployed
212319
ConfigSyncVersion version = 1;
213320

@@ -217,6 +324,25 @@ message ConfigSyncState {
217324

218325
// The state of ConfigSync's process to sync configs to a cluster
219326
SyncState sync_state = 3;
327+
328+
// Errors pertaining to the installation of Config Sync.
329+
repeated ConfigSyncError errors = 4;
330+
331+
// The state of the RootSync CRD
332+
CRDState rootsync_crd = 5;
333+
334+
// The state of the Reposync CRD
335+
CRDState reposync_crd = 6;
336+
337+
// The state of CS
338+
// This field summarizes the other fields in this message.
339+
State state = 7;
340+
}
341+
342+
// Errors pertaining to the installation of Config Sync
343+
message ConfigSyncError {
344+
// A string representing the user facing error message
345+
string error_message = 1;
220346
}
221347

222348
// Specific versioning information pertaining to ConfigSync's Pods
@@ -238,6 +364,9 @@ message ConfigSyncVersion {
238364

239365
// Version of the deployed reconciler container in root-reconciler pod
240366
string root_reconciler = 6;
367+
368+
// Version of the deployed admission_webhook pod
369+
string admission_webhook = 7;
241370
}
242371

243372
// The state of ConfigSync's deployment on a cluster
@@ -259,29 +388,31 @@ message ConfigSyncDeploymentState {
259388

260389
// Deployment state of root-reconciler
261390
DeploymentState root_reconciler = 6;
391+
392+
// Deployment state of admission-webhook
393+
DeploymentState admission_webhook = 7;
262394
}
263395

264396
// State indicating an ACM's progress syncing configurations to a cluster
265397
message SyncState {
266-
// An enum representing an ACM's status syncing configs to a cluster
398+
// An enum representing Config Sync's status of syncing configs to a cluster.
267399
enum SyncCode {
268-
// ACM cannot determine a sync code
400+
// Config Sync cannot determine a sync code
269401
SYNC_CODE_UNSPECIFIED = 0;
270402

271-
// ACM successfully synced the git Repo with the cluster
403+
// Config Sync successfully synced the git Repo with the cluster
272404
SYNCED = 1;
273405

274-
// ACM is in the progress of syncing a new change
406+
// Config Sync is in the progress of syncing a new change
275407
PENDING = 2;
276408

277-
// Indicates an error configuring ACM, and user action is required
409+
// Indicates an error configuring Config Sync, and user action is required
278410
ERROR = 3;
279411

280-
// ACM has been installed (operator manifest deployed),
281-
// but not configured.
412+
// Config Sync has been installed but not configured
282413
NOT_CONFIGURED = 4;
283414

284-
// ACM has not been installed (no operator pod found)
415+
// Config Sync has not been installed
285416
NOT_INSTALLED = 5;
286417

287418
// Error authorizing with the cluster

0 commit comments

Comments
 (0)