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
3bf4cdc7
Commit
3bf4cdc7
authored
Nov 07, 2016
by
ymqytw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update https-nginx example README and inotifywait cmd
parent
8b5264e0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
28 deletions
+5
-28
README.md
examples/https-nginx/README.md
+4
-27
auto-reload-nginx.sh
examples/https-nginx/auto-reload-nginx.sh
+1
-1
No files found.
examples/https-nginx/README.md
View file @
3bf4cdc7
...
@@ -22,7 +22,7 @@ Create a secret and a configmap.
...
@@ -22,7 +22,7 @@ Create a secret and a configmap.
$
kubectl create
-f
/tmp/secret.json
$
kubectl create
-f
/tmp/secret.json
secret
"nginxsecret"
created
secret
"nginxsecret"
created
$
kubectl create configmap nginxconfigmap
--from-file
=
examples/https-nginx/default.conf
$
kubectl create configmap nginxconfigmap
--from-file
=
examples/https-nginx/default.conf
configmap
"nginxconfigmap"
created
configmap
"nginxconfigmap"
created
```
```
...
@@ -103,34 +103,11 @@ $ curl https://104.198.1.26:30028 -k
...
@@ -103,34 +103,11 @@ $ curl https://104.198.1.26:30028 -k
...
...
```
```
Then we will update the configmap
. First check your kubectl version
.
Then we will update the configmap
by changing
`index.html`
to
`index2.html`
.
```
sh
```
sh
$
kubectl version
kubectl create configmap nginxconfigmap
--from-file
=
examples/https-nginx/default.conf
-o
yaml
--dry-run
\
Client Version: version.Info
{
Major:
"1"
, Minor:
"3"
, GitVersion:
"v1.3.4"
, GitCommit:
"dd6b458ef8dbf24aff55795baa68f83383c9b3a9"
, GitTreeState:
"clean"
, BuildDate:
"2016-08-01T16:45:16Z"
, GoVersion:
"go1.6.2"
, Compiler:
"gc"
, Platform:
"linux/amd64"
}
|
sed
's/index.html/index2.html/g'
| kubectl apply
-f
-
Server Version: version.Info
{
Major:
"1"
, Minor:
"3"
, GitVersion:
"v1.3.5"
, GitCommit:
"b0deb2eb8f4037421077f77cb163dbb4c0a2a9f5"
, GitTreeState:
"clean"
, BuildDate:
"2016-08-11T20:21:58Z"
, GoVersion:
"go1.6.2"
, Compiler:
"gc"
, Platform:
"linux/amd64"
}
```
If you are using 1.5 or higher:
Edit file
`default.conf`
: change
`index index.html;`
in line 8 to
`index index2.html;`
.
```
sh
$
kubectl replace configmap nginxconfigmap
--from-file
=
default.conf
configmap
"nginxconfigmap"
replaced
```
If you are using 1.4 or lower:
Retrieve configmap nginxconfigmap.
```
sh
$
kubectl get configmap nginxconfigmap
-o
yaml
>
examples/https-nginx/nginxcm.yaml
```
Edit file
`nginxcm.yaml`
: change
`index index.html;`
to
`index index2.html;`
.
Apply the change.
```
sh
$
kubectl apply
-f
examples/https-nginx/nginxcm.yaml
configmap
"nginxconfigmap"
configured
configmap
"nginxconfigmap"
configured
```
```
...
...
examples/https-nginx/auto-reload-nginx.sh
View file @
3bf4cdc7
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
nginx
"
$@
"
nginx
"
$@
"
oldcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
oldcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
inotifywait
-mr
--timefmt
'%d/%m/%y %H:%M'
--format
'%T'
\
inotifywait
-
e
modify,move,create,delete
-
mr
--timefmt
'%d/%m/%y %H:%M'
--format
'%T'
\
/etc/nginx/conf.d/ |
while
read date time
;
do
/etc/nginx/conf.d/ |
while
read date time
;
do
newcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
newcksum
=
`
cksum
/etc/nginx/conf.d/default.conf
`
...
...
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