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

Add helm chart #273

Open
wants to merge 24 commits into
base: add-helm-chart
Choose a base branch
from

Conversation

bhavanapalle2023
Copy link

No description provided.

README.md Outdated
kubectl apply -f deploy/provider-gcp-plugin.yaml
# if you want to use helm
# helm upgrade --install secrets-store-csi-driver-provider-gcp charts/secrets-store-csi-driver-provider-gcp
$ export PROJECT_ID=<your gcp project>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not merge this change in instructions unless the package is indeed available in the public repo.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, back to original ReadMe

@@ -15,10 +15,30 @@
# Usage: from the root directory run:
#
# $ gcloud builds submit --config scripts/cloudbuild-dev.yaml
timeout: 1200s
timeout: 3600s #increasing timeout else build crashes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: no need for the comment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the comment

@@ -27,6 +47,7 @@ steps:
'--build-arg',
'VERSION=$TAG_NAME',
'-t',
'gcr.io/$PROJECT_ID/secrets-store-csi-driver-provider-gcp:$TAG_NAME',
'asia-east1-docker.pkg.dev/$PROJECT_ID/secrets-store-csi-driver-provider-gcp/provider-image:$TAG_NAME',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As Container Registry is Depreciating, Made helm image repo, helm chart repo and provider image in the Artifact registry

@@ -23,7 +23,7 @@ spec:
serviceAccountName: {{ include "secrets-store-csi-driver-provider-gcp.serviceAccountName" . }}
containers:
- name: provider
image: "{{ .Values.image.repository }}@{{ .Values.image.hash }}"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a hash is considered more secure and we should continue to reference by hash.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -4,3 +4,7 @@ description: A Helm chart to install Google Secret Manager Provider for Secret S
type: application
version: 0.1.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its okay to keep the version same as appVersion

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -6,8 +6,8 @@ serviceAccount:

image:
repository: us-docker.pkg.dev/secretmanager-csi/secrets-store-csi-driver-provider-gcp/plugin
tag: v1.2.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, please continue to use hash references.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

'--build-arg',
'VERSION=$TAG_NAME',
'-t',
'asia-east1-docker.pkg.dev/$PROJECT_ID/secrets-store-csi-driver-provider-gcp/helm-image:$TAG_NAME',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To create helm docker image, As there are no publicaly available helm image. Used Artifact Registry for Repo.

'--push',
'./helm']
- name: 'asia-east1-docker.pkg.dev/$PROJECT_ID/secrets-store-csi-driver-provider-gcp/helm-image:$TAG_NAME'
args: ['dependency', 'update', './charts/secrets-store-csi-driver-provider-gcp']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it might be good to put each arg on a new line.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

scripts/build.sh Outdated
@@ -19,6 +19,11 @@ set -o pipefail # Check the exit code of *all* commands in a pipeline
set -o nounset # Error if accessing an unbound variable
set -x # Print each command as it is run

set +e
# Creating a new repository secrets-store-csi-driver-provider-gcp
gcloud artifacts repositories create secrets-store-csi-driver-provider-gcp --repository-format=docker --location=asia-east1
Copy link
Contributor

@underscoreanuj underscoreanuj Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inconsistent spacing between keywords, is that intended (2 files)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the space consistent between the keywords in both the files

os.Exit(1)
}
// Create the helm registry login command
helmCmd := exec.Command("helm", "registry", "login", "-u", "oauth2accesstoken", "--password-stdin", "https://asia-east1-docker.pkg.dev")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm if the usage of asia-east1 across this commit is just a choice of region & it can be substituted with a different supported region if required?
If yes, can this be made a constant which is referred everywhere?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, we should use gcr.io instead of regional endpoints wherever possible.

Copy link
Contributor

@underscoreanuj underscoreanuj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
left a few comments, PTAL :)

@@ -19,6 +19,11 @@ set -o pipefail # Check the exit code of *all* commands in a pipeline
set -o nounset # Error if accessing an unbound variable
set -x # Print each command as it is run

set +e
# Creating a new repository secrets-store-csi-driver-provider-gcp
gcloud artifacts repositories create secrets-store-csi-driver-provider-gcp --repository-format=docker --location=asia-east1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is location asia-east1?

os.Exit(1)
}
// Create the helm registry login command
helmCmd := exec.Command("helm", "registry", "login", "-u", "oauth2accesstoken", "--password-stdin", "https://asia-east1-docker.pkg.dev")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, we should use gcr.io instead of regional endpoints wherever possible.

@@ -86,7 +86,7 @@ spec:
serviceAccountName: secrets-store-csi-driver-provider-gcp
containers:
- name: provider
image: gcr.io/$PROJECT_ID/secrets-store-csi-driver-provider-gcp:$GCP_PROVIDER_SHA
image: asia-east1-dev.pkg/$PROJECT_ID/secrets-store-csi-driver-provider-gcp/provider-image:$GCP_PROVIDER_SHA
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why has the name of the image changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants