-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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}} | ||
|
||
| 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.