You can run new daemonset with gcr.io/google-containers/startup-script containers, to update the public key on all your nodes, this will help you in case you've a new node spun and will replace the public key in all existing nodes.
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: startup-script
labels:
app: startup-script
spec:
template:
metadata:
labels:
app: startup-script
spec:
hostPID: true
containers:
- name: startup-script
image: gcr.io/google-containers/startup-script:v1
imagePullPolicy: Always
securityContext:
privileged: true
env:
- name: STARTUP_SCRIPT
value: |
#! /bin/bash
touch /tmp/foo
#echo "MYPUBLICKEY" > /home/admin/.ssh/authorized_keys
echo done
replace MYPUBLICKEY
with your public key, and the username after home, here admin
will get replace depending on what OS you are using. This will help you access the node via ssh without changing/replacing your existing nodes
You can also add user-data in the ig while performing kops edit ig nodes
and add the small one liner to append your public key.