Skip to content
Merged
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
7 changes: 7 additions & 0 deletions config/crd/bases/operator.kcp.io_rootshards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ spec:
type: object
type: object
clusterDomain:
description: ClusterDomain is the DNS domain for services in the cluster.
Defaults to "cluster.local" if not set.
type: string
deploymentTemplate:
description: 'Optional: DeploymentTemplate configures the Kubernetes
Expand Down Expand Up @@ -3198,6 +3200,11 @@ spec:
type: string
type: object
type: object
shardBaseURL:
description: |-
ShardBaseURL is the base URL under which this shard should be reachable. This is used to configure
the external URL. If not provided, the operator will use kubernetes service address to generate it.
type: string
required:
- cache
- certificates
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/operator.kcp.io_shards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ spec:
certificates for this shard.
type: object
clusterDomain:
description: ClusterDomain is the DNS domain for services in the cluster.
Defaults to "cluster.local" if not set.
type: string
deploymentTemplate:
description: 'Optional: DeploymentTemplate configures the Kubernetes
Expand Down Expand Up @@ -1702,6 +1704,11 @@ spec:
type: string
type: object
type: object
shardBaseURL:
description: |-
ShardBaseURL is the base URL under which this shard should be reachable. This is used to configure
the external URL. If not provided, the operator will use kubernetes service address to generate it.
type: string
required:
- etcd
- rootShard
Expand Down
21 changes: 21 additions & 0 deletions hack/ci/kernel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: batch/v1
kind: Job
metadata:
name: kernel-limits
namespace: default
spec:
template:
spec:
containers:
- name: init
image: alpine:3.14
command:
- /bin/sh
- -xc
- |
sysctl fs.inotify.max_user_watches=1048576
sysctl fs.inotify.max_user_instances=1024
securityContext:
privileged: true
restartPolicy: Never
backoffLimit: 1
9 changes: 9 additions & 0 deletions hack/ci/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ echo "Creating kind cluster $KIND_CLUSTER_NAME..."
kind create cluster --name "$KIND_CLUSTER_NAME" --image kindest/node:v1.32.2
chmod 600 "$KUBECONFIG"

# apply kernel limits job first and wait for completion
echo "Applying kernel limits job…"
kubectl apply --filename hack/ci/kernel.yaml
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
echo "Kernel limits job completed."

# store logs as artifacts
make protokol
_tools/protokol --output "$ARTIFACTS/logs" --namespace 'kcp-*' --namespace 'e2e-*' >/dev/null 2>&1 &
Expand Down Expand Up @@ -109,6 +115,9 @@ WHAT="${WHAT:-./test/e2e/...}"
TEST_ARGS="${TEST_ARGS:--timeout 2h -v}"
E2E_PARALLELISM=${E2E_PARALLELISM:-2}

# Increase file descriptor limit for CI environments
ulimit -n 65536

(set -x; go test -tags e2e -parallel $E2E_PARALLELISM $TEST_ARGS "$WHAT")

echo "Done. :-)"
6 changes: 6 additions & 0 deletions hack/run-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ fi

echo "Kubeconfig is in $KUBECONFIG."

# apply kernel limits job first and wait for completion
echo "Applying kernel limits job…"
kubectl apply --filename hack/ci/kernel.yaml
kubectl wait --for=condition=Complete job/kernel-limits --timeout=300s
echo "Kernel limits job completed."

# deploying operator CRDs
echo "Deploying operator CRDs..."
kubectl apply --kustomize config/crd
Expand Down
6 changes: 6 additions & 0 deletions internal/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ func GetRootShardBaseHost(r *operatorv1alpha1.RootShard) string {
}

func GetRootShardBaseURL(r *operatorv1alpha1.RootShard) string {
if r.Spec.ShardBaseURL != "" {
return r.Spec.ShardBaseURL
}
return fmt.Sprintf("https://%s:6443", GetRootShardBaseHost(r))
}

Expand All @@ -130,6 +133,9 @@ func GetShardBaseHost(s *operatorv1alpha1.Shard) string {
}

func GetShardBaseURL(s *operatorv1alpha1.Shard) string {
if s.Spec.ShardBaseURL != "" {
return s.Spec.ShardBaseURL
}
return fmt.Sprintf("https://%s:6443", GetShardBaseHost(s))
}

Expand Down
7 changes: 7 additions & 0 deletions sdk/apis/operator/v1alpha1/shard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ type ShardSpec struct {
}

type CommonShardSpec struct {
// ClusterDomain is the DNS domain for services in the cluster. Defaults to "cluster.local" if not set.
// +optional
ClusterDomain string `json:"clusterDomain,omitempty"`

// ShardBaseURL is the base URL under which this shard should be reachable. This is used to configure
// the external URL. If not provided, the operator will use kubernetes service address to generate it.
// +optional
ShardBaseURL string `json:"shardBaseURL,omitempty"`

// Etcd configures the etcd cluster that this shard should be using.
Etcd EtcdConfig `json:"etcd"`

Expand Down
57 changes: 57 additions & 0 deletions sdk/applyconfiguration/operator/v1alpha1/certificateissuerref.go

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

9 changes: 9 additions & 0 deletions sdk/applyconfiguration/operator/v1alpha1/commonshardspec.go

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

8 changes: 8 additions & 0 deletions sdk/applyconfiguration/operator/v1alpha1/rootshardspec.go

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

8 changes: 8 additions & 0 deletions sdk/applyconfiguration/operator/v1alpha1/shardspec.go

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