-
Notifications
You must be signed in to change notification settings - Fork 66
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
base: add-helm-chart
Are you sure you want to change the base?
Add helm chart #273
Conversation
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
scripts/cloudbuild-dev.yaml
Outdated
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
scripts/cloudbuild-dev.yaml
Outdated
'--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'] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
No description provided.