• Kubernetes Submit Queue's avatar
    Merge pull request #35805 from dgoodwin/token-mgmt · 52df372f
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    Implement kubeadm bootstrap token management
    
    Creates bootstrap tokens as secrets per the specification in #30707 
    
    _WARNING_: These are not currently hooked up to the discovery service or the token it creates.
    
    Still TODO:
    - [x] delete tokens
    - [x] merge with #35144 and adopt it's testing approach
    - [x] determine if we want wholesale json output & templating like kubectl (we do not have an API object with the data we want here) may require a bit of plumbing.
    - [x] allow specifying a token duration on the CLI
    - [x] allow configuring the default token duration
    - [x] hook up the initial token created during init
    
    Sample output:
    
    ```
    (root@centos1 ~) $ kubeadm token create
    Running pre-flight checks
    <cmd/token> Token secret created: f6dc69.c43e491752c4a0fd
    (root@centos1 ~) $ kubeadm token create
    Running pre-flight checks
    <cmd/token> Token secret created: 8fad2f.e7b78c8a5f7c7b9a
    (root@centos1 ~) $ kubeadm token list  
    Running pre-flight checks
    ID        TOKEN                     EXPIRATION
    44d805    44d805.a4e78b6cf6435e33   23h
    4f65bb    4f65bb.d006a3c7a0e428c9   23h
    6a086e    6a086e.2ff99f0823236b5b   23h
    8fad2f    8fad2f.e7b78c8a5f7c7b9a   23h
    f6dc69    f6dc69.c43e491752c4a0fd   23h
    f81653    f81653.9ab82a2926c7e985   23h
    ```
    52df372f
Name
Last commit
Last update
..
annotations Loading commit data...
endpoints Loading commit data...
errors Loading commit data...
events Loading commit data...
install Loading commit data...
meta Loading commit data...
pod Loading commit data...
resource Loading commit data...
rest Loading commit data...
service Loading commit data...
testapi Loading commit data...
testing Loading commit data...
unversioned Loading commit data...
util Loading commit data...
v1 Loading commit data...
validation Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
context.go Loading commit data...
context_test.go Loading commit data...
conversion.go Loading commit data...
conversion_test.go Loading commit data...
copy_test.go Loading commit data...
deep_copy_test.go Loading commit data...
defaulting_test.go Loading commit data...
defaults.go Loading commit data...
doc.go Loading commit data...
field_constants.go Loading commit data...
generate.go Loading commit data...
generate_test.go Loading commit data...
helpers.go Loading commit data...
helpers_test.go Loading commit data...
mapper.go Loading commit data...
meta.go Loading commit data...
meta_test.go Loading commit data...
node_example.json Loading commit data...
ref.go Loading commit data...
ref_test.go Loading commit data...
register.go Loading commit data...
replication_controller_example.json Loading commit data...
requestcontext.go Loading commit data...
resource_helpers.go Loading commit data...
resource_helpers_test.go Loading commit data...
serialization_proto_test.go Loading commit data...
serialization_test.go Loading commit data...
types.go Loading commit data...
zz_generated.deepcopy.go Loading commit data...