Skip to content

Commit c6f4432

Browse files
Add chart for GCP credential manager (#49)
Signed-off-by: Anisur Rahman <anisur@appscode.com> Signed-off-by: Tamal Saha <tamal@appscode.com> Co-authored-by: Tamal Saha <tamal@appscode.com>
1 parent 330eee3 commit c6f4432

23 files changed

+2909
-6
lines changed

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ openapi: $(addprefix openapi-, $(subst :,_, $(API_GROUPS)))
134134
-w $(DOCKER_REPO_ROOT) \
135135
--env HTTP_PROXY=$(HTTP_PROXY) \
136136
--env HTTPS_PROXY=$(HTTPS_PROXY) \
137-
--env GO111MODULE=on \
138137
--env GOFLAGS="-mod=vendor" \
139138
$(BUILD_IMAGE) \
140139
go run hack/gencrd/main.go
@@ -381,7 +380,6 @@ lint: $(BUILD_DIRS)
381380
-v $$(pwd)/.go/cache:/.cache \
382381
--env HTTP_PROXY=$(HTTP_PROXY) \
383382
--env HTTPS_PROXY=$(HTTPS_PROXY) \
384-
--env GO111MODULE=on \
385383
--env GOFLAGS="-mod=vendor" \
386384
$(BUILD_IMAGE) \
387385
golangci-lint run
@@ -397,8 +395,8 @@ verify: verify-gen verify-modules
397395

398396
.PHONY: verify-modules
399397
verify-modules:
400-
GO111MODULE=on go mod tidy
401-
GO111MODULE=on go mod vendor
398+
go mod tidy
399+
go mod vendor
402400
@if !(git diff --exit-code HEAD); then \
403401
echo "go module files are out of date"; exit 1; \
404402
fi

apis/installer/v1alpha1/aws_credential_manager_types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const (
3636
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
3737

3838
// +kubebuilder:object:root=true
39-
// +kubebuilder:resource:path=aceshifters,singular=aceshifter,categories={kubeops,appscode}
4039
type AwsCredentialManager struct {
4140
metav1.TypeMeta `json:",inline,omitempty"`
4241
metav1.ObjectMeta `json:"metadata,omitempty"`
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
Copyright AppsCode Inc. and Contributors
3+
4+
Licensed under the AppsCode Community License 1.0.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+
https://github.com/appscode/licenses/raw/1.0.0/AppsCode-Community-1.0.0.md
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 v1alpha1
18+
19+
import (
20+
core "k8s.io/api/core/v1"
21+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22+
"kmodules.xyz/resource-metadata/apis/shared"
23+
)
24+
25+
const (
26+
ResourceKindGcpCredentialManager = "GcpCredentialManager"
27+
ResourceGcpCredentialManager = "gcpcredentialmanager"
28+
ResourceGcpCredentialManagers = "gcpcredentialmanagers"
29+
)
30+
31+
// GcpCredentialManager defines the schema for GcpCredentialManager operator installer.
32+
33+
// +genclient
34+
// +genclient:skipVerbs=updateStatus
35+
// +k8s:openapi-gen=true
36+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
37+
38+
// +kubebuilder:object:root=true
39+
type GcpCredentialManager struct {
40+
metav1.TypeMeta `json:",inline,omitempty"`
41+
metav1.ObjectMeta `json:"metadata,omitempty"`
42+
Spec GcpCredentialManagerSpec `json:"spec,omitempty"`
43+
}
44+
45+
// GcpCredentialManagerSpec is the schema for GCP Credential Manager values file.
46+
type GcpCredentialManagerSpec struct {
47+
//+optional
48+
NameOverride string `json:"nameOverride"`
49+
//+optional
50+
FullnameOverride string `json:"fullnameOverride"`
51+
//+optional
52+
RegistryFQDN string `json:"registryFQDN"`
53+
ReplicaCount int32 `json:"replicaCount"`
54+
Image ImageReference `json:"image"`
55+
//+optional
56+
ImagePullSecrets []string `json:"imagePullSecrets"`
57+
//+optional
58+
PodAnnotations map[string]string `json:"podAnnotations"`
59+
//+optional
60+
PodLabels map[string]string `json:"podLabels"`
61+
// PodSecurityContext holds pod-level security attributes and common container settings.
62+
// Optional: Defaults to empty. See type description for default values of each field.
63+
// +optional
64+
PodSecurityContext *core.PodSecurityContext `json:"podSecurityContext"`
65+
//+optional
66+
SecurityContext *core.SecurityContext `json:"securityContext"`
67+
//+optional
68+
Resources core.ResourceRequirements `json:"resources"`
69+
//+optional
70+
NodeSelector map[string]string `json:"nodeSelector"`
71+
// If specified, the pod's tolerations.
72+
// +optional
73+
Tolerations []core.Toleration `json:"tolerations"`
74+
// If specified, the pod's scheduling constraints.
75+
// +optional
76+
Affinity *core.Affinity `json:"affinity"`
77+
// +optional
78+
LivenessProbe *core.Probe `json:"livenessProbe"`
79+
// +optional
80+
ReadinessProbe *core.Probe `json:"readinessProbe"`
81+
Service ServiceSpec `json:"service"`
82+
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
83+
Volumes []core.Volume `json:"volumes"`
84+
VolumeMounts []core.VolumeMount `json:"volumeMounts"`
85+
// +optional
86+
Distro shared.DistroSpec `json:"distro"`
87+
// +optional
88+
Apiserver GcpCredentialManagerApiserver `json:"apiserver"`
89+
// +optional
90+
BucketAccessor GcpBucketAccessor `json:"bucketAccessor"`
91+
}
92+
93+
type GcpCredentialManagerApiserver struct {
94+
GroupPriorityMinimum int `json:"groupPriorityMinimum"`
95+
VersionPriority int `json:"versionPriority"`
96+
EnableMutatingWebhook bool `json:"enableMutatingWebhook"`
97+
EnableValidatingWebhook bool `json:"enableValidatingWebhook"`
98+
Ca string `json:"ca"`
99+
BypassValidatingWebhookXray bool `json:"bypassValidatingWebhookXray"`
100+
UseKubeapiserverFqdnForAks bool `json:"useKubeapiserverFqdnForAks"`
101+
Healthcheck HealthcheckSpec `json:"healthcheck"`
102+
ServingCerts ServingCerts `json:"servingCerts"`
103+
}
104+
105+
type GcpBucketAccessor struct {
106+
GcsMaxIntervalSeconds string `json:"gcsMaxIntervalSeconds"`
107+
GcsMaxWaitSeconds string `json:"gcsMaxWaitSeconds"`
108+
}
109+
110+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
111+
112+
// GcpCredentialManagerList is a list of GcpCredentialManagers.
113+
type GcpCredentialManagerList struct {
114+
metav1.TypeMeta `json:",inline"`
115+
metav1.ListMeta `json:"metadata,omitempty"`
116+
// Items is a list of GcpCredentialManager CRD objects.
117+
Items []GcpCredentialManager `json:"items,omitempty"`
118+
}

apis/installer/v1alpha1/register.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
5656
scheme.AddKnownTypes(SchemeGroupVersion,
5757
&AwsCredentialManager{},
5858
&AwsCredentialManagerList{},
59+
&GcpCredentialManager{},
60+
&GcpCredentialManagerList{},
5961
&CapaVpcPeeringOperator{},
6062
&CapaVpcPeeringOperatorList{},
6163
&CapiOpsManager{},

apis/installer/v1alpha1/types_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
func TestDefaultValues(t *testing.T) {
2929
checker := sc.New(os.DirFS("../../.."),
3030
sc.TestCase{Obj: v1alpha1.AwsCredentialManagerSpec{}},
31+
sc.TestCase{Obj: v1alpha1.GcpCredentialManagerSpec{}},
3132
sc.TestCase{Obj: v1alpha1.CapaVpcPeeringOperatorSpec{}},
3233
sc.TestCase{Obj: v1alpha1.CapiOpsManagerSpec{}},
3334
sc.TestCase{Obj: v1alpha1.DockerMachineOperatorSpec{}},

apis/installer/v1alpha1/zz_generated.deepcopy.go

Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/aws-credential-manager/templates/mutating-webhook.yaml renamed to charts/aws-credential-manager/templates/mutating-webhook.yaml

File renamed without changes.

0 commit comments

Comments
 (0)