Skip to content

Commit 09d2f6e

Browse files
Merge pull request #252 from splunk/mergeDevelopIntoMasterRelease0.2.2
Merge develop into master release0.2.2
2 parents 57ac7a1 + 89ec4b2 commit 09d2f6e

File tree

156 files changed

+17359
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+17359
-1052
lines changed

.circleci/config.yml

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,40 @@ orbs:
88

99
workflows:
1010
version: 2
11-
build-and-push:
11+
nightly-integration-test:
12+
triggers:
13+
- schedule:
14+
cron: "0 12 * * *"
15+
filters:
16+
branches:
17+
only:
18+
- develop
1219
jobs:
1320
- build-image
1421
- unit-tests
1522
- integration-tests:
1623
requires:
1724
- build-image
1825
- unit-tests
26+
- vulnerability-scan:
27+
requires:
28+
- build-image
29+
build-and-push:
30+
jobs:
31+
- build-image
32+
- unit-tests
33+
- smoke-tests:
34+
requires:
35+
- build-image
36+
- unit-tests
1937
- vulnerability-scan:
2038
requires:
2139
- build-image
2240
- push-latest:
2341
requires:
2442
- build-image
2543
- unit-tests
26-
- integration-tests
44+
- smoke-tests
2745
- vulnerability-scan
2846
filters:
2947
branches:
@@ -33,7 +51,7 @@ workflows:
3351
requires:
3452
- build-image
3553
- unit-tests
36-
- integration-tests
54+
- smoke-tests
3755
- vulnerability-scan
3856
filters:
3957
branches:
@@ -43,7 +61,7 @@ workflows:
4361
requires:
4462
- build-image
4563
- unit-tests
46-
- integration-tests
64+
- smoke-tests
4765
- vulnerability-scan
4866
filters:
4967
tags:
@@ -154,6 +172,64 @@ jobs:
154172
- store_artifacts:
155173
name: Save coverage.out as artifact
156174
path: coverage.out
175+
# Runs smoke tests against a k8s cluster
176+
smoke-tests:
177+
executor: ubuntu-machine
178+
steps:
179+
- run:
180+
name: Setup Splunk operator and enterprise image env vars
181+
command: |
182+
echo 'export SPLUNK_OPERATOR_IMAGE=${IMAGE_NAME}:${CIRCLE_SHA1}' >> $BASH_ENV
183+
echo 'export SPLUNK_ENTERPRISE_IMAGE=${ENTERPRISE_IMAGE_NAME}' >> $BASH_ENV
184+
echo 'export COMMIT_HASH=$(echo ${CIRCLE_SHA1:0:7})' >> $BASH_ENV
185+
- kubernetes/install
186+
- aws-cli/install
187+
- aws-eks/install-eksctl
188+
- run:
189+
name: Install kind tool
190+
command: |
191+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.7.0/kind-$(uname)-amd64
192+
chmod +x ./kind
193+
sudo mv ./kind /usr/local/bin
194+
- checkout
195+
- attach_workspace:
196+
name: Restore workspace
197+
at: /tmp
198+
# load the operator image to local registry in the VM
199+
- load_image
200+
- run:
201+
name: Print out version and environment
202+
command: |
203+
ls -al
204+
echo "GO VERSION=`go version`"
205+
echo "CIRCLE_SHA1=$CIRCLE_SHA1"
206+
echo "SPLUNK_OPERATOR_IMAGE=$SPLUNK_OPERATOR_IMAGE"
207+
echo "SPLUNK_ENTEPRISE_IMAGE=$SPLUNK_ENTERPRISE_IMAGE"
208+
echo "PRIVATE_REGISTRY=$PRIVATE_REGISTRY"
209+
echo "CLUSTER_PROVIDER=$CLUSTER_PROVIDER"
210+
- run:
211+
# Deploys a eks or kind cluster depending of CLUSTER_PROVIDER flag. If cluster already exists,
212+
# it will skip. Uses NUM_WORKERS for size of cluster
213+
name: Deploy k8s cluster
214+
command: |
215+
make cluster-up
216+
kubectl version # log the k8s version
217+
no_output_timeout: 30m
218+
- run:
219+
# Run the smoke tests againsts the cluster deployed above.
220+
# Test againsts the SPLUNK_OPERATOR_IMAGE and SPLUNK_ENTERPRISE_IMAGE
221+
name: Run smoke tests
222+
command: |
223+
make int-test
224+
mkdir -p /tmp/test-results
225+
find ./test -name "*junit.xml" -exec cp {} /tmp/test-results \;
226+
environment:
227+
TEST_FOCUS: smoke
228+
- store_test_results:
229+
name: Save test results
230+
path: /tmp/test-results
231+
- store_artifacts:
232+
path: /tmp/test-results
157233
# Runs integration tests against a k8s cluster
158234
integration-tests:
159235
executor: ubuntu-machine
@@ -205,6 +281,8 @@ jobs:
205281
make int-test
206282
mkdir -p /tmp/test-results
207283
find ./test -name "*junit.xml" -exec cp {} /tmp/test-results \;
284+
environment:
285+
TEST_FOCUS: "smoke|ingest_search|monitoring_console|deletecr|smartstore"
208286
- store_test_results:
209287
name: Save test results
210288
path: /tmp/test-results

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2020 Splunk Inc.
1+
Copyright 2021 Splunk Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

