Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
3ff5f40b
Commit
3ff5f40b
authored
7 years ago
by
Matthew Mosesohn
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix graceful upgrade (#1704)
Fix system namespace creation Only rotate tokens when necessary
parent
689ded04
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/kubernetes-apps/rotate_tokens/tasks/main.yml
+17
-0
17 additions, 0 deletions
roles/kubernetes-apps/rotate_tokens/tasks/main.yml
roles/kubernetes/master/tasks/static-pod-setup.yml
+1
-1
1 addition, 1 deletion
roles/kubernetes/master/tasks/static-pod-setup.yml
with
18 additions
and
1 deletion
roles/kubernetes-apps/rotate_tokens/tasks/main.yml
+
17
−
0
View file @
3ff5f40b
---
-
name
:
Rotate Tokens | Test if default certificate is expired
shell
:
>-
kubectl run -i test-rotate-tokens
--image={{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
--restart=Never --rm
kubectl get nodes
register
:
check_secret
failed_when
:
false
run_once
:
true
-
name
:
Rotate Tokens | Determine if certificate is expired
set_fact
:
needs_rotation
:
'
{{
"You
must
be
logged
in"
in
check_secret.stderr
}}'
# FIXME(mattymo): Exclude built in secrets that were automatically rotated,
# instead of filtering manually
-
name
:
Rotate Tokens | Get all serviceaccount tokens to expire
...
...
@@ -9,12 +23,15 @@
| egrep 'default-token|kube-proxy|kube-dns|dnsmasq|netchecker|weave|calico|canal|flannel|dashboard|cluster-proportional-autoscaler|efk|tiller'
register
:
tokens_to_delete
run_once
:
true
when
:
needs_rotation
-
name
:
Rotate Tokens | Delete expired tokens
command
:
"
{{
bin_dir
}}/kubectl
delete
secrets
-n
{{
item.split('
')[0]
}}
{{
item.split('
')[1]
}}"
with_items
:
"
{{
tokens_to_delete.stdout_lines
}}"
run_once
:
true
when
:
needs_rotation
-
name
:
Rotate Tokens | Delete pods in system namespace
command
:
"
{{
bin_dir
}}/kubectl
delete
pods
-n
{{
system_namespace
}}
--all"
run_once
:
true
when
:
needs_rotation
This diff is collapsed.
Click to expand it.
roles/kubernetes/master/tasks/static-pod-setup.yml
+
1
−
1
View file @
3ff5f40b
...
...
@@ -30,7 +30,7 @@
register
:
create_system_ns
until
:
create_system_ns.rc ==
0
changed_when
:
False
when
:
kubesystem.rc != 0 and
inventory_hostname == groups['kube-master'][0]
when
:
inventory_hostname == groups['kube-master'][0]
and kubesystem.rc !=
0
tags
:
apps
-
name
:
Write kube-scheduler kubeconfig
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment