forked from karmada-io/karmada
-
Notifications
You must be signed in to change notification settings - Fork 0
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
刘硕
committed
Oct 21, 2024
1 parent
d6c4eb4
commit 79bcd83
Showing
54 changed files
with
589 additions
and
99 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 |
---|---|---|
|
@@ -44,20 +44,20 @@ jobs: | |
- name: Build images from Dockerfile | ||
run: | | ||
export VERSION=${{ matrix.karmada-version }} | ||
export REGISTRY="docker.io/karmada" | ||
export REGISTRY="registry.cn-hangzhou.aliyuncs.com/acejilam" | ||
make image-${{ matrix.target }} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}' | ||
image-ref: 'registry.cn-hangzhou.aliyuncs.com/acejilam/${{ matrix.target }}:${{ matrix.karmada-version }}' | ||
format: 'sarif' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
output: '${{ matrix.target }}:${{ matrix.karmada-version }}.trivy-results.sarif' | ||
- name: display scan results | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/karmada/${{ matrix.target }}:${{ matrix.karmada-version }}' | ||
image-ref: 'registry.cn-hangzhou.aliyuncs.com/acejilam/${{ matrix.target }}:${{ matrix.karmada-version }}' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
|
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 |
---|---|---|
|
@@ -39,20 +39,20 @@ jobs: | |
- name: Build an image from Dockerfile | ||
run: | | ||
export VERSION="latest" | ||
export REGISTRY="docker.io/karmada" | ||
export REGISTRY="registry.cn-hangzhou.aliyuncs.com/acejilam" | ||
make image-${{ matrix.target }} | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest' | ||
image-ref: 'registry.cn-hangzhou.aliyuncs.com/acejilam/${{ matrix.target }}:latest' | ||
format: 'sarif' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
output: 'trivy-results.sarif' | ||
- name: display scan results | ||
uses: aquasecurity/[email protected] | ||
with: | ||
image-ref: 'docker.io/karmada/${{ matrix.target }}:latest' | ||
image-ref: 'registry.cn-hangzhou.aliyuncs.com/acejilam/${{ matrix.target }}:latest' | ||
format: 'table' | ||
ignore-unfixed: true | ||
vuln-type: 'os,library' | ||
|
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
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
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
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ networking: | |
serviceSubnet: {{service_cidr}} | ||
nodes: | ||
- role: control-plane | ||
- role: worker |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ networking: | |
serviceSubnet: "10.11.0.0/16" | ||
nodes: | ||
- role: control-plane | ||
- role: worker |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ networking: | |
serviceSubnet: "10.13.0.0/16" | ||
nodes: | ||
- role: control-plane | ||
- role: worker |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ networking: | |
serviceSubnet: "10.15.0.0/16" | ||
nodes: | ||
- role: control-plane | ||
- role: worker |
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,31 @@ | ||
# propagate ServiceExport CRD | ||
apiVersion: policy.karmada.io/v1alpha1 | ||
kind: ClusterPropagationPolicy | ||
metadata: | ||
name: serviceexport-policy | ||
spec: | ||
resourceSelectors: | ||
- apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
name: serviceexports.multicluster.x-k8s.io | ||
placement: | ||
clusterAffinity: | ||
clusterNames: | ||
- member1 | ||
- member2 | ||
--- | ||
# propagate ServiceImport CRD | ||
apiVersion: policy.karmada.io/v1alpha1 | ||
kind: ClusterPropagationPolicy | ||
metadata: | ||
name: serviceimport-policy | ||
spec: | ||
resourceSelectors: | ||
- apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
name: serviceimports.multicluster.x-k8s.io | ||
placement: | ||
clusterAffinity: | ||
clusterNames: | ||
- member1 | ||
- member2 |
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,56 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: serve | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: serve | ||
template: | ||
metadata: | ||
labels: | ||
app: serve | ||
spec: | ||
containers: | ||
- name: serve | ||
image: registry.cn-hangzhou.aliyuncs.com/acejilam/jeremyot_serve:0a40de8 | ||
args: | ||
- "--message='hello from cluster member1 (Node: {{env \"NODE_NAME\"}} Pod: {{env \"POD_NAME\"}} Address: {{addr}})'" | ||
env: | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: serve | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: 8080 | ||
selector: | ||
app: serve | ||
--- | ||
apiVersion: policy.karmada.io/v1alpha1 | ||
kind: PropagationPolicy | ||
metadata: | ||
name: mcs-workload | ||
spec: | ||
resourceSelectors: | ||
- apiVersion: apps/v1 | ||
kind: Deployment | ||
name: serve | ||
- apiVersion: v1 | ||
kind: Service | ||
name: serve | ||
placement: | ||
clusterAffinity: | ||
clusterNames: | ||
- member1 |
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,18 @@ | ||
apiVersion: multicluster.x-k8s.io/v1alpha1 | ||
kind: ServiceExport | ||
metadata: | ||
name: serve | ||
--- | ||
apiVersion: policy.karmada.io/v1alpha1 | ||
kind: PropagationPolicy | ||
metadata: | ||
name: serve-export-policy | ||
spec: | ||
resourceSelectors: | ||
- apiVersion: multicluster.x-k8s.io/v1alpha1 | ||
kind: ServiceExport | ||
name: serve | ||
placement: | ||
clusterAffinity: | ||
clusterNames: | ||
- member1 |
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,24 @@ | ||
--- | ||
apiVersion: multicluster.x-k8s.io/v1alpha1 | ||
kind: ServiceImport | ||
metadata: | ||
name: serve | ||
spec: | ||
type: ClusterSetIP | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
--- | ||
apiVersion: policy.karmada.io/v1alpha1 | ||
kind: PropagationPolicy | ||
metadata: | ||
name: serve-import-policy | ||
spec: | ||
resourceSelectors: | ||
- apiVersion: multicluster.x-k8s.io/v1alpha1 | ||
kind: ServiceImport | ||
name: serve | ||
placement: | ||
clusterAffinity: | ||
clusterNames: | ||
- member2 |
Oops, something went wrong.