Important Note
Retrieve the TKGI deployment name
bosh deployments --column=name
Using environment '172.##.##.11' as client 'ops_manager'
Name
pivotal-container-service-c1c2109e8bbeaacede93
service-instance_e284311e-f533-45b1-89cd-a35866a0c1ec
Export TKGI deployment manifest
bosh manifest -d pivotal-container-service-c1c2109e8bbeaacede93 > tkgi.yaml
Setup Bosh and credhub credentials (the script depends on these two .env files)
cat > bosh.env << EOF
export BOSH_CLIENT='ops_manager'
export BOSH_CLIENT_SECRET='######'
export BOSH_CA_CERT=/var/tempest/workspaces/default/root_ca_certificate
export BOSH_ENVIRONMENT=172.##.##.11
EOF
cat > credhub.env << EOF
export CREDHUB_CLIENT=$BOSH_CLIENT
export CREDHUB_SECRET=$BOSH_CLIENT_SECRET
EOF
Download rotate_control_plane_certs script
Download the rotate_control_plane_certs.sh script attached to this KB and make it executable
chmod +x rotate_control_plane_certs.sh
List currently deployed certificates
./rotate_control_plane_certs.sh -a list_certificates -d pivotal-container-service-c1c2109e8bbeaacede93 &> list_certificates
Regenerate CA and leaf certificates
./rotate_control_plane_certs.sh -a regenerate_certificates -d pivotal-container-service-c1c2109e8bbeaacede93 &> regenerate_certificates.out
Deploy TKGI
This step will restart the TKGI API and DB processes and push new certificates to the VMs. TKGI control plane will be unavailable while the command below is running
bosh deploy -d pivotal-container-service-c1c2109e8bbeaacede93 tkgi.yaml
List currently deployed certificates
./rotate_control_plane_certs.sh -a list_certificates -d pivotal-container-service-c1c2109e8bbeaacede93 &> list_certificates_new
NOTE: When performing the deploy step, you may encounter failures on the pivotal-container-service VM for 'bosh-update-config' failing pre-start script if the BOSH NATS CA and Opsman CA certificates were expired before the Control Plane certs could be updated. If this is the case, you will see the deploy task fail with:
"Error: Action Failed get_task: Task <ID> result: 1 of 6 pre-start scripts failed. Failed Jobs: bosh-update-config. Successful Jobs: bpm, bosh-dns, syslog_forwarder, pks-api, uaa."You will also see the following failure from an SSH into the pivotal-container-service VM in the /var/vcap/sys/log/bosh-update-config/pre-start.stderr.log:
Fetching info:
Performing request GET 'https://[REDACTED]:25555/info':
Performing GET request:
Retry: Get "https://[REDACTED]:25555/info": tls: failed to verify certificate: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "Pivotal")
Exit code 1
If you encounter this failure, try the deployment using an Apply Changes from the Operations Manager to get around the certificate verification error.