Skip to content

jianhuiz/k8s-client-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a incomplete experimentation of creating a C++ binding of Kubernetes go client library.

Environment

Go C++ 14 protobuf

clone the code
git clone https://github.com/jianhuiz/k8s-client-cpp

Note: All blocks below must be executed from the root of the repository.

get the dependencies
cd ./go
go mod vendor
generate c++ protobuf code
protoc -I $PWD/go/vendor --cpp_out $PWD/cpp/ \
    $PWD/go/vendor/k8s.io/api/core/v1/generated.proto \
    $PWD/go/vendor/k8s.io/apimachinery/pkg/api/resource/generated.proto \
    $PWD/go/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto \
    $PWD/go/vendor/k8s.io/apimachinery/pkg/runtime/generated.proto \
    $PWD/go/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto \
    $PWD/go/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.proto
build go library
cd ./go
go build -buildmode=c-archive -o go.a
build c++ sample
cd ./cpp
make

macOS users

Change the LDFLAGS to:

LD_FLAGS = ../go/go.a -lprotobuf -lpthread -framework CoreFoundation -framework Security

About

C++ binding of Kubernetes go client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published