Skip to content

Commit

Permalink
Add version information to the controller
Browse files Browse the repository at this point in the history
  • Loading branch information
pleshakov committed Oct 20, 2016
1 parent e320d5c commit 1bf78f2
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

### 0.4.0

* [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.
* [55](https://github.com/nginxinc/kubernetes-ingress/pull/55): Add support for the `kubernetes.io/ingress.class` annotation in Ingress resources.
* [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.

The previous version was 0.3


### Notes

* Except when mentioned otherwise, the controller refers both to the NGINX and the NGINX Plus Ingress controllers.
2 changes: 1 addition & 1 deletion examples/complete-example/nginx-ingress-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
app: nginx-ingress
spec:
containers:
- image: nginxdemos/nginx-ingress:0.3
- image: nginxdemos/nginx-ingress:0.4.0
imagePullPolicy: Always
name: nginx-ingress
ports:
Expand Down
2 changes: 1 addition & 1 deletion examples/complete-example/nginx-plus-ingress-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
app: nginx-plus-ingress
spec:
containers:
- image: nginx-plus-ingress:0.3
- image: nginx-plus-ingress:0.4.0
imagePullPolicy: Always
name: nginx-plus-ingress
ports:
Expand Down
2 changes: 1 addition & 1 deletion examples/daemon-set/nginx-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
# nodeSelector:
# role: nginx-ingress
containers:
- image: nginxdemos/nginx-ingress:0.3
- image: nginxdemos/nginx-ingress:0.4.0
imagePullPolicy: Always
name: nginx-ingress
ports:
Expand Down
2 changes: 1 addition & 1 deletion examples/daemon-set/nginx-plus-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
# nodeSelector:
# role: nginx-ingress
containers:
- image: nginx-plus-ingress:0.3
- image: nginx-plus-ingress:0.4.0
imagePullPolicy: Always
name: nginx-plus-ingress
ports:
Expand Down
11 changes: 6 additions & 5 deletions nginx-controller/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
all: push

TAG = 0.3
VERSION = 0.4.0
TAG = $(VERSION)
PREFIX = nginxdemos/nginx-ingress

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/
Expand All @@ -15,9 +16,9 @@ endif

nginx-ingress:
ifeq ($(BUILD_IN_CONTAINER),1)
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-ingress *.go
else
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o nginx-ingress *.go
endif

test:
Expand All @@ -35,9 +36,9 @@ push: container

osx:
ifeq ($(BUILD_IN_CONTAINER),1)
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-ingress *.go
$(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
else
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags '-w' -o osx-nginx-ingress *.go
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-ingress *.go
endif

clean:
Expand Down
5 changes: 5 additions & 0 deletions nginx-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
)

var (
// Set during build
version string

proxyURL = flag.String("proxy", "",
`If specified, the controller assumes a kubctl proxy server is running on the
given url and creates a proxy client. Regenerated NGINX configuration files
Expand All @@ -31,6 +34,8 @@ var (
func main() {
flag.Parse()

glog.Infof("Starting NGINX Ingress controller Version %v\n", version)

var kubeClient *client.Client
var local = false

Expand Down
11 changes: 6 additions & 5 deletions nginx-plus-controller/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
all: push

TAG = 0.3
VERSION = 0.4.0
TAG = $(VERSION)
PREFIX =

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/
Expand All @@ -15,9 +16,9 @@ endif

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

test:
Expand All @@ -35,9 +36,9 @@ push: container

osx:
ifeq ($(BUILD_IN_CONTAINER),1)
$(DOCKER_RUN) -e CGO_ENABLED=0 -e GOOS=darwin $(GOLANG_CONTAINER) go build -a -installsuffix cgo -ldflags '-w' -o nginx-plus-ingress *.go
$(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
else
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags '-w' -o osx-nginx-plus-ingress *.go
CGO_ENABLED=0 GOOS=darwin go build -a -installsuffix cgo -ldflags "-w -X main.version=${VERSION}" -o osx-nginx-plus-ingress *.go
endif

clean:
Expand Down
5 changes: 5 additions & 0 deletions nginx-plus-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import (
)

var (
// Set during build
version string

proxyURL = flag.String("proxy", "",
`If specified, the controller assumes a kubctl proxy server is running on the
given url and creates a proxy client. Regenerated NGINX configuration files
Expand All @@ -31,6 +34,8 @@ var (
func main() {
flag.Parse()

glog.Infof("Starting NGINX Plus Ingress controller Version %v\n", version)

var kubeClient *client.Client
var local = false

Expand Down

0 comments on commit 1bf78f2

Please sign in to comment.