Repository navigation
add cloud-creds-secret #427
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package tectonic | ||
|
|
||
| import ( | ||
| "text/template" | ||
| ) | ||
|
|
||
| var ( | ||
| // CloudCredsSecret is the constant to represent contents of corresponding yaml file | ||
| CloudCredsSecret = template.Must(template.New("cloud-creds-secret.yaml").Parse(` | ||
| --- | ||
| kind: Secret | ||
| apiVersion: v1 | ||
| metadata: | ||
| namespace: kube-system | ||
| {{- if .CloudCreds.AWS}} | ||
| name: aws-creds | ||
| {{- else if .CloudCreds.OpenStack}} | ||
| name: openstack-creds | ||
| {{- end}} | ||
| data: | ||
| {{- if .CloudCreds.AWS}} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add the type of the cluster (AWS, OpenStack, etc.) so that consumers know what to expect?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and while we're at it (providing AWS coordinates), the registry operator would also like to know what s3 bucket name should be used for the registry (if you don't supply a name we'll create one, but it's likely users may want to create their own bucket).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dmage made it so, yes
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bparees, makes sense, might not be within the scope of this PR, I'll discuss with the installer team. In a follow-up PR, we can add registry s3 bucket name to the secret if/when necessary. |
||
| aws_access_key_id: {{.CloudCreds.AWS.Base64encodeAccessKeyID}} | ||
| aws_secret_access_key: {{.CloudCreds.AWS.Base64encodeSecretAccessKey}} | ||
| {{- else if .CloudCreds.OpenStack}} | ||
| clouds.yaml: {{.CloudCreds.OpenStack.Base64encodeCloudCreds}} | ||
| {{- end}} | ||
| `)) | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package tectonic | ||
|
|
||
| import ( | ||
| "text/template" | ||
| ) | ||
|
|
||
| var ( | ||
| // RoleCloudCredsSecretReader is the variable to represent contents of corresponding file | ||
| RoleCloudCredsSecretReader = template.Must(template.New("role-cloud-creds-secret-reader.yaml").Parse(` | ||
| --- | ||
| kind: Role | ||
| apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
| metadata: | ||
| namespace: kube-system | ||
| {{- if .CloudCreds.AWS}} | ||
| name: aws-creds-secret-reader | ||
| {{- else if .CloudCreds.OpenStack}} | ||
| name: openstack-creds-secret-reader | ||
| {{- end}} | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["secrets"] | ||
| {{- if .CloudCreds.AWS}} | ||
| resourceNames: ["aws-creds"] | ||
| {{- else if .CloudCreds.OpenStack}} | ||
| resourceNames: ["openstack-creds"] | ||
| {{- end}} | ||
| verbs: ["get"] | ||
| `)) | ||
| ) |
Uh oh!
There was an error while loading. Please reload this page.