Skip to content

service_account: Use go code to generate service account key pairs - #89

Merged
openshift-merge-robot merged 1 commit into
openshift:masterfrom
yifan-gu:svc_account_tls
Aug 3, 2018
Merged

service_account: Use go code to generate service account key pairs#89
openshift-merge-robot merged 1 commit into
openshift:masterfrom
yifan-gu:svc_account_tls

Conversation

@yifan-gu

@yifan-gu yifan-gu commented Jul 31, 2018

Copy link
Copy Markdown
Contributor

Previously, the service account key pairs are generated by terraform in the bootkube module.

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 31, 2018
@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2018
@yifan-gu
yifan-gu force-pushed the svc_account_tls branch 2 times, most recently from 4770ce1 to 4886457 Compare July 31, 2018 22:26
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2018
@yifan-gu yifan-gu removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2018
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2018
@yifan-gu

Copy link
Copy Markdown
Contributor Author

/retest

@wking

wking commented Jul 31, 2018

Copy link
Copy Markdown
Member

Is the move from Terraform to Go just to make it easier for callers to provide their own keys?

@yifan-gu

Copy link
Copy Markdown
Contributor Author

@wking Yeah, it will be easier, so the goal is not to use terraform for any assets generation.

@yifan-gu

Copy link
Copy Markdown
Contributor Author

/retest

@yifan-gu

yifan-gu commented Aug 1, 2018

Copy link
Copy Markdown
Contributor Author

Looks like the cluster can't bootup now, debugging.

@abhinavdahiya

Copy link
Copy Markdown
Contributor
core@adahiya-0-master-0 /opt/tectonic/tls $ cat service-account.pub
-----BEGIN PUBLIC KEY-----
MIIBCgKCAQEA4LlFhUglModjo2ck78s1qEimYLgQOiE88mzUOfw7ajEcTR/zhzhD
Dd6EGOUNHDHyPyedhaIrL4zUkB25hk61mbxEnnzi/44UiLyFJHa4gqWc//BPyhrD
J54CXZWPdpdgOLfdjDb/3Vdv5V2/y6tO9AtPgqVB8DxAArv8vHb7bZrpjx8cOHfV
WNE5Y8Wa+IVVAtfwfgGkApdKXPEp9FUpPC/tERddwZ/fXvI0+Mogy+z40saHAhKZ
HAMWOU/ePe16b0xUKeXHlG9JZ3or++wFPlmATVa3WaYdHL9K6aJL0MWZ32u33lHE
+eRR77TxO+nVI2yHAcXTFWcVgvE2WoRW4QIDAQAB
-----END PUBLIC KEY-----
core@adahiya-0-master-0 /opt/tectonic/tls $ openssl rsa -in service-account.key -pubout
writing RSA key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4LlFhUglModjo2ck78s1
qEimYLgQOiE88mzUOfw7ajEcTR/zhzhDDd6EGOUNHDHyPyedhaIrL4zUkB25hk61
mbxEnnzi/44UiLyFJHa4gqWc//BPyhrDJ54CXZWPdpdgOLfdjDb/3Vdv5V2/y6tO
9AtPgqVB8DxAArv8vHb7bZrpjx8cOHfVWNE5Y8Wa+IVVAtfwfgGkApdKXPEp9FUp
PC/tERddwZ/fXvI0+Mogy+z40saHAhKZHAMWOU/ePe16b0xUKeXHlG9JZ3or++wF
PlmATVa3WaYdHL9K6aJL0MWZ32u33lHE+eRR77TxO+nVI2yHAcXTFWcVgvE2WoRW
4QIDAQAB
-----END PUBLIC KEY-----
core@adahiya-0-master-0 /opt/tectonic/tls $

The generated public key doesn't match the actual public key as shown by openssl.

Previously, the service account key pairs are generated by terraform
in the bootkube module. This PR replace the generation using go code.

Also cleaned up some of the tls and ignition terraform files.
@yifan-gu

yifan-gu commented Aug 2, 2018

Copy link
Copy Markdown
Contributor Author

@abhinavdahiya Looks like I need to use x509.MarshalPKIXPublicKey()

Comment thread tests/run.sh Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are a few other occurrences of eu-west-1:

$ git grep eu-west origin/pr/89
origin/pr/89:examples/tectonic.aws.yaml:    # `{ eu-west-1a = "10.0.0.0/20", eu-west-1b = "10.0.16.0/20" }`
origin/pr/89:examples/tectonic.aws.yaml:  region: eu-west-1
origin/pr/89:examples/tectonic.aws.yaml:    # Example: `{ eu-west-1a = "10.0.64.0/20", eu-west-1b = "10.0.80.0/20" }`
origin/pr/89:installer/pkg/config-generator/fixtures/test-aws.yaml:  region: eu-west-1
origin/pr/89:installer/pkg/config/aws/aws.go:   DefaultRegion = "eu-west-1"
origin/pr/89:installer/pkg/workflow/fixtures/terraform.tfvars:  "tectonic_aws_region": "eu-west-1",
origin/pr/89:steps/variables-aws.tf:`{ eu-west-1a = "10.0.0.0/20", eu-west-1b = "10.0.16.0/20" }`
origin/pr/89:steps/variables-aws.tf:Example: `{ eu-west-1a = "10.0.64.0/20", eu-west-1b = "10.0.80.0/20" }`
origin/pr/89:tests/jenkins-jobs/maintenance/tag_clean_aws_grafiti_job.groovy:    "ap-northeast-1" "eu-central-1" "eu-west-1" "eu-west-2" "sa-east-1" )

You may want to update at least the the installer/ instances as well to stay consistent.

@yifan-gu

yifan-gu commented Aug 2, 2018

Copy link
Copy Markdown
Contributor Author

ok to test

@abhinavdahiya

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2018
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, yifan-gu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot
openshift-merge-robot merged commit 26bdc09 into openshift:master Aug 3, 2018
@yifan-gu
yifan-gu deleted the svc_account_tls branch August 3, 2018 01:33
stbenjam pushed a commit to stbenjam/installer that referenced this pull request Feb 10, 2021
Bug 1866901: Don't do rolling updates of metal3 Deployment
clnperez added a commit to clnperez/installer that referenced this pull request Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants