Skip to content

Commit a936e76

Browse files
Add the functionality for additionalTrustBundles (#49)
* migrate to prism-go 0.3.2 * add additionalTrustBundle functionality Co-authored-by: Sid Shukla <6081171+thunderboltsid@users.noreply.github.com>
1 parent c58ba36 commit a936e76

20 files changed

+351
-261
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
**/cover.out
44
bin/
5+
6+
_artifacts
7+

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Image URL to use all building/pushing image targets
22
IMG ?= nutanix-cloud-controller-manager:latest
33
VERSION = 0.1.0
4+
REPO_ROOT := $(shell git rev-parse --show-toplevel)
5+
ARTIFACTS ?= ${REPO_ROOT}/_artifacts
6+
PLATFORMS ?= linux/amd64
7+
IMG_TAG ?= latest
48

59
build: vendor
610
GO111MODULE=on CGO_ENABLED=0 go build -ldflags="-w -s -X 'main.version=${VERSION}'" -o=bin/nutanix-cloud-controller-manager main.go
@@ -27,3 +31,41 @@ unit-test-html: unit-test
2731
## --------------------------------------
2832

2933
include ./openshift/openshift.mk
34+
35+
## --------------------------------------
36+
## Create Image
37+
## --------------------------------------
38+
39+
LOCALBIN ?= ${REPO_ROOT}/bin
40+
$(LOCALBIN):
41+
mkdir -p $(LOCALBIN)
42+
43+
KO ?= $(LOCALBIN)/ko
44+
KO_VERSION ?= v0.11.2
45+
46+
.PHONY: ko
47+
ko: $(KO)
48+
$(KO): $(LOCALBIN)
49+
test -s $(LOCALBIN)/ko || GOBIN=$(LOCALBIN) go install github.com/google/ko@$(KO_VERSION)
50+
51+
.PHONY: ko-build
52+
ko-build: ko
53+
KO_DOCKER_REPO=ko.local $(KO) build -B --platform=${PLATFORMS} -t ${IMG_TAG} -L .
54+
55+
.PHONY: docker-push
56+
docker-push: ko-build
57+
docker tag ko.local/cloud-provider-nutanix:${IMG_TAG} ${IMG}
58+
docker push ${IMG}
59+
60+
## --------------------------------------
61+
## Deployment YAML manifests
62+
## --------------------------------------
63+
64+
.PHONY: deployment-manifests
65+
deployment-manifests:
66+
mkdir -p $(ARTIFACTS)/manifests
67+
cat manifests/*.yaml | envsubst > $(ARTIFACTS)/manifests/deploy_ccm.yaml
68+
69+
.PHONY: deploy
70+
deploy: deployment-manifests
71+
kubectl apply -f $(ARTIFACTS)/manifests/deploy_ccm.yaml

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22

33
This repository contains the Kubernetes cloud-controller-manager for Nutanix AHV.
44

5+
## Developer Workflow
6+
7+
### Build the image
8+
```
9+
make ko-build
10+
```
11+
12+
### Build and push the image
13+
```
14+
IMG=<image_name> make docker-push
15+
```
16+
17+
### Deploy CCM
18+
19+
**Note**: Requires a Kubernetes cluster that is configured for an external CCM
20+
21+
Make sure following environment variables are set before running `make deploy`:
22+
23+
- NUTANIX_ENDPOINT: Prism Central IP/FQDN
24+
- NUTANIX_PORT: Prism Central Port (9440)
25+
- NUTANIX_INSECURE: Disable certificate verification (true or false)
26+
- NUTANIX_USERNAME: Username to connect to Prism Central
27+
- NUTANIX_PASSWORD: Password required to connect to Prism Central
28+
- IMG: image name of Nutanix CCM
29+
30+
```
31+
IMG=<image_name> make deploy
32+
```
33+
34+
The applied deployment manifests can be found in `_artifacts/manifests` after running `make deploy`.
35+
536
## Contributing
637
See the [contributing docs](CONTRIBUTING.md).
738

go.mod

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ module github.com/nutanix-cloud-native/cloud-provider-nutanix
33
go 1.17
44

55
require (
6-
github.com/google/uuid v1.1.2
7-
github.com/nutanix-cloud-native/prism-go-client v0.2.1-0.20220728162452-e667703bf00c
6+
github.com/google/uuid v1.3.0
7+
github.com/nutanix-cloud-native/prism-go-client v0.3.2
88
github.com/onsi/ginkgo/v2 v2.1.4
99
github.com/onsi/gomega v1.19.0
1010
k8s.io/api v0.24.2
11-
k8s.io/apimachinery v0.24.2
11+
k8s.io/apimachinery v0.24.3
1212
k8s.io/client-go v0.24.2
1313
k8s.io/cloud-provider v0.24.2
1414
k8s.io/component-base v0.24.2
@@ -32,7 +32,8 @@ require (
3232
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
3333
github.com/felixge/httpsnoop v1.0.1 // indirect
3434
github.com/fsnotify/fsnotify v1.4.9 // indirect
35-
github.com/go-logr/logr v1.2.0 // indirect
35+
github.com/go-logr/logr v1.2.3 // indirect
36+
github.com/go-logr/zapr v1.2.3 // indirect
3637
github.com/go-openapi/jsonpointer v0.19.5 // indirect
3738
github.com/go-openapi/jsonreference v0.19.6 // indirect
3839
github.com/go-openapi/swag v0.21.1 // indirect
@@ -44,15 +45,13 @@ require (
4445
github.com/google/gofuzz v1.1.0 // indirect
4546
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
4647
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
47-
github.com/hashicorp/logutils v1.0.0 // indirect
48-
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0 // indirect
48+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
4949
github.com/imdario/mergo v0.3.12 // indirect
5050
github.com/inconshreveable/mousetrap v1.0.0 // indirect
5151
github.com/josharian/intern v1.0.0 // indirect
5252
github.com/json-iterator/go v1.1.12 // indirect
5353
github.com/mailru/easyjson v0.7.7 // indirect
5454
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
55-
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
5655
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
5756
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5857
github.com/modern-go/reflect2 v1.0.2 // indirect
@@ -80,14 +79,14 @@ require (
8079
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
8180
go.uber.org/atomic v1.7.0 // indirect
8281
go.uber.org/multierr v1.6.0 // indirect
83-
go.uber.org/zap v1.19.0 // indirect
82+
go.uber.org/zap v1.21.0 // indirect
8483
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
85-
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
84+
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
8685
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
8786
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
8887
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect
8988
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
90-
golang.org/x/text v0.3.7 // indirect
89+
golang.org/x/text v0.3.8 // indirect
9190
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
9291
google.golang.org/appengine v1.6.7 // indirect
9392
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect

0 commit comments

Comments
 (0)