cmd/manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018-2020 Splunk Inc. All rights reserved.
1+
// Copyright (c) 2018-2021 Splunk Inc. All rights reserved.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

deploy/crds/enterprise.splunk.com_clustermasters_crd.yaml

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,26 @@ spec:
659659
description: Full path or URL for one or more default.yml files, separated
660660
by commas
661661
type: string
662-
ephemeralStorage:
663-
description: If true, ephemeral (emptyDir) storage will be used for
664-
/opt/splunk/etc and /opt/splunk/var volumes
665-
type: boolean
666-
etcStorage:
667-
description: Storage capacity to request for /opt/splunk/etc persistent
668-
volume claims (default=”1Gi”)
662+
defaultsUrlApps:
663+
description: Full path or URL for one or more defaults.yml files specific
664+
to App install, separated by commas. The defaults listed here will
665+
be installed on the CM, standalone, search head deployer or license
666+
master instance.
669667
type: string
668+
etcVolumeStorageConfig:
669+
description: Storage configuration for /opt/splunk/etc volume
670+
properties:
671+
ephemeralStorage:
672+
description: If true, ephemeral (emptyDir) storage will be used
673+
type: boolean
674+
storageCapacity:
675+
description: Storage capacity to request persistent volume claims
676+
(default=”10Gi” for etc and "100Gi" for var)
677+
type: string
678+
storageClassName:
679+
description: Name of StorageClass to use for persistent volume claims
680+
type: string
681+
type: object
670682
image:
671683
description: Image to use for Splunk pod containers (overrides RELATED_IMAGE_SPLUNK_ENTERPRISE
672684
environment variables)
@@ -740,6 +752,11 @@ spec:
740752
description: Name of Scheduler to use for pod placement (defaults to
741753
“default-scheduler”)
742754
type: string
755+
serviceAccount:
756+
description: ServiceAccount is the service account used by the pods
757+
deployed by the CRD. If not specified uses the default serviceAccount
758+
for the namespace as per https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
759+
type: string
743760
serviceTemplate:
744761
description: ServiceTemplate is a template used to create Kubernetes
745762
services
@@ -1087,9 +1104,6 @@ spec:
10871104
to setup the soft links from ../master-apps/splunk-operator/local/
10881105
to /mnt/splunk-operator/local/
10891106
type: string
1090-
storageClassName:
1091-
description: Name of StorageClass to use for persistent volume claims
1092-
type: string
10931107
tolerations:
10941108
description: Pod's tolerations for Kubernetes node's taint
10951109
items:
@@ -1130,10 +1144,20 @@ spec:
11301144
type: string
11311145
type: object
11321146
type: array
1133-
varStorage:
1134-
description: Storage capacity to request for /opt/splunk/var persistent
1135-
volume claims (default=”50Gi”)
1136-
type: string
1147+
varVolumeStorageConfig:
1148+
description: Storage configuration for /opt/splunk/var volume
1149+
properties:
1150+
ephemeralStorage:
1151+
description: If true, ephemeral (emptyDir) storage will be used
1152+
type: boolean
1153+
storageCapacity:
1154+
description: Storage capacity to request persistent volume claims
1155+
(default=”10Gi” for etc and "100Gi" for var)
1156+
type: string
1157+
storageClassName:
1158+
description: Name of StorageClass to use for persistent volume claims
1159+
type: string
1160+
type: object
11371161
volumes:
11381162
description: List of one or more Kubernetes volumes. These will be mounted
11391163
in all pod containers as as /mnt/<name>

