Skip to content

Commit

Permalink
Add the functionality for additionalTrustBundles (#49)
Browse files Browse the repository at this point in the history
* migrate to prism-go 0.3.2

* add additionalTrustBundle functionality

Co-authored-by: Sid Shukla <[email protected]>
  • Loading branch information
yannickstruyf3 and thunderboltsid authored Nov 18, 2022
1 parent c58ba36 commit a936e76
Show file tree
Hide file tree
Showing 20 changed files with 351 additions and 261 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

**/cover.out
bin/

_artifacts

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

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

include ./openshift/openshift.mk

## --------------------------------------
## Create Image
## --------------------------------------

LOCALBIN ?= ${REPO_ROOT}/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

KO ?= $(LOCALBIN)/ko
KO_VERSION ?= v0.11.2

.PHONY: ko
ko: $(KO)
$(KO): $(LOCALBIN)
test -s $(LOCALBIN)/ko || GOBIN=$(LOCALBIN) go install github.com/google/ko@$(KO_VERSION)

.PHONY: ko-build
ko-build: ko
KO_DOCKER_REPO=ko.local $(KO) build -B --platform=${PLATFORMS} -t ${IMG_TAG} -L .

.PHONY: docker-push
docker-push: ko-build
docker tag ko.local/cloud-provider-nutanix:${IMG_TAG} ${IMG}
docker push ${IMG}

## --------------------------------------
## Deployment YAML manifests
## --------------------------------------

.PHONY: deployment-manifests
deployment-manifests:
mkdir -p $(ARTIFACTS)/manifests
cat manifests/*.yaml | envsubst > $(ARTIFACTS)/manifests/deploy_ccm.yaml

.PHONY: deploy
deploy: deployment-manifests
kubectl apply -f $(ARTIFACTS)/manifests/deploy_ccm.yaml
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

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

## Developer Workflow

### Build the image
```
make ko-build
```

### Build and push the image
```
IMG=<image_name> make docker-push
```

### Deploy CCM

**Note**: Requires a Kubernetes cluster that is configured for an external CCM

Make sure following environment variables are set before running `make deploy`:

- NUTANIX_ENDPOINT: Prism Central IP/FQDN
- NUTANIX_PORT: Prism Central Port (9440)
- NUTANIX_INSECURE: Disable certificate verification (true or false)
- NUTANIX_USERNAME: Username to connect to Prism Central
- NUTANIX_PASSWORD: Password required to connect to Prism Central
- IMG: image name of Nutanix CCM

```
IMG=<image_name> make deploy
```

The applied deployment manifests can be found in `_artifacts/manifests` after running `make deploy`.

## Contributing
See the [contributing docs](CONTRIBUTING.md).

Expand Down
19 changes: 9 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ module github.com/nutanix-cloud-native/cloud-provider-nutanix
go 1.17

require (
github.com/google/uuid v1.1.2
github.com/nutanix-cloud-native/prism-go-client v0.2.1-0.20220728162452-e667703bf00c
github.com/google/uuid v1.3.0
github.com/nutanix-cloud-native/prism-go-client v0.3.2
github.com/onsi/ginkgo/v2 v2.1.4
github.com/onsi/gomega v1.19.0
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/apimachinery v0.24.3
k8s.io/client-go v0.24.2
k8s.io/cloud-provider v0.24.2
k8s.io/component-base v0.24.2
Expand All @@ -32,7 +32,8 @@ require (
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
Expand All @@ -44,15 +45,13 @@ require (
github.com/google/gofuzz v1.1.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand Down Expand Up @@ -80,14 +79,14 @@ require (
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220808155132-1c4a2a72c664 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 // indirect
Expand Down
Loading

0 comments on commit a936e76

Please sign in to comment.