Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
刘硕 committed Oct 21, 2024
1 parent d6c4eb4 commit 79bcd83
Show file tree
Hide file tree
Showing 54 changed files with 589 additions and 99 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-image-scanning-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-image-scanning.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GOARCH ?= $(shell go env GOARCH)
VERSION ?= '$(shell hack/version.sh)'

# Images management
REGISTRY?="docker.io/karmada"
REGISTRY?="registry.cn-hangzhou.aliyuncs.com/acejilam"
REGISTRY_USER_NAME?=""
REGISTRY_PASSWORD?=""
REGISTRY_SERVER_ADDRESS?=""
Expand Down Expand Up @@ -99,8 +99,8 @@ package-chart:

.PHONY: push-chart
push-chart:
helm push _output/charts/karmada-chart-${VERSION}.tgz oci://docker.io/karmada
helm push _output/charts/karmada-operator-chart-${VERSION}.tgz oci://docker.io/karmada
helm push _output/charts/karmada-chart-${VERSION}.tgz oci://registry.cn-hangzhou.aliyuncs.com/acejilam
helm push _output/charts/karmada-operator-chart-${VERSION}.tgz oci://registry.cn-hangzhou.aliyuncs.com/acejilam

GOTESTSUM_REGISTRY:=gotest.tools/gotestsum
GOTESTSUM_VERSION:=ec99a250836f069a524bb9d9b5de0a7a96334ea7 # v1.11.0
Expand Down
4 changes: 2 additions & 2 deletions artifacts/agent/karmada-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: karmada-agent
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-agent
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-agent
image: docker.io/karmada/karmada-agent:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-agent:latest
imagePullPolicy: {{image_pull_policy}}
command:
- /bin/karmada-agent
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-aggregated-apiserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
matchLabels:
app: karmada-aggregated-apiserver
apiserver: "true"
replicas: 2
replicas: 1
template:
metadata:
labels:
Expand All @@ -22,7 +22,7 @@ spec:
automountServiceAccountToken: false
containers:
- name: karmada-aggregated-apiserver
image: docker.io/karmada/karmada-aggregated-apiserver:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-aggregated-apiserver:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: karmada-certs
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-controller-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: karmada-controller-manager
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-controller-manager
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-controller-manager
image: docker.io/karmada/karmada-controller-manager:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-controller-manager:latest
imagePullPolicy: IfNotPresent
command:
- /bin/karmada-controller-manager
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-descheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: karmada-descheduler
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-descheduler
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-descheduler
image: docker.io/karmada/karmada-descheduler:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-descheduler:latest
imagePullPolicy: IfNotPresent
command:
- /bin/karmada-descheduler
Expand Down
2 changes: 1 addition & 1 deletion artifacts/deploy/karmada-metrics-adapter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
automountServiceAccountToken: false
containers:
- name: karmada-metrics-adapter
image: docker.io/karmada/karmada-metrics-adapter:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-metrics-adapter:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: karmada-certs
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-scheduler-estimator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
cluster: {{member_cluster_name}}
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-scheduler-estimator-{{member_cluster_name}}
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-scheduler-estimator
image: docker.io/karmada/karmada-scheduler-estimator:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-scheduler-estimator:latest
imagePullPolicy: IfNotPresent
command:
- /bin/karmada-scheduler-estimator
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-scheduler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: karmada-scheduler
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-scheduler
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-scheduler
image: docker.io/karmada/karmada-scheduler:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-scheduler:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
matchLabels:
app: karmada-search
apiserver: "true"
replicas: 2
replicas: 1
template:
metadata:
labels:
Expand All @@ -22,7 +22,7 @@ spec:
automountServiceAccountToken: false
containers:
- name: karmada-search
image: docker.io/karmada/karmada-search:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-search:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: karmada-certs
Expand Down
4 changes: 2 additions & 2 deletions artifacts/deploy/karmada-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
labels:
app: karmada-webhook
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
app: karmada-webhook
Expand All @@ -21,7 +21,7 @@ spec:
operator: Exists
containers:
- name: karmada-webhook
image: docker.io/karmada/karmada-webhook:latest
image: registry.cn-hangzhou.aliyuncs.com/acejilam/karmada-webhook:latest
imagePullPolicy: IfNotPresent
command:
- /bin/karmada-webhook
Expand Down
1 change: 1 addition & 0 deletions artifacts/kindClusterConfig/general-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ networking:
serviceSubnet: {{service_cidr}}
nodes:
- role: control-plane
- role: worker
10 changes: 10 additions & 0 deletions artifacts/kindClusterConfig/karmada-host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ apiVersion: "kind.x-k8s.io/v1alpha4"
networking:
apiServerAddress: "{{host_ipaddress}}"
nodes:
- role: worker
- role: control-plane
extraPortMappings:
- containerPort: 5443
hostPort: 5443
protocol: TCP
listenAddress: "{{host_ipaddress}}"

kubeadmConfigPatches:
- |
kind: ClusterConfiguration
apiServer:
certSANs:
- {{host_ipaddress}}
- 127.0.0.1
- localhost
1 change: 1 addition & 0 deletions artifacts/kindClusterConfig/member1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ networking:
serviceSubnet: "10.11.0.0/16"
nodes:
- role: control-plane
- role: worker
1 change: 1 addition & 0 deletions artifacts/kindClusterConfig/member2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ networking:
serviceSubnet: "10.13.0.0/16"
nodes:
- role: control-plane
- role: worker
1 change: 1 addition & 0 deletions artifacts/kindClusterConfig/member3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ networking:
serviceSubnet: "10.15.0.0/16"
nodes:
- role: control-plane
- role: worker
31 changes: 31 additions & 0 deletions case/service/1-control-plane.yaml
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
56 changes: 56 additions & 0 deletions case/service/2-member1.yaml
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
18 changes: 18 additions & 0 deletions case/service/3-member1.yaml
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
24 changes: 24 additions & 0 deletions case/service/4-member2.yaml
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
Loading

0 comments on commit 79bcd83

Please sign in to comment.