Skip to content

Commit

Permalink
Merge pull request #5 from dougbtv/certs-updates
Browse files Browse the repository at this point in the history
Recent updates, includes installer methodology
  • Loading branch information
dougbtv authored Jul 11, 2019
2 parents 5e1179e + 267cb18 commit 6837c7f
Show file tree
Hide file tree
Showing 13,123 changed files with 61,361 additions and 5,033,350 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ language: go
# sudo: requried
dist: trusty

go:
- 1.12.x

env:
global:
- GO111MODULE=on
- secure: u6u0kork1/hWYmQe9Jc0FA5sUdsO3wych8Ud4P3v56gTqAQPFkpM+j5Kco38elhOJFSIOqBN0EQBUNYEC13LW6NuKQl1+Ru/xa1/z14MHcCWxANaZxz2vh7GVGZ4GviA+JRm5G6b3BUlp2yYGOjAFm0gRzSkhYFOap1omCAzjr872/pfEUmyTPEpM+mU7C3x40NtpNbnuZOQpJwHEM0zonhvDxNJpBqAzz9aqcXd6wcYOeJB+52zqxwkbUxitTozGu+RwoGgMbGA4wM+507kH7ckaqqPJB+b149Bb4/e0f0NRKeupBzs5fvEcPlJPAOP0YPBAytC6jp6GFjeNV/cWiextOgONv2L52nq7R6a2k/8ESQnKeYRu9RmNNOOS4Xxi+hbr6heRq+DEiUtpMDVPXSlB9IK0oLZNWe9F2ejllfCC3gSIKrRf79c5z/5fGypWy+VwKviFaedusXF9HtHYvBYeEluXjHnnj3SYytRgPa2pcksSb5rF15ZztGMXfbj236FK8hSUqvHVCf6AMKwm9eFLANP46L+Phgv7A0ORSD1bEpcKokF0j7NyAVoT4r0S9QF60zgfM7LeILe+Qm3nMIx6ud2ckfRHaimpe+aTqDOGlwYUwoSnZKSPgWnI52hc5GkOzmbDdwvQ53qw1WwpbCkCBudNcpZCdC9vI27v38=
- secure: pikzmLVgZmabRWbhHs2/df/a5Y98QgecnA94iV8wLAIAZnL4wkFSnuOOAdZhFI/XPUm9jbvzfl6B+Q1nlLMlYhcmrxeVC+Q2PdrTbZGKfRXGbmo1S2It1nKImtYn/9pNrvI84XdbWkZIZgJF+/xJLty0+UYskg6+/yfl/WIhfwQnCapQD98FfLlNG1mlnNbtRjX62xVRRb18uwgiTn5i76lGsDjYLsO9ooHpJfQQnBW0kZMwc+UnYIOpMDBhaDLen0FDEr68Q3l3zitHEKTuHjOPMEkfmX+k1C5BkgqBTDacEzftX+QHx8Zna2pLSaiAj4qeeWyInYwH0ZSb0BWp9hoe9v3Hgrkn52zAawhTPmlb3F+NjCq2IjTR8OlNG5TTUT5KDeVVcY3t+IzSjHS7egCCqGHDKYa5AUpVDlraqXkxk3aTqrY70zJB09zM0OkAH/DuScKbFj4Ady6eTbHKNWDmF7W/HgHQ4ju2RCHvgoTya0c51nH1LkoHHvQ0rn/tngjgo/RHx7BQ2tuP8Z//rhuUPEbrdtfOWypXQb1367hQ2B8qO4L/PfhQ1xc99IOzdlabNFV2krVVtRTgHK9zui+d4WqwPZUsjiH+QzaPxd5W7AFBofan4Jd9HPexMAEYKLjurB1R/oiEbOEwhpxsdBOfVRLQoKjgWpEGmxuPvUU=

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.openshift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM openshift/origin-release:golang-1.10 as builder
# Add everything
ENV PKG_NAME=github.com/K8sNetworkPlumbingWG/net-attach-def-admission-controller
ENV PKG_PATH=/go/src/$PKG_NAME
ENV GO111MODULE=off
RUN mkdir -p $PKG_PATH

COPY . $PKG_PATH/
Expand All @@ -15,11 +16,10 @@ WORKDIR /

