mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Add an nginx docker image for use on the master.
This commit is contained in:
parent
4adc20e933
commit
9f48a2f4e6
6
cluster/images/nginx/Dockerfile
Normal file
6
cluster/images/nginx/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM google/debian:wheezy
|
||||||
|
|
||||||
|
COPY backports.list /etc/apt/sources.list.d/backports.list
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get -t wheezy-backports -yy -q install nginx
|
14
cluster/images/nginx/Makefile
Normal file
14
cluster/images/nginx/Makefile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
### Nginx image
|
||||||
|
# This image is used to run nginx on the master.
|
||||||
|
|
||||||
|
# Current 'live' version is v1
|
||||||
|
# Please make sure that you update this comment if you build/push new
|
||||||
|
# versions.
|
||||||
|
VERSION=v2
|
||||||
|
|
||||||
|
all:
|
||||||
|
docker build -t gcr.io/google_containers/nginx:${VERSION} .
|
||||||
|
gcloud preview docker push gcr.io/google_containers/nginx:${VERSION}
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
|
7
cluster/images/nginx/README.md
Normal file
7
cluster/images/nginx/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
### Nginx image
|
||||||
|
This image is used to run nginx on the master.
|
||||||
|
|
||||||
|
#### Instructions
|
||||||
|
make
|
||||||
|
|
||||||
|
|
1
cluster/images/nginx/backports.list
Normal file
1
cluster/images/nginx/backports.list
Normal file
@ -0,0 +1 @@
|
|||||||
|
deb http://gce_debian_mirror.storage.googleapis.com wheezy-backports main non-free
|
@ -28,6 +28,30 @@ nginx:
|
|||||||
- group: root
|
- group: root
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
|
||||||
|
{% if grains.cloud in ['gce'] %}
|
||||||
|
/etc/kubernetes/manifests/nginx.json:
|
||||||
|
file:
|
||||||
|
- managed
|
||||||
|
- source: salt://nginx/nginx.json
|
||||||
|
- user: root
|
||||||
|
- group: root
|
||||||
|
- mode: 644
|
||||||
|
- require:
|
||||||
|
- file: /etc/nginx/nginx.conf
|
||||||
|
- file: /etc/nginx/sites-enabled/default
|
||||||
|
- file: /usr/share/nginx/htpasswd
|
||||||
|
- cmd: kubernetes-cert
|
||||||
|
|
||||||
|
|
||||||
|
#stop legacy nginx_service
|
||||||
|
stop_nginx-service:
|
||||||
|
service.dead:
|
||||||
|
- name: nginx
|
||||||
|
- enable: None
|
||||||
|
- watch:
|
||||||
|
- file: /etc/kubernetes/manifests/nginx.json
|
||||||
|
|
||||||
|
{% else %}
|
||||||
nginx-service:
|
nginx-service:
|
||||||
service:
|
service:
|
||||||
- running
|
- running
|
||||||
@ -38,3 +62,5 @@ nginx-service:
|
|||||||
- file: /etc/nginx/sites-enabled/default
|
- file: /etc/nginx/sites-enabled/default
|
||||||
- file: /usr/share/nginx/htpasswd
|
- file: /usr/share/nginx/htpasswd
|
||||||
- cmd: kubernetes-cert
|
- cmd: kubernetes-cert
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
55
cluster/saltbase/salt/nginx/nginx.json
Normal file
55
cluster/saltbase/salt/nginx/nginx.json
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"apiVersion": "v1beta3",
|
||||||
|
"kind": "Pod",
|
||||||
|
"metadata": {"name":"nginx"},
|
||||||
|
"spec":{
|
||||||
|
"hostNetwork": true,
|
||||||
|
"containers":[
|
||||||
|
{
|
||||||
|
"name": "nginx",
|
||||||
|
"image": "gcr.io/google-containers/nginx:v1",
|
||||||
|
"command": [
|
||||||
|
"nginx",
|
||||||
|
"-g",
|
||||||
|
"daemon off;"
|
||||||
|
],
|
||||||
|
"ports":[
|
||||||
|
{ "name": "https",
|
||||||
|
"containerPort": 443,
|
||||||
|
"hostPort": 443}
|
||||||
|
],
|
||||||
|
"volumeMounts": [
|
||||||
|
{ "name": "nginx",
|
||||||
|
"mountPath": "/etc/nginx",
|
||||||
|
"readOnly": true},
|
||||||
|
{ "name": "k8s",
|
||||||
|
"mountPath": "/srv/kubernetes",
|
||||||
|
"readOnly": true},
|
||||||
|
{ "name": "logs",
|
||||||
|
"mountPath": "/var/log/nginx",
|
||||||
|
"readOnly": false},
|
||||||
|
{ "name": "passwd",
|
||||||
|
"mountPath": "/usr/share/nginx",
|
||||||
|
"readOnly": true}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"volumes":[
|
||||||
|
{ "name": "nginx",
|
||||||
|
"hostPath": {
|
||||||
|
"path": "/etc/nginx"}
|
||||||
|
},
|
||||||
|
{ "name": "k8s",
|
||||||
|
"hostPath": {
|
||||||
|
"path": "/srv/kubernetes"}
|
||||||
|
},
|
||||||
|
{ "name": "passwd",
|
||||||
|
"hostPath": {
|
||||||
|
"path": "/usr/share/nginx"}
|
||||||
|
},
|
||||||
|
{ "name": "logs",
|
||||||
|
"hostPath": {
|
||||||
|
"path": "/var/logs/nginx"}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}}
|
Loading…
Reference in New Issue
Block a user