generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
114 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
go-version: 1.16.x | ||
- name: verify | ||
run: hack/verify-all.sh -v | ||
test: | ||
|
@@ -40,6 +40,30 @@ jobs: | |
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14.x | ||
go-version: 1.16.x | ||
- name: make test | ||
run: make test | ||
e2e: | ||
name: e2e | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- name: install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16.x | ||
- name: images | ||
run: make docker-build | ||
- name: setup kind | ||
uses: engineerd/[email protected] | ||
with: | ||
version: v0.11.1 | ||
- name: Load image on the nodes of the cluster | ||
run: | | ||
kind load docker-image --name=kind work-api-controller:latest | ||
- name: Run e2e test | ||
run: | | ||
make test-e2e | ||
env: | ||
KUBECONFIG: /home/runner/.kube/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: work-controller | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
# We deploy a controller that could work with permission lower than cluster-admin, the tradeoff is | ||
# responsivity because list/watch cannot be maintained over too many namespaces. | ||
name: admin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: work-controllert-sa | ||
namespace: open-cluster-management-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: work-controller | ||
labels: | ||
app: work | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: work-controller | ||
template: | ||
metadata: | ||
labels: | ||
app: work-controller | ||
spec: | ||
serviceAccountName: work-controller-sa | ||
containers: | ||
- name: wwork-controller | ||
image: work-api-controller:latest | ||
imagePullPolicy: IfNotPresent | ||
args: | ||
- "/controller" | ||
- "--work-namespace=default" | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
privileged: false | ||
runAsNonRoot: true | ||
volumeMounts: | ||
- name: hub-kubeconfig-secret | ||
mountPath: "/spoke/hub-kubeconfig" | ||
readOnly: true | ||
volumes: | ||
- name: hub-kubeconfig-secret | ||
secret: | ||
secretName: hub-kubeconfig-secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# Adds namespace to all resources. | ||
namespace: work | ||
|
||
resources: | ||
- ./component_namespace.yaml | ||
- ./service_account.yaml | ||
- ./clusterrole_binding.yaml | ||
- ./deployment.yaml | ||
|
||
images: | ||
- name: work-api-controller:latest | ||
newName: work-api-controller | ||
newTag: latest | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: work-controllert-sa |