Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubernetes-master
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cloud
charms
kubernetes-master
Compare revisions
87bffe895146ac1dceb736e9eeb9f6208f2e2aa1 to master
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
cloud/charms/kubernetes-master
Select target project
No results found
master
Select Git revision
Branches
master
Swap
Target
roberto.dilallo/kubernetes-master
Select target project
roberto.dilallo/kubernetes-master
1 result
87bffe895146ac1dceb736e9eeb9f6208f2e2aa1
Select Git revision
Branches
master
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Fixed bug.
· a82d8344
Giuseppe Attardi
authored
7 years ago
a82d8344
Webhook authorization mode.
· 12d55d3e
Giuseppe Attardi
authored
7 years ago
12d55d3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reactive/kubernetes_master.py
+8
-2
8 additions, 2 deletions
reactive/kubernetes_master.py
with
8 additions
and
2 deletions
reactive/kubernetes_master.py
View file @
12d55d3e
...
...
@@ -287,6 +287,9 @@ def configure_cni(cni):
cni
.
set_config
(
is_master
=
True
,
kubeconfig_path
=
''
)
# Webhook configuration file
webhook_config_path
=
'
/root/cdk/webhook.kubeconfig
'
@when
(
'
leadership.is_leader
'
)
@when_not
(
'
authentication.setup
'
)
def
setup_leader_authentication
():
...
...
@@ -328,13 +331,11 @@ def setup_leader_authentication():
leader_set
(
leader_data
)
# configure webhook authentication
webhook_config_path
=
'
/root/cdk/webhook.kubeconfig
'
auth_mode
=
hookenv
.
config
(
'
authorization-mode
'
)
if
'
Webhook
'
in
re
.
split
(
'
[,\s]+
'
,
auth_mode
):
# Render the webhook configuration from the webhook.kubeconfig template
webhook_context
=
{}
# template parameters
render
(
'
webhook.kubeconfig
'
,
webhook_config_path
,
webhook_context
)
api_opts
[
'
authentication-token-webhook-config-file
'
]
=
webhook_config_path
else
:
remove_if_exists
(
webhook_config_path
)
...
...
@@ -1315,6 +1316,11 @@ def configure_apiserver(etcd_connection_string):
else
:
remove_if_exists
(
audit_webhook_config_path
)
# Webhook config
auth_mode
=
hookenv
.
config
(
'
authorization-mode
'
)
if
'
Webhook
'
in
re
.
split
(
'
[,\s]+
'
,
auth_mode
):
api_opts
[
'
authorization-webhook-config-file
'
]
=
webhook_config_path
configure_kubernetes_service
(
'
kube-apiserver
'
,
api_opts
,
'
api-extra-args
'
)
restart_apiserver
()
...
...
This diff is collapsed.
Click to expand it.