Skip to content

Commit 3722f3a

Browse files
Update project
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
1 parent 543b77e commit 3722f3a

10 files changed

+106
-52
lines changed

Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
FROM registry.access.redhat.com/ubi8/go-toolset AS builder
2-
WORKDIR /go/src/github.com/ArangoGutierrez/spack-feature-discovery
1+
FROM golang:1.15 AS builder
2+
WORKDIR /go/src/github.com/ArangoGutierrez/archspec-feature-discovery
33
COPY . .
44

55
# build archspec-feature-discovery
6-
RUN go build -o archspec-feature-discovery cmd/sfd/main.go
6+
RUN go build -o archspec-feature-discovery main.go
77

88
# Create production image for running the side car container
99
FROM registry.access.redhat.com/ubi8/ubi
10-
COPY --from=builder /go/src/github.com/ArangoGutierrez/spack-feature-discovery/archspec-feature-discovery /usr/bin/archspec-feature-discovery
10+
COPY --from=builder /go/src/github.com/ArangoGutierrez/archspec-feature-discovery/archspec-feature-discovery /usr/bin/archspec-feature-discovery
1111

1212
# Install Spack
1313
RUN dnf update -y && dnf install git python38 python3-pip -y

README.md

+51-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,52 @@
1+
[![Go Report Card](https://goreportcard.com/badge/github.com/archspec/archspec-feature-discovery)](https://goreportcard.com/report/github.com/archspec/archspec-feature-discovery)
2+
13
# ArchSpec-feature-discovery
2-
[ArchSpec](https://github.com/archspec/archspec) SideCard DaemonSet to enable target-arch node feature discovery for Kubernetes
4+
5+
[ArchSpec](https://github.com/archspec/archspec) is a sideCard DaemonSet to enable target-arch node feature discovery for Kubernetes
6+
by leveraging [Node-Feature-Discovery](https://github.com/kubernetes-sigs/node-feature-discovery)
7+
8+
## Building the
9+
10+
Clone this repo
11+
12+
```bash
13+
git clone [email protected]:archspec/archspec-feature-discovery.git
14+
```
15+
Then
16+
17+
```bash
18+
buildah bud -t quay.io/<user-name>/archspec-feature-discovery:latest -f Dockerfile .
19+
```
20+
21+
22+
#### Quick-start – the short-short version
23+
24+
[Deploy](https://kubernetes-sigs.github.io/node-feature-discovery/v0.7/get-started/deployment-and-usage.html) the Node-feature-Discovery with the [extra option](https://kubernetes-sigs.github.io/node-feature-discovery/v0.7/advanced/master-commandline-reference.html#extra-label-ns) `--extra-label-ns=archspec.io`, then:
25+
26+
``` bash
27+
$ kubectl apply -f manifests/
28+
namespace/archspec-feature-discovery created
29+
serviceaccount/archspec-feature-discovery created
30+
role.rbac.authorization.k8s.io/archspec-feature-discovery created
31+
rolebinding.rbac.authorization.k8s.io/archspec-feature-discovery created
32+
daemonset.apps/archspec-feature-discovery created
33+
34+
$ kubectl get all -n archspec-feature-discovery
35+
NAME READY STATUS RESTARTS AGE
36+
pod/archspec-feature-discovery-ddhnq 1/1 Running 0 7m21s
37+
pod/archspec-feature-discovery-rr9ts 1/1 Running 0 7m21s
38+
39+
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
40+
daemonset.apps/archspec-feature-discovery 2 2 2 2 2 node-role.kubernetes.io/worker= 7m22
41+
42+
$kubectl get no -o json | jq .items[].metadata.labels |grep archspec
43+
"archspec.io/cpu.family": "6",
44+
"archspec.io/cpu.model": "79",
45+
"archspec.io/cpu.target": "haswell",
46+
"archspec.io/cpu.vendor": "GenuineIntel",
47+
"archspec.io/cpu.family": "6",
48+
"archspec.io/cpu.model": "79",
49+
"archspec.io/cpu.target": "haswell",
50+
"archspec.io/cpu.vendor": "GenuineIntel",
51+
52+
```

go.mod

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module github.com/ArangoGutierrez/spack-feature-discovery
22

3-
go 1.14
3+
go 1.15
44

5-
require github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
6-
7-
require github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
5+
require (
6+
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
7+
github.com/klauspost/cpuid v1.3.1
8+
)

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
22
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
3+
github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s=
4+
github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=

cmd/sfd/main.go main.go

File renamed without changes.

manifests/01_namespace.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: archspec-feature-discovery

manifests/02_service_account.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: archspec-feature-discovery
6+
namespace: archspec-feature-discovery

manifests/03_cluster_role.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: Role
4+
metadata:
5+
name: archspec-feature-discovery
6+
namespace: archspec-feature-discovery
7+
rules:
8+
- apiGroups:
9+
- security.openshift.io
10+
resources:
11+
- securitycontextconstraints
12+
verbs:
13+
- use
14+
resourceNames:
15+
- privileged
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: RoleBinding
4+
metadata:
5+
name: archspec-feature-discovery
6+
namespace: archspec-feature-discovery
7+
roleRef:
8+
apiGroup: rbac.authorization.k8s.io
9+
kind: Role
10+
name: archspec-feature-discovery
11+
namespace: archspec-feature-discovery
12+
subjects:
13+
- kind: ServiceAccount
14+
name: archspec-feature-discovery
15+
namespace: archspec-feature-discovery
16+
userNames:
17+
- system:serviceaccount:archspec-feature-discovery:archspec-feature-discovery

afd.daemonset.yaml manifests/05_damemonset.yaml

+1-43
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,9 @@
1-
apiVersion: v1
2-
kind: Namespace
3-
metadata:
4-
name: openshift-afd
5-
---
6-
apiVersion: v1
7-
kind: ServiceAccount
8-
metadata:
9-
name: archspec-feature-discovery
10-
namespace: openshift-afd
11-
---
12-
apiVersion: rbac.authorization.k8s.io/v1
13-
kind: Role
14-
metadata:
15-
name: archspec-feature-discovery
16-
namespace: openshift-afd
17-
rules:
18-
- apiGroups:
19-
- security.openshift.io
20-
resources:
21-
- securitycontextconstraints
22-
verbs:
23-
- use
24-
resourceNames:
25-
- privileged
26-
---
27-
apiVersion: rbac.authorization.k8s.io/v1
28-
kind: RoleBinding
29-
metadata:
30-
name: archspec-feature-discovery
31-
namespace: openshift-afd
32-
roleRef:
33-
apiGroup: rbac.authorization.k8s.io
34-
kind: Role
35-
name: archspec-feature-discovery
36-
namespace: openshift-afd
37-
subjects:
38-
- kind: ServiceAccount
39-
name: archspec-feature-discovery
40-
namespace: openshift-afd
41-
userNames:
42-
- system:serviceaccount:openshift-afd:archspec-feature-discovery
431
---
442
apiVersion: apps/v1
453
kind: DaemonSet
464
metadata:
475
name: archspec-feature-discovery
48-
namespace: openshift-afd
6+
namespace: archspec-feature-discovery
497
labels:
508
app.kubernetes.io/name: archspec-feature-discovery
519
spec:

0 commit comments

Comments
 (0)