Skip to content

Commit 1bf78f2

Browse files
committed
Add version information to the controller
1 parent e320d5c commit 1bf78f2

File tree

9 files changed

+40
-14
lines changed

9 files changed

+40
-14
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
### 0.4.0
4+
5+
* [54](https://github.com/nginxinc/kubernetes-ingress/pull/54): Previously, when specifying the port of a service in an Ingress rule, you had to use the value of the target port of that port of the service, which was incorrect. Now you must use the port value or the name of the port of the service instead of the target port value. **Note**: Please make necessary changes to your Ingress resources, if ports of your services have different values of the port and the target port fields.
6+
* [55](https://github.com/nginxinc/kubernetes-ingress/pull/55): Add support for the `kubernetes.io/ingress.class` annotation in Ingress resources.
7+
* [58](https://github.com/nginxinc/kubernetes-ingress/pull/58): Add the version information to the controller. For each version of the NGINX controller, you can find a corresponding image on [DockerHub](https://hub.docker.com/r/nginxdemos/nginx-ingress/tags/) with a tag equal to the version. The latest version is available through the `latest` tag.
8+
9+
The previous version was 0.3
10+
11+
12+
### Notes
13+
14+
* Except when mentioned otherwise, the controller refers both to the NGINX and the NGINX Plus Ingress controllers.

examples/complete-example/nginx-ingress-rc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
app: nginx-ingress
1515
spec:
1616
containers:
17-
- image: nginxdemos/nginx-ingress:0.3
17+
- image: nginxdemos/nginx-ingress:0.4.0
1818
imagePullPolicy: Always
1919
name: nginx-ingress
2020
ports:

examples/complete-example/nginx-plus-ingress-rc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
app: nginx-plus-ingress
1515
spec:
1616
containers:
17-
- image: nginx-plus-ingress:0.3
17+
- image: nginx-plus-ingress:0.4.0
1818
imagePullPolicy: Always
1919
name: nginx-plus-ingress
2020
ports:

examples/daemon-set/nginx-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
# nodeSelector:
1212
# role: nginx-ingress
1313
containers:
14-
- image: nginxdemos/nginx-ingress:0.3
14+
- image: nginxdemos/nginx-ingress:0.4.0
1515
imagePullPolicy: Always
1616
name: nginx-ingress
1717
ports:

examples/daemon-set/nginx-plus-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
# nodeSelector:
1212
# role: nginx-ingress
1313
containers:
14-
- image: nginx-plus-ingress:0.3
14+
- image: nginx-plus-ingress:0.4.0
1515
imagePullPolicy: Always
1616
name: nginx-plus-ingress
1717
ports:

nginx-controller/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
all: push
22

3-
TAG = 0.3
3+
VERSION = 0.4.0
4+
TAG = $(VERSION)
45
PREFIX = nginxdemos/nginx-ingress
56

67
DOCKER_RUN = docker run --rm -v $(shell pwd)/../:/go/src/github.com/nginxinc/kubernetes-ingress -w /go/src/github.com/nginxinc/kubernetes-ingress/nginx-controller/
@@ -15,9 +16,9 @@ endif
1516

1617
nginx-ingress:
1718
ifeq ($(BUILD_IN_CONTAINER),1)
18-
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
19+
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-ingress *.go
1920
else
20-
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
21+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-ingress *.go
2122
endif
2223

2324
test:
@@ -35,9 +36,9 @@ push: container
3536

3637
osx:
3738
ifeq ($(BUILD_IN_CONTAINER),1)
38-
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
39+
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-ingress *.go
3940
else
40-
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags '-w' -o osx-nginx-ingress *.go
41+
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-ingress *.go
4142
endif
4243

4344
clean:

nginx-controller/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
)
1414

1515
var (
16+
// Set during build
17+
version string
18+
1619
proxyURL = flag.String("proxy", "",
1720
`If specified, the controller assumes a kubctl proxy server is running on the
1821
given url and creates a proxy client. Regenerated NGINX configuration files
@@ -31,6 +34,8 @@ var (
3134
func main() {
3235
flag.Parse()
3336

37+
glog.Infof("Starting NGINX Ingress controller Version %v\n", version)
38+
3439
var kubeClient *client.Client
3540
var local = false
3641

nginx-plus-controller/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
all: push
22

3-
TAG = 0.3
3+
VERSION = 0.4.0
4+
TAG = $(VERSION)
45
PREFIX =
56

67
DOCKER_RUN = docker run --rm -v $(shell pwd)/../:/go/src/github.com/nginxinc/kubernetes-ingress -w /go/src/github.com/nginxinc/kubernetes-ingress/nginx-plus-controller/
@@ -15,9 +16,9 @@ endif
1516

1617
nginx-plus-ingress:
1718
ifeq ($(BUILD_IN_CONTAINER),1)
18-
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-plus-ingress *.go
19+
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-plus-ingress *.go
1920
else
20-
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o nginx-plus-ingress *.go
21+
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-plus-ingress *.go
2122
endif
2223

2324
test:
@@ -35,9 +36,9 @@ push: container
3536

3637
osx:
3738
ifeq ($(BUILD_IN_CONTAINER),1)
38-
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-plus-ingress *.go
39+
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-plus-ingress *.go
3940
else
40-
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags '-w' -o osx-nginx-plus-ingress *.go
41+
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-plus-ingress *.go
4142
endif
4243

4344
clean:

nginx-plus-controller/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import (
1313
)
1414

1515
var (
16+
// Set during build
17+
version string
18+
1619
proxyURL = flag.String("proxy", "",
1720
`If specified, the controller assumes a kubctl proxy server is running on the
1821
given url and creates a proxy client. Regenerated NGINX configuration files
@@ -31,6 +34,8 @@ var (
3134
func main() {
3235
flag.Parse()
3336

37+
glog.Infof("Starting NGINX Plus Ingress controller Version %v\n", version)
38+
3439
var kubeClient *client.Client
3540
var local = false
3641

0 commit comments

Comments
 (0)