Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b04a88cc
Commit
b04a88cc
authored
Jan 19, 2018
by
Mike Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding support for changing default backend and nginx container images
parent
630b943e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
+36
-10
config.yaml
cluster/juju/layers/kubernetes-worker/config.yaml
+12
-0
kubernetes_worker.py
...ju/layers/kubernetes-worker/reactive/kubernetes_worker.py
+24
-10
No files found.
cluster/juju/layers/kubernetes-worker/config.yaml
View file @
b04a88cc
...
@@ -58,3 +58,15 @@ options:
...
@@ -58,3 +58,15 @@ options:
The value for this config must be a JSON array of credential objects, like this:
The value for this config must be a JSON array of credential objects, like this:
[{"server": "my.registry", "username": "myUser", "password": "myPass"}]
[{"server": "my.registry", "username": "myUser", "password": "myPass"}]
nginx-image
:
type
:
string
default
:
"
auto"
description
:
|
Docker image to use for the nginx ingress controller. Auto will select an image
based on architecture.
default-backend-image
:
type
:
string
default
:
"
auto"
description
:
|
Docker image to use for the default backend. Auto will select an image
based on architecture.
cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py
View file @
b04a88cc
...
@@ -624,17 +624,28 @@ def create_kubeconfig(kubeconfig, server, ca, key=None, certificate=None,
...
@@ -624,17 +624,28 @@ def create_kubeconfig(kubeconfig, server, ca, key=None, certificate=None,
check_call
(
split
(
cmd
.
format
(
kubeconfig
,
context
)))
check_call
(
split
(
cmd
.
format
(
kubeconfig
,
context
)))
@when_any
(
'config.changed.default-backend-image'
,
'config.changed.nginx-image'
)
def
launch_default_ingress_controller
():
def
launch_default_ingress_controller
():
''' Launch the Kubernetes ingress controller & default backend (404) '''
''' Launch the Kubernetes ingress controller & default backend (404) '''
config
=
hookenv
.
config
()
# need to test this in case we get in here from a config change to the image
if
not
config
.
get
(
'ingress'
):
return
context
=
{}
context
=
{}
context
[
'arch'
]
=
arch
()
context
[
'arch'
]
=
arch
()
addon_path
=
'/root/cdk/addons/{}'
addon_path
=
'/root/cdk/addons/{}'
context
[
'defaultbackend_image'
]
=
\
context
[
'defaultbackend_image'
]
=
config
.
get
(
'default-backend-image'
)
"gcr.io/google_containers/defaultbackend:1.4"
if
context
[
'defaultbackend_image'
]
==
""
or
context
[
'defaultbackend_image'
]
==
"auto"
:
if
arch
()
==
's390x'
:
if
context
[
'arch'
]
==
's390x'
:
context
[
'defaultbackend_image'
]
=
\
context
[
'defaultbackend_image'
]
=
\
"gcr.io/google_containers/defaultbackend-s390x:1.4"
"gcr.io/google_containers/defaultbackend-s390x:1.4"
else
:
context
[
'defaultbackend_image'
]
=
\
"gcr.io/google_containers/defaultbackend:1.4"
# Render the default http backend (404) replicationcontroller manifest
# Render the default http backend (404) replicationcontroller manifest
manifest
=
addon_path
.
format
(
'default-http-backend.yaml'
)
manifest
=
addon_path
.
format
(
'default-http-backend.yaml'
)
...
@@ -650,11 +661,14 @@ def launch_default_ingress_controller():
...
@@ -650,11 +661,14 @@ def launch_default_ingress_controller():
return
return
# Render the ingress daemon set controller manifest
# Render the ingress daemon set controller manifest
context
[
'ingress_image'
]
=
\
context
[
'ingress_image'
]
=
config
.
get
(
'nginx-image'
)
"gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.13"
if
context
[
'ingress_image'
]
==
""
or
context
[
'ingress_image'
]
==
"auto"
:
if
arch
()
==
's390x'
:
if
context
[
'arch'
]
==
's390x'
:
context
[
'ingress_image'
]
=
\
context
[
'ingress_image'
]
=
\
"docker.io/cdkbot/nginx-ingress-controller-s390x:0.9.0-beta.13"
"docker.io/cdkbot/nginx-ingress-controller-s390x:0.9.0-beta.13"
else
:
context
[
'ingress_image'
]
=
\
"gcr.io/google_containers/nginx-ingress-controller:0.9.0-beta.15"
context
[
'juju_application'
]
=
hookenv
.
service_name
()
context
[
'juju_application'
]
=
hookenv
.
service_name
()
manifest
=
addon_path
.
format
(
'ingress-daemon-set.yaml'
)
manifest
=
addon_path
.
format
(
'ingress-daemon-set.yaml'
)
render
(
'ingress-daemon-set.yaml'
,
manifest
,
context
)
render
(
'ingress-daemon-set.yaml'
,
manifest
,
context
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment