Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
k3s-version: [ v1.27.1 ]
# k3s-version: [v1.20.2, v1.19.2, v1.18.9, v1.17.11, v1.16.15]
k3s-version:
- v1.27.1-k3s1
- v1.33.5-k3s1
steps:
- name: Download kuttl plugin
env:
Expand All @@ -69,7 +70,20 @@ jobs:
set -x
curl -s https://raw.githubusercontent.com/rancher/k3d/main/install.sh | bash
sudo mkdir -p $HOME/.kube && sudo chown -R runner $HOME/.kube
k3d cluster create --servers 3 --image rancher/k3s:${{ matrix.k3s-version }}-k3s1

feature_flags=()
case "${{ matrix.k3s-version }}" in
v1.3[3456789]*)
# Enable ClusterTrustBundle and ClusterTrustBundleProjection until it is enabled by default in kubernetes
feature_flags+=(
"--k3s-arg" "--kube-apiserver-arg=feature-gates=ClusterTrustBundle=true,ClusterTrustBundleProjection=true@server:*"
"--k3s-arg" "--kube-apiserver-arg=runtime-config=certificates.k8s.io/v1beta1/clustertrustbundles=true@server:*"
"--k3s-arg" "--kubelet-arg=feature-gates=ClusterTrustBundle=true,ClusterTrustBundleProjection=true@agent:*"
)
;;
esac

k3d cluster create --servers 3 --image "rancher/k3s:${{ matrix.k3s-version }}" "${feature_flags[@]}"
kubectl version
k3d version
- name: Checkout code
Expand Down
15 changes: 15 additions & 0 deletions api/v1beta1/argocd_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,9 @@ type ArgoCDRepoSpec struct {

// Custom labels to pods deployed by the operator
Labels map[string]string `json:"labels,omitempty"`

// Custom certificates to inject into the repo server container and its plugins to trust source hosting sites
SystemCATrust *ArgoCDSystemCATrustSpec `json:"systemCATrust,omitempty"`
}

func (a *ArgoCDRepoSpec) IsEnabled() bool {
Expand All @@ -598,6 +601,18 @@ func (a *ArgoCDRepoSpec) IsRemote() bool {
return a.Remote != nil && *a.Remote != ""
}

// ArgoCDSystemCATrustSpec defines custom certificates to inject into the repo server container and its plugins to trust source hosting sites
type ArgoCDSystemCATrustSpec struct {
// DropImageCertificates will remove all certs that are present in the image, leaving only those explicitly configured here.
DropImageCertificates bool `json:"dropImageCertificates,omitempty"`
// ClusterTrustBundles is a list of projected ClusterTrustBundle volume definitions from where to take the trust certs.
ClusterTrustBundles []corev1.ClusterTrustBundleProjection `json:"clusterTrustBundles,omitempty"`
// Secrets is a list of projected Secret volume definitions from where to take the trust certs.
Secrets []corev1.SecretProjection `json:"secrets,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be SecretRefs instead of SecretProjection ? What is the advantage we get by using SecretProjection instead of referring a Secret directly which can be read directly by the operator code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, projections are the only way (I know off), to create a single volume from multiple sources. So this can combine all three kinds of sources in any quantity, and the entries will be merged in a single directory making the init container completely agnostic of files' origin.

If customers are to create the Secret or CM manually, using only one resource might not be that much to ask. But ability to merge them permits seemless integration with signed ClusterTrustBundles that are likely to have more than one resource.

// ConfigMaps is a list of projected ConfigMap volume definitions from where to take the trust certs.
ConfigMaps []corev1.ConfigMapProjection `json:"configMaps,omitempty"`
}

// ArgoCDRouteSpec defines the desired state for an OpenShift Route.
type ArgoCDRouteSpec struct {
// Annotations is the map of annotations to use for the Route resource.
Expand Down
41 changes: 41 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading