Skip to content

Commit

Permalink
Merge branch 'karmada-io:master' into karmada-operator-rbac
Browse files Browse the repository at this point in the history
  • Loading branch information
B1F030 authored Oct 13, 2024
2 parents de55128 + 201409c commit 82828f1
Show file tree
Hide file tree
Showing 119 changed files with 16,117 additions and 985 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ci-image-scanning-on-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: image-scanning-on-schedule
on:
schedule:
# Run this workflow "At 00:00 UTC on Sunday"
- cron: '0 0 * * 0'
permissions:
contents: read
jobs:
use-trivy-to-scan-image:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: image-scanning
if: ${{ github.repository == 'karmada-io/karmada' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- karmada-controller-manager
- karmada-scheduler
- karmada-descheduler
- karmada-webhook
- karmada-agent
- karmada-scheduler-estimator
- karmada-interpreter-webhook-example
- karmada-aggregated-apiserver
- karmada-search
- karmada-operator
- karmada-metrics-adapter
karmada-version: [ release-1.11, release-1.10, release-1.9 ]
steps:
- name: checkout code
uses: actions/checkout@v4
with:
ref: ${{ matrix.karmada-version }}
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- id: gen_git_info
run: |
echo "ref=$(git rev-parse --symbolic-full-name HEAD)" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Build images from Dockerfile
run: |
export VERSION=${{ matrix.karmada-version }}
export REGISTRY="docker.io/karmada"
make image-${{ matrix.target }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'docker.io/karmada/${{ 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 }}'
format: 'table'
ignore-unfixed: true
vuln-type: 'os,library'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: '${{ matrix.target }}:${{ matrix.karmada-version }}.trivy-results.sarif'
ref: ${{steps.gen_git_info.outputs.ref}}
sha: ${{steps.gen_git_info.outputs.sha}}
124 changes: 62 additions & 62 deletions .github/workflows/ci-image-scanning.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
name: image-scanning
on:
push:
# Exclude branches created by Dependabot to avoid triggering current workflow
# for PRs initiated by Dependabot.
branches-ignore:
- 'dependabot/**'
permissions:
contents: read
jobs:
use-trivy-to-scan-image:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: image-scanning
if: ${{ github.repository == 'karmada-io/karmada' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- karmada-controller-manager
- karmada-scheduler
- karmada-descheduler
- karmada-webhook
- karmada-agent
- karmada-scheduler-estimator
- karmada-interpreter-webhook-example
- karmada-aggregated-apiserver
- karmada-search
- karmada-operator
- karmada-metrics-adapter
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build an image from Dockerfile
run: |
export VERSION="latest"
export REGISTRY="docker.io/karmada"
make image-${{ matrix.target }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'docker.io/karmada/${{ 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'
format: 'table'
ignore-unfixed: true
vuln-type: 'os,library'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
name: image-scanning
on:
push:
# Exclude branches created by Dependabot to avoid triggering current workflow
# for PRs initiated by Dependabot.
branches-ignore:
- 'dependabot/**'
permissions:
contents: read
jobs:
use-trivy-to-scan-image:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: image-scanning
if: ${{ github.repository == 'karmada-io/karmada' }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target:
- karmada-controller-manager
- karmada-scheduler
- karmada-descheduler
- karmada-webhook
- karmada-agent
- karmada-scheduler-estimator
- karmada-interpreter-webhook-example
- karmada-aggregated-apiserver
- karmada-search
- karmada-operator
- karmada-metrics-adapter
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build an image from Dockerfile
run: |
export VERSION="latest"
export REGISTRY="docker.io/karmada"
make image-${{ matrix.target }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
with:
image-ref: 'docker.io/karmada/${{ 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'
format: 'table'
ignore-unfixed: true
vuln-type: 'os,library'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-latest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
go-version-file: go.mod
- name: Install Cosign
uses: sigstore/cosign-installer@v3.6.0
uses: sigstore/cosign-installer@v3.7.0
with:
cosign-release: 'v2.2.3'
- name: install QEMU
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-released-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
go-version-file: go.mod
- name: Install Cosign
uses: sigstore/cosign-installer@v3.6.0
uses: sigstore/cosign-installer@v3.7.0
with:
cosign-release: 'v2.2.3'
- name: install QEMU
Expand Down
102 changes: 100 additions & 2 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -18691,6 +18691,36 @@
}
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldOverrider": {
"description": "FieldOverrider represents the rules dedicated to modifying a specific field in any Kubernetes resource. This allows changing a single field within the resource with multiple operations. It is designed to handle structured field values such as those found in ConfigMaps or Secrets. The current implementation supports JSON and YAML formats, but can easily be extended to support XML in the future. Note: In any given instance, FieldOverrider processes either JSON or YAML fields, but not both simultaneously.",
"type": "object",
"required": [
"fieldPath"
],
"properties": {
"fieldPath": {
"description": "FieldPath specifies the initial location in the instance document where the operation should take place. The path uses RFC 6901 for navigating into nested structures. For example, the path \"/data/db-config.yaml\" specifies the configuration data key named \"db-config.yaml\" in a ConfigMap: \"/data/db-config.yaml\".",
"type": "string",
"default": ""
},
"json": {
"description": "JSON represents the operations performed on the JSON document specified by the FieldPath.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.JSONPatchOperation"
}
},
"yaml": {
"description": "YAML represents the operations performed on the YAML document specified by the FieldPath.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.YAMLPatchOperation"
}
}
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldSelector": {
"description": "FieldSelector is a field filter.",
"type": "object",
Expand Down Expand Up @@ -18747,6 +18777,30 @@
}
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.JSONPatchOperation": {
"description": "JSONPatchOperation represents a single field modification operation for JSON format.",
"type": "object",
"required": [
"subPath",
"operator"
],
"properties": {
"operator": {
"description": "Operator indicates the operation on target field. Available operators are: \"add\", \"remove\", and \"replace\".",
"type": "string",
"default": ""
},
"subPath": {
"description": "SubPath specifies the relative location within the initial FieldPath where the operation should take place. The path uses RFC 6901 for navigating into nested structures.",
"type": "string",
"default": ""
},
"value": {
"description": "Value is the new value to set for the specified field if the operation is \"add\" or \"replace\". For \"remove\" operation, this field is ignored.",
"$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON"
}
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.LabelAnnotationOverrider": {
"description": "LabelAnnotationOverrider represents the rules dedicated to handling workload labels/annotations",
"type": "object",
Expand Down Expand Up @@ -18871,7 +18925,7 @@
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.Overriders": {
"description": "Overriders offers various alternatives to represent the override rules.\n\nIf more than one alternative exists, they will be applied with following order: - ImageOverrider - CommandOverrider - ArgsOverrider - LabelsOverrider - AnnotationsOverrider - Plaintext",
"description": "Overriders offers various alternatives to represent the override rules.\n\nIf more than one alternative exists, they will be applied with following order: - ImageOverrider - CommandOverrider - ArgsOverrider - LabelsOverrider - AnnotationsOverrider - FieldOverrider - Plaintext",
"type": "object",
"properties": {
"annotationsOverrider": {
Expand All @@ -18898,6 +18952,14 @@
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.CommandArgsOverrider"
}
},
"fieldOverrider": {
"description": "FieldOverrider represents the rules dedicated to modifying a specific field in any Kubernetes resource. This allows changing a single field within the resource with multiple operations. It is designed to handle structured field values such as those found in ConfigMaps or Secrets. The current implementation supports JSON and YAML formats, but can easily be extended to support XML in the future.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.FieldOverrider"
}
},
"imageOverrider": {
"description": "ImageOverrider represents the rules dedicated to handling image overrides.",
"type": "array",
Expand Down Expand Up @@ -19098,6 +19160,10 @@
"Never"
]
},
"preserveResourcesOnDeletion": {
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the resource template is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the resource template.\n\nThis setting is particularly useful during workload migration scenarios to ensure that rollback can occur quickly without affecting the workloads running on the member clusters.\n\nAdditionally, this setting applies uniformly across all member clusters and will not selectively control preservation on only some clusters.\n\nNote: This setting does not apply to the deletion of the policy itself. When the policy is deleted, the resource templates and their corresponding propagated resources in member clusters will remain unchanged unless explicitly deleted.",
"type": "boolean"
},
"priority": {
"description": "Priority indicates the importance of a policy(PropagationPolicy or ClusterPropagationPolicy). A policy will be applied for the matched resource templates if there is no other policies with higher priority at the point of the resource template be processed. Once a resource template has been claimed by a policy, by default it will not be preempted by following policies even with a higher priority. See Preemption for more details.\n\nIn case of two policies have the same priority, the one with a more precise matching rules in ResourceSelectors wins: - matching by name(resourceSelector.name) has higher priority than\n by selector(resourceSelector.labelSelector)\n- matching by selector(resourceSelector.labelSelector) has higher priority\n than by APIVersion(resourceSelector.apiVersion) and Kind(resourceSelector.kind).\nIf there is still no winner at this point, the one with the lower alphabetic order wins, e.g. policy 'bar' has higher priority than 'foo'.\n\nThe higher the value, the higher the priority. Defaults to zero.",
"type": "integer",
Expand Down Expand Up @@ -19288,6 +19354,30 @@
}
}
},
"com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.YAMLPatchOperation": {
"description": "YAMLPatchOperation represents a single field modification operation for YAML format.",
"type": "object",
"required": [
"subPath",
"operator"
],
"properties": {
"operator": {
"description": "Operator indicates the operation on target field. Available operators are: \"add\", \"remove\", and \"replace\".",
"type": "string",
"default": ""
},
"subPath": {
"description": "SubPath specifies the relative location within the initial FieldPath where the operation should take place. The path uses RFC 6901 for navigating into nested structures.",
"type": "string",
"default": ""
},
"value": {
"description": "Value is the new value to set for the specified field if the operation is \"add\" or \"replace\". For \"remove\" operation, this field is ignored.",
"$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON"
}
}
},
"com.github.karmada-io.karmada.pkg.apis.remedy.v1alpha1.ClusterAffinity": {
"description": "ClusterAffinity represents the filter to select clusters.",
"type": "object",
Expand Down Expand Up @@ -19752,8 +19842,12 @@
"description": "WorkSpec defines the desired state of Work.",
"type": "object",
"properties": {
"preserveResourcesOnDeletion": {
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member cluster when the Work object is deleted. If set to true, resources will be preserved on the member cluster. Default is false, which means resources will be deleted along with the Work object.",
"type": "boolean"
},
"suspendDispatching": {
"description": "SuspendDispatching controls whether dispatching should be suspended, nil means not suspend. Note: true means stop propagating to all clusters.",
"description": "SuspendDispatching controls whether dispatching should be suspended, nil means not suspend. Note: true means stop propagating to the corresponding member cluster, and does not prevent status collection.",
"type": "boolean"
},
"workload": {
Expand Down Expand Up @@ -20174,6 +20268,10 @@
"description": "Placement represents the rule for select clusters to propagate resources.",
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.Placement"
},
"preserveResourcesOnDeletion": {
"description": "PreserveResourcesOnDeletion controls whether resources should be preserved on the member clusters when the binding object is deleted. If set to true, resources will be preserved on the member clusters. Default is false, which means resources will be deleted along with the binding object. This setting applies to all Work objects created under this binding object.",
"type": "boolean"
},
"propagateDeps": {
"description": "PropagateDeps tells if relevant resources should be propagated automatically. It is inherited from PropagationPolicy or ClusterPropagationPolicy. default false.",
"type": "boolean"
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 @@ -26,7 +26,7 @@ spec:
command:
- /bin/karmada-descheduler
- --kubeconfig=/etc/kubeconfig
- --metrics-bind-address=0.0.0.0:10358
- --metrics-bind-address=0.0.0.0:8080
- --health-probe-bind-address=0.0.0.0:10358
- --scheduler-estimator-ca-file=/etc/karmada/pki/ca.crt
- --scheduler-estimator-cert-file=/etc/karmada/pki/karmada.crt
Expand All @@ -42,7 +42,7 @@ spec:
periodSeconds: 15
timeoutSeconds: 5
ports:
- containerPort: 10358
- containerPort: 8080
name: metrics
protocol: TCP
volumeMounts:
Expand Down
Loading

0 comments on commit 82828f1

Please sign in to comment.