deploy/crds/enterprise.splunk.com_indexerclusters_crd.yaml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -681,14 +681,26 @@ spec:
681681
description: Full path or URL for one or more default.yml files, separated
682682
by commas
683683
type: string
684-
ephemeralStorage:
685-
description: If true, ephemeral (emptyDir) storage will be used for
686-
/opt/splunk/etc and /opt/splunk/var volumes
687-
type: boolean
688-
etcStorage:
689-
description: Storage capacity to request for /opt/splunk/etc persistent
690-
volume claims (default=”1Gi”)
684+
defaultsUrlApps:
685+
description: Full path or URL for one or more defaults.yml files specific
686+
to App install, separated by commas. The defaults listed here will
687+
be installed on the CM, standalone, search head deployer or license
688+
master instance.
691689
type: string
690+
etcVolumeStorageConfig:
691+
description: Storage configuration for /opt/splunk/etc volume
692+
properties:
693+
ephemeralStorage:
694+
description: If true, ephemeral (emptyDir) storage will be used
695+
type: boolean
696+
storageCapacity:
697+
description: Storage capacity to request persistent volume claims
698+
(default=”10Gi” for etc and "100Gi" for var)
699+
type: string
700+
storageClassName:
701+
description: Name of StorageClass to use for persistent volume claims
702+
type: string
703+
type: object
692704
image:
693705
description: Image to use for Splunk pod containers (overrides RELATED_IMAGE_SPLUNK_ENTERPRISE
694706
environment variables)
@@ -767,6 +779,11 @@ spec:
767779
description: Name of Scheduler to use for pod placement (defaults to
768780
“default-scheduler”)
769781
type: string
782+
serviceAccount:
783+
description: ServiceAccount is the service account used by the pods
784+
deployed by the CRD. If not specified uses the default serviceAccount
785+
for the namespace as per https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#use-the-default-service-account-to-access-the-api-server
786+
type: string
770787
serviceTemplate:
771788
description: ServiceTemplate is a template used to create Kubernetes
772789
services
@@ -1005,9 +1022,6 @@ spec:
10051022
type: object
10061023
type: object
10071024
type: object
1008-
storageClassName:
1009-
description: Name of StorageClass to use for persistent volume claims
1010-
type: string
10111025
tolerations:
10121026
description: Pod's tolerations for Kubernetes node's taint
10131027
items:
@@ -1048,10 +1062,20 @@ spec:
10481062
type: string
10491063
type: object
10501064
type: array
1051-
varStorage:
1052-
description: Storage capacity to request for /opt/splunk/var persistent
1053-
volume claims (default=”50Gi”)
1054-
type: string
1065+
varVolumeStorageConfig:
1066+
description: Storage configuration for /opt/splunk/var volume
1067+
properties:
1068+
ephemeralStorage:
1069+
description: If true, ephemeral (emptyDir) storage will be used
1070+
type: boolean
1071+
storageCapacity:
1072+
description: Storage capacity to request persistent volume claims
1073+
(default=”10Gi” for etc and "100Gi" for var)
1074+
type: string
1075+
storageClassName:
1076+
description: Name of StorageClass to use for persistent volume claims
1077+
type: string
1078+
type: object
10551079
volumes:
10561080
description: List of one or more Kubernetes volumes. These will be mounted
10571081
in all pod containers as as /mnt/<name>
@@ -2325,10 +2349,6 @@ spec:
23252349
description: Indicates whether the master is ready to begin servicing,
23262350
based on whether it is initialized.
23272351
type: boolean
2328-
skip_recheck_update:
2329-
description: Indicates if we need to recheck the revision update on
2330-
pods
2331-
type: boolean
23322352
type: object
23332353
type: object
23342354
version: v1beta1

0 commit comments

Comments
 (0)