{"action":"closed","number":63,"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63","id":206648491,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NjQ4NDkx","html_url":"https://github.com/ministryofjustice/kubernetes-investigations/pull/63","diff_url":"https://github.com/ministryofjustice/kubernetes-investigations/pull/63.diff","patch_url":"https://github.com/ministryofjustice/kubernetes-investigations/pull/63.patch","issue_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/63","number":63,"state":"closed","locked":false,"title":"SSH Key management","user":{"login":"alkar","id":898156,"node_id":"MDQ6VXNlcjg5ODE1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/898156?v=4","gravatar_id":"","url":"https://api.github.com/users/alkar","html_url":"https://github.com/alkar","followers_url":"https://api.github.com/users/alkar/followers","following_url":"https://api.github.com/users/alkar/following{/other_user}","gists_url":"https://api.github.com/users/alkar/gists{/gist_id}","starred_url":"https://api.github.com/users/alkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alkar/subscriptions","organizations_url":"https://api.github.com/users/alkar/orgs","repos_url":"https://api.github.com/users/alkar/repos","events_url":"https://api.github.com/users/alkar/events{/privacy}","received_events_url":"https://api.github.com/users/alkar/received_events","type":"User","site_admin":false},"body":"Connects to https://github.com/ministryofjustice/cloud-platform/issues/256\r\nConnects to https://github.com/ministryofjustice/cloud-platform-environments/pull/63\r\n\r\nChanges introduced:\r\n- the SSH key for launching instances is now managed by `terraform`\r\n- the bastion host is no longer managed by `kops` but is build with `terraform` and includes a hardened SSH config\r\n- `terraform` tags to match what `kops` and `kubernetes` set on the subnets\r\n- all nodes now have a `systemd` unit `authorized-keys-manager.service` which updates the `admin` user's authorized ssh keys from the output of https://github.com/ministryofjustice/cloud-platform-environments/pull/63\r\n\r\nThese changes only apply to the `cloud-platform-test-raz` cluster where they were also tested. Will update the rest of our clusters in follow up PRs.\r\n\r\n## Updating a cluster with the new changes\r\n\r\n0. Make sure your environment is configured correctly:\r\n    ```\r\n    $ cd kubernetes-investigations/terraform/cloud-platform\r\n    $ terraform workspace select <cluster>\r\n    $ kubectl config use-context <cluster>\r\n    $ export AWS_PROFILE=<integration-account>\r\n    $ export KOPS_STATE_STORE=\"s3://$(terraform output kops_state_store)\"\r\n    ```\r\n\r\n0. Replace the bastion host\r\n  a. remove the bastion definition from the kops cluster spec under `kops/`\r\n  b. `kops replace` [will not do anything about it](https://github.com/kubernetes/kops/issues/4632) so you'll have to manually `kops delete instancegroup bastions`\r\n  c. create the new bastion: `terraform apply`\r\n\r\n0. Try to `ssh admin@bastion.<cluster>.k8s.integration.dsd.io`\r\n\r\n0. For the rest of nodes, update the cluster with the new config and do a rolling update. \r\n    ```\r\n    $ ../../bin/03-cluster_config.py ../../kops/<cluster>.yaml > newconf\r\n    $ kops replace -f newconf\r\n    $ kops update cluster --yes\r\n    $ kops rolling-update cluster --yes\r\n    ```\r\n","created_at":"2018-08-07T10:17:44Z","updated_at":"2018-08-08T11:44:41Z","closed_at":"2018-08-08T11:44:41Z","merged_at":"2018-08-08T11:44:41Z","merge_commit_sha":"09319b289881fced61ddba60163b3fbb879944e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/63/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/statuses/0b8bedc1725c13ec67c515fdfd8d83867b2e16e8","head":{"label":"ministryofjustice:bastion","ref":"bastion","sha":"0b8bedc1725c13ec67c515fdfd8d83867b2e16e8","user":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":122635841,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MzU4NDE=","name":"kubernetes-investigations","full_name":"ministryofjustice/kubernetes-investigations","owner":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/kubernetes-investigations","description":"A space to collect code related to the cloud platform team's kubernetes investigations","fork":false,"url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations","forks_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/forks","keys_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/events","assignees_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/merges","archive_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/deployments","created_at":"2018-02-23T15:05:41Z","updated_at":"2018-08-01T14:04:30Z","pushed_at":"2018-08-08T11:44:41Z","git_url":"git://github.com/ministryofjustice/kubernetes-investigations.git","ssh_url":"git@github.com:ministryofjustice/kubernetes-investigations.git","clone_url":"https://github.com/ministryofjustice/kubernetes-investigations.git","svn_url":"https://github.com/ministryofjustice/kubernetes-investigations","homepage":"","size":1108,"stargazers_count":1,"watchers_count":1,"language":"HCL","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"74af660d1900fe69274eb7b08ca0891da25e5f12","user":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":122635841,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI2MzU4NDE=","name":"kubernetes-investigations","full_name":"ministryofjustice/kubernetes-investigations","owner":{"login":"ministryofjustice","id":2203574,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyMDM1NzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/2203574?v=4","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/kubernetes-investigations","description":"A space to collect code related to the cloud platform team's kubernetes investigations","fork":false,"url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations","forks_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/forks","keys_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/events","assignees_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/merges","archive_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/deployments","created_at":"2018-02-23T15:05:41Z","updated_at":"2018-08-01T14:04:30Z","pushed_at":"2018-08-08T11:44:41Z","git_url":"git://github.com/ministryofjustice/kubernetes-investigations.git","ssh_url":"git@github.com:ministryofjustice/kubernetes-investigations.git","clone_url":"https://github.com/ministryofjustice/kubernetes-investigations.git","svn_url":"https://github.com/ministryofjustice/kubernetes-investigations","homepage":"","size":1108,"stargazers_count":1,"watchers_count":1,"language":"HCL","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63"},"html":{"href":"https://github.com/ministryofjustice/kubernetes-investigations/pull/63"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/63"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/kubernetes-investigations/statuses/0b8bedc1725c13ec67c515fdfd8d83867b2e16e8"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"alkar","id":898156,"node_id":"MDQ6VXNlcjg5ODE1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/898156?v=4","gravatar_id":"","url":"https://api.github.com/users/alkar","html_url":"https://github.com/alkar","followers_url":"https://api.github.com/users/alkar/followers","following_url":"https://api.github.com/users/alkar/following{/other_user}","gists_url":"https://api.github.com/users/alkar/gists{/gist_id}","starred_url":"https://api.github.com/users/alkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alkar/subscriptions","organizations_url":"https://api.github.com/users/alkar/orgs","repos_url":"https://api.github.com/users/alkar/repos","events_url":"https://api.github.com/users/alkar/events{/privacy}","received_events_url":"https://api.github.com/users/alkar/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":8,"additions":310,"deletions":45,"changed_files":11}}
{"actor":{"display_login":"alkar"}}