-
Notifications
You must be signed in to change notification settings - Fork 579
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
✨ SSM (AWS Systems Manager Parameter Store) as a Secret Backend #1924
Conversation
Hi @Promaethius. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@randomvariable struggling with the
Had to generalize the |
I'll take a look as to how best to unblock you after doing the v0.6.0 release. Also, apologies if I don't recognise you in Slack, but worth joining the channel in https://kubernetes.slack.com/archives/CD6U2V71N and we can pair, zoom etc... |
/milestone v0.6.1 |
e1458e0
to
94189f8
Compare
@randomvariable took some of your advice in half and broke the MIME generation out into an external package and unit test while leaving UserData generation Service specific. |
/ok-to-test |
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.
some changes, but otherwise looking good I think
with #1858 in the same release, it's important to note that this PR would require it |
/hold |
206e747
to
e346938
Compare
/test pull-cluster-api-provider-aws-e2e |
/test pull-cluster-api-provider-aws-e2e |
@randomvariable changes made, tests passing. Am I missing anything? |
"secretsmanager:GetSecretValue", | ||
}, | ||
func (t Template) secretPolicy(secureSecretsBackend infrav1.SecretBackend) iamv1.StatementEntry { | ||
switch secureSecretsBackend { |
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.
This is very similar to cluster_api_controller.go above. Do you think it would be possible to consolidate into 1 place and add the additional actions for the controller policy?
Not essential though.
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.
This kinda thing pops up a lot in the clusterctl code, I think it can be handled in a separate PR as a mini refactor?
This seems ok to me, small comment about the policies but generally /lgtm |
One last This should do it. ---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: MutatingWebhookConfiguration
metadata:
creationTimestamp: null
name: mutating-webhook-configuration
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awscluster
failurePolicy: Fail
matchPolicy: Equivalent
name: default.awscluster.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsclusters
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachine
failurePolicy: Fail
name: mutation.awsmachine.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmachines
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinepool
failurePolicy: Fail
matchPolicy: Equivalent
name: default.awsmachinepool.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmachinepools
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmanagedmachinepool
failurePolicy: Fail
matchPolicy: Equivalent
name: default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmanagedmachinepools
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
creationTimestamp: null
name: validating-webhook-configuration
webhooks:
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha3-awscluster
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.awscluster.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsclusters
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachine
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.awsmachine.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmachines
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinetemplate
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.awsmachinetemplate.infrastructure.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmachinetemplates
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinepool
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.awsmachinepool.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmachinepools
sideEffects: None
- clientConfig:
caBundle: Cg==
service:
name: webhook-service
namespace: system
path: /validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmanagedmachinepool
failurePolicy: Fail
matchPolicy: Equivalent
name: validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io
rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
apiVersions:
- v1alpha3
operations:
- CREATE
- UPDATE
resources:
- awsmanagedmachinepools
sideEffects: None |
@detiber asks:
In retrospect, yes, maybe we could have done at the controller flag level. I think we should be working towards finding a better solution overall for v1alpha4, given the issues we've run into with cloud-init. The one use case I did however have in mind for having it on the AWSMachineTemplate is for FlatCar Linux which doesn't support multi-part MIME docs, but where Ignition does natively support S3. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: randomvariable The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Adds an additional secret backend for environments which do not have access to AWS Secrets Manager. SSM is available as an EC2 feature in all possible scopes: https://aws.amazon.com/compliance/services-in-scope/
Additionally, the format of SSM API and CLI calls are similar to SecretsManager so this should be a relatively painless addition.
Which issue(s) this PR fixes:
Fixes #1900