FROM openshift/origin-base
COPY --from=builder /go/src/github.com/K8sNetworkPlumbingWG/net-attach-def-admission-controller/bin/webhook /usr/bin/
COPY --from=builder /go/src/github.com/K8sNetworkPlumbingWG/net-attach-def-admission-controller/bin/installer /usr/bin/

LABEL io.k8s.display-name="Container Networking Plugins" \
io.k8s.description="This is a component of OpenShift Container Platform and provides an admission controller for Multus CNI custom resources." \
io.openshift.tags="openshift" \
maintainer="Doug Smith <[email protected]>"

CMD ["webhook"]
CMD ["/usr/bin/webhook"]
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ This admission controller is aware of some of the aspects of what's required whe

## Getting started

Clone this repository and apply these manifests:
Clone this repository and execute `./hack/webhook-deployment.sh` to deploy:

```
kubectl apply -f deployments/rbac.yaml \
-f deployments/install.yaml \
-f deployments/server.yaml
$ ./hack/webhook-deployment.sh
```

## Example of the admission controller in action
Expand Down
47 changes: 27 additions & 20 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
#!/usr/bin/env bash
set -e

ORG_PATH="github.com/K8sNetworkPlumbingWG"
REPO_PATH="${ORG_PATH}/net-attach-def-admission-controller"
DEST_DIR="bin"

if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
if [ ! -d ${DEST_DIR} ]; then
mkdir ${DEST_DIR}
fi

cp -a vendor/* gopath/src/
# this if... will be removed when gomodules goes default
if [ "$GO111MODULE" == "off" ]; then
echo "Building admission controller without go module"
echo "Warning: this will be deprecated in near future so please use go modules!"

export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath
ORG_PATH="github.com/K8sNetworkPlumbingWG"
REPO_PATH="${ORG_PATH}/net-attach-def-admission-controller"

echo "Building admission controller"
# go install ${REPO_PATH}/...
mkdir -p bin
workdir=$(pwd)
cd gopath/src/${REPO_PATH}
# go install ./...
go build -o ./bin/installer ${REPO_PATH}/cmd/installer
go build -o ./bin/webhook ${REPO_PATH}/cmd/webhook
chmod +x ./bin/installer
chmod +x ./bin/webhook
cd $workdir
# go install ./...
if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
fi

#cp -a vendor/* gopath/src/
export GO15VENDOREXPERIMENT=1
export GOBIN=${PWD}/bin
export GOPATH=${PWD}/gopath

# go install ./...
go build -o ./bin/webhook ${REPO_PATH}/cmd/webhook
else
# build with go modules
export GO111MODULE=on

echo "Building admission controller"
go build -o ${DEST_DIR}/webhook -tags no_openssl -ldflags "${LDFLAGS}" "$@" ./cmd/webhook
fi
# go install ./...
9 changes: 4 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.11
FROM golang:1.12

ENV PKG_NAME=github.com/K8sNetworkPlumbingWG/net-attach-def-admission-controller
ENV PKG_PATH=$GOPATH/src/$PKG_NAME
ENV GO111MODULE=off
WORKDIR $PKG_PATH

RUN go get github.com/Masterminds/glide
COPY . $PKG_PATH/
RUN glide install --strip-vendor
RUN go install ./...
RUN ./build.sh

CMD ["webhook"]
CMD ["./bin/webhook"]
30 changes: 0 additions & 30 deletions cmd/installer/main.go

This file was deleted.

49 changes: 49 additions & 0 deletions deployments/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright (c) 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: net-attach-def-admission-controller-server
spec:
replicas: 1
selector:
matchLabels:
app: net-attach-def-admission-controller
template:
metadata:
labels:
app: net-attach-def-admission-controller
spec:
containers:
- name: net-attach-def-admission-controller
image: nfvpe/net-attach-def-admission-controller:snapshot
command:
- webhook
args:
- -bind-address=0.0.0.0
- -port=443
- -tls-private-key-file=/etc/webhook/key.pem
- -tls-cert-file=/etc/webhook/cert.pem
- -alsologtostderr=true
volumeMounts:
- name: webhook-certs
mountPath: /etc/webhook
readOnly: True
imagePullPolicy: Always
#imagePullPolicy: IfNotPresent
volumes:
- name: webhook-certs
secret:
secretName: net-attach-def-admission-controller-secret
35 changes: 0 additions & 35 deletions deployments/install.yaml

This file was deleted.

Loading

0 comments on commit 6837c7f

Please sign in to comment.