Skip to content

Commit 7541e96

Browse files
committed
Merge branch 'release/1.3.0'
* release/1.3.0: (119 commits) release 1.3.0 (#282) check version only on develop (#281) Enable FluentD Prometheus Endpoint (#257) trigger functional test from sub plugin repos (#279) add latest hec image to firelens readme (#280) add latest hec image to firelens readme (#280) Firelens (#260) ingest api support (#253) abstract HEC info (#254) For multiline events, use the timestamp of the first event and d… (#244) remove version label from selector in manifests (#229) added indexed fields to logging and objects (#231) Missing end clause (#238) Add support for kube apiserver audit logs (#232) updated configuration for systemd plugin to use matches as filte… (#233) index-routing-objects (#235) openshift fix (#226) Docker private images (#222) Update README to reflect support policy (#227) Custom filters (#216) ...
2 parents e613504 + a6720d2 commit 7541e96

File tree

76 files changed

+1431
-493
lines changed

Some content is hidden

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

76 files changed

+1431
-493
lines changed

.circleci/build_sck_artifacts.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
3-
TAG="1.1.0.Alpha-${CIRCLE_SHA1}"
3+
VERSION=`cat VERSION`
4+
TAG="$VERSION-${CIRCLE_SHA1}"
45

56
function replace_generic_version ()
67
{

.circleci/build_sck_artifacts_for_release.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#!/usr/bin/env bash
22
set -e
3-
TAG=`cat VERSION`
3+
VERSION=`cat VERSION`
4+
5+
source PLUGIN_VERSIONS.sh
46

57
# Install yq yaml parser
68
wget https://github.com/mikefarah/yq/releases/download/2.2.1/yq_linux_amd64
79
sudo chmod +x yq_linux_amd64
810
sudo mv yq_linux_amd64 /usr/local/bin/yq
911

10-
yq w -i helm-chart/splunk-kubernetes-logging/values.yaml image.name splunk/fluentd-hec:1.1.1
11-
yq w -i helm-chart/splunk-kubernetes-metrics/values.yaml image.name splunk/k8s-metrics:1.1.1
12-
yq w -i helm-chart/splunk-kubernetes-metrics/values.yaml imageAgg.name splunk/k8s-metrics-aggr:1.1.0
13-
yq w -i helm-chart/splunk-kubernetes-objects/values.yaml image.name splunk/kube-objects:1.1.0
12+
# Before release, "make manifests" call should have been run.
13+
# then there are nothing else to change. but keeping them here just in case
14+
yq w -i helm-chart/splunk-kubernetes-logging/values.yaml image.tag $FLUENTD_HEC_VERSION
15+
yq w -i helm-chart/splunk-kubernetes-metrics/values.yaml image.tag $K8S_METRICS_VERISION
16+
yq w -i helm-chart/splunk-kubernetes-metrics/values.yaml imageAgg.tag $K8S_METRICS_AGGR_VERSION
17+
yq w -i helm-chart/splunk-kubernetes-objects/values.yaml image.tag $KUBE_OBJECT_VERSION
1418

1519
yq w -i helm-chart/splunk-connect-for-kubernetes/Chart.yaml version $VERSION
1620
yq w -i helm-chart/splunk-kubernetes-logging/Chart.yaml version $VERSION
@@ -22,9 +26,9 @@ yq w -i helm-chart/splunk-kubernetes-logging/Chart.yaml appVersion $VERSION
2226
yq w -i helm-chart/splunk-kubernetes-metrics/Chart.yaml appVersion $VERSION
2327
yq w -i helm-chart/splunk-kubernetes-objects/Chart.yaml appVersion $VERSION
2428

25-
yq w -i helm-chart/splunk-kubernetes-logging/requirements.yaml dependencies.splunk-kubernetes-logging.version $VERSION
26-
yq w -i helm-chart/splunk-kubernetes-metrics/requirements.yaml dependencies.splunk-kubernetes-metrics.version $VERSION
27-
yq w -i helm-chart/splunk-kubernetes-objects/requirements.yaml dependencies.splunk-kubernetes-objects.version $VERSION
29+
yq w -i helm-chart/splunk-connect-for-kubernetes/requirements.yaml dependencies[0].version $VERSION
30+
yq w -i helm-chart/splunk-connect-for-kubernetes/requirements.yaml dependencies[1].version $VERSION
31+
yq w -i helm-chart/splunk-connect-for-kubernetes/requirements.yaml dependencies[2].version $VERSION
2832

2933
mkdir helm-artifacts-release
3034
if [[ -d "helm-chart/splunk-connect-for-kubernetes/charts" ]]; then

.circleci/chart_schema.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: str()
2+
home: str()
3+
version: str()
4+
appVersion: any(str(), num())
5+
description: str()
6+
keywords: list(str(), required=False)
7+
sources: list(str(), required=False)
8+
maintainers: list(include('maintainer'), required=False)
9+
icon: str(required=False)
10+
engine: str(required=False)
11+
condition: str(required=False)
12+
tags: str(required=False)
13+
deprecated: bool(required=False)
14+
kubeVersion: str(required=False)
15+
annotations: map(str(), str(), required=False)
16+
---
17+
maintainer:
18+
name: str()
19+
email: str(required=False)
20+
url: str(required=False)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
LATEST_COMMIT=$(git rev-parse HEAD)
4+
VERSION_COMMIT=$(git log -1 --format=format:%H VERSION)
5+
if [ $VERSION_COMMIT = $LATEST_COMMIT ];
6+
then
7+
if [ -s VERSION ] # Check if content is empty
8+
then
9+
VERSION=`cat VERSION`
10+
echo "VERSION is changed to $VERSION"
11+
else
12+
echo "[ERROR] VERSION file is empty."
13+
exit 1
14+
fi
15+
git config user.email "splunk-oss-admin@splunk.com"
16+
git config user.name "splunk-oss-admin"
17+
git checkout develop
18+
git pull origin develop
19+
git checkout -b release/$VERSION origin/develop
20+
git push https://$RELEASE_GITHUB_USER:$RELEASE_GITHUB_PASS@github.com/splunk/splunk-connect-for-kubernetes.git release/$VERSION
21+
git checkout master
22+
git merge --no-edit release/$VERSION
23+
git push https://$RELEASE_GITHUB_USER:$RELEASE_GITHUB_PASS@github.com/splunk/splunk-connect-for-kubernetes.git master
24+
fi

.circleci/config.yml

Lines changed: 134 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,93 @@
11
version: 2
22
jobs:
3-
build:
4-
docker:
5-
- image: circleci/ruby:2.6.1-node-browsers
3+
build_test:
4+
resource_class: large
5+
machine:
6+
image: ubuntu-1604:201903-01
7+
environment:
8+
CHANGE_MINIKUBE_NONE_USER: true
9+
GOPATH: /home/circleci/go
10+
KUBECONFIG: /home/circleci/.kube/config
11+
KUBERNETES_VERSION: v1.15.2
12+
MINIKUBE_HOME: /home/circleci
13+
MINIKUBE_VERSION: v1.2.0
14+
MINIKUBE_WANTUPDATENOTIFICATION: false
15+
MINIKUBE_WANTREPORTERRORPROMPT: false
16+
SKAFFOLD_VERSION: v0.33.0
17+
GO111MODULE: "on"
18+
CI_SPLUNK_VERSION: "7.3.2"
19+
CI_SPLUNK_FILENAME: splunk-7.3.2-c60db69f8e32-linux-2.6-amd64.deb
20+
CI_SPLUNK_HOST: 127.0.0.1
21+
CI_SPLUNK_PORT: 8089
22+
CI_SPLUNK_USERNAME: admin
23+
CI_SPLUNK_HEC_TOKEN: a6b5e77f-d5f6-415a-bd43-930cecb12959
24+
CI_SPLUNK_HEC_TOKEN_PERF: a6b5e77f-d5f6-415a-bd43-930cecb12959
25+
CI_SPLUNK_PASSWORD: helloworld
26+
CI_HEC_PROTOCOL: http
27+
CI_INDEX_EVENTS: circleci_events
28+
CI_INDEX_OBJECTS: circleci_objects
29+
CI_INDEX_METRICS: circleci_metrics
30+
CI_INDEX_NAMESPACE_ROUTING: test-namespace-routing
31+
CI_KAFKA_DATAGEN_IMAGE: chaitanyaphalak/kafkadatagen:1.0-4-gca7f6d8
632
working_directory: ~/repo
733
steps:
834
- checkout
9-
- setup_remote_docker:
10-
reusable: true
35+
- run:
36+
name: Install Splunk
37+
command: |
38+
cd /tmp && wget -O $CI_SPLUNK_FILENAME 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version='$CI_SPLUNK_VERSION'&product=splunk&filename='$CI_SPLUNK_FILENAME'&wget=true'
39+
sudo dpkg -i $CI_SPLUNK_FILENAME
40+
# Set user seed
41+
hashed_pwd=$(sudo /opt/splunk/bin/splunk hash-passwd $CI_SPLUNK_PASSWORD)
42+
sudo tee /opt/splunk/etc/system/local/user-seed.conf > /dev/null << EOF
43+
[user_info]
44+
USERNAME = $CI_SPLUNK_USERNAME
45+
HASHED_PASSWORD = $hashed_pwd
46+
EOF
47+
# Add delete capability to admin role
48+
sudo tee -a /opt/splunk/etc/system/local/authorize.conf > /dev/null << EOF
49+
[role_admin]
50+
delete_by_keyword = enabled
51+
EOF
52+
# start Splunk
53+
sudo /opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt
54+
# Enable HEC services
55+
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http/http/enable
56+
# Create new HEC token
57+
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k -d "name=splunk_hec_token&token=$CI_SPLUNK_HEC_TOKEN" https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http
58+
# Enable HEC new-token
59+
sudo /opt/splunk/bin/splunk http-event-collector enable -name splunk_hec_token -uri https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
60+
# Disable SSL for HEC new-token
61+
sudo /opt/splunk/bin/splunk http-event-collector update -uri https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT -enable-ssl 0 -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
62+
# Setup Indexes
63+
sudo /opt/splunk/bin/splunk add index $CI_INDEX_EVENTS -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
64+
sudo /opt/splunk/bin/splunk add index $CI_INDEX_OBJECTS -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
65+
sudo /opt/splunk/bin/splunk add index $CI_INDEX_METRICS -datatype metric -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
66+
sudo /opt/splunk/bin/splunk add index kube-system -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
67+
sudo /opt/splunk/bin/splunk add index kube-public -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
68+
sudo /opt/splunk/bin/splunk add index $CI_INDEX_NAMESPACE_ROUTING -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD
69+
sudo /opt/splunk/bin/splunk http-event-collector update -uri https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT -name splunk_hec_token -auth $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -index $CI_INDEX_EVENTS -indexes $CI_INDEX_METRICS,$CI_INDEX_OBJECTS,$CI_INDEX_EVENTS,$CI_INDEX_NAMESPACE_ROUTING,kube-system,kube-public
70+
# Restart Splunk
71+
sudo /opt/splunk/bin/splunk restart --accept-license --answer-yes --no-prompt
72+
- run:
73+
name: Install and Start minikube
74+
command: |
75+
# Install Kubectl
76+
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl
77+
chmod +x kubectl
78+
sudo mv kubectl /usr/local/bin/
79+
mkdir -p ${HOME}/.kube
80+
touch ${HOME}/.kube/config
81+
# Install Minikube
82+
curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64
83+
chmod +x minikube
84+
sudo mv minikube /usr/local/bin/
85+
# Start Minikube and Wait
86+
sudo -E minikube start --vm-driver=none --cpus 2 --memory 4098 --kubernetes-version=${KUBERNETES_VERSION}
87+
export JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
88+
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
89+
sleep 1;
90+
done
1191
- run:
1292
name: Install dependencies
1393
command: |
@@ -17,32 +97,36 @@ jobs:
1797
sudo apt-get install -y python-pip libpython-dev > /dev/null 2>&1
1898
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash -s -- --version v2.12.3
1999
helm init -c
20-
echo "Installing aws cli..."
21-
sudo pip install awscli > /dev/null 2>&1
100+
docker pull $CI_KAFKA_DATAGEN_IMAGE
101+
pyenv global 3.6.5
102+
pip install --upgrade pip
103+
pip install -r test/requirements.txt
22104
- run:
23-
name: Update configurables to build artifacts
105+
name: Lint helm charts
24106
command: |
25-
.circleci/update_sck_config.sh
107+
.circleci/lint.sh
26108
- run:
27109
name: Build SCK artifacts
28110
command: |
29111
.circleci/build_sck_artifacts.sh
30112
- run:
31-
name: Push SCK artifacts to s3
113+
name: Update configurables for unit test
32114
command: |
33-
.circleci/push_sck_artifacts.sh
115+
export CI_SPLUNK_HEC_HOST=$(hostname -i)
116+
export CI_SPLUNK_HEC_HOST_PERF=$(hostname -i)
117+
.circleci/update_sck_config.sh
34118
- run:
35119
name: Deploy k8s connector
36120
command: |
37121
.circleci/deploy_connector.sh
38122
- run:
39123
name: Run functional tests
40124
command: |
125+
export CI_SPLUNK_HEC_HOST=$(hostname -i)
126+
pyenv global 3.6.5
127+
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
128+
sleep 30
41129
.circleci/run_functional_tests.sh
42-
- run:
43-
name: Teardown deployment
44-
command: |
45-
helm delete --purge ci-$CIRCLE_SHA1
46130
47131
perf-test:
48132
docker:
@@ -93,10 +177,6 @@ jobs:
93177
sudo apt-get install -y python-pip libpython-dev > /dev/null 2>&1
94178
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
95179
helm init -c
96-
- run:
97-
name: Update configurables to build artifacts
98-
command: |
99-
.circleci/update_sck_config_for_release.sh
100180
- run:
101181
name: Build SCK artifacts
102182
command: |
@@ -105,32 +185,52 @@ jobs:
105185
name: Push SCK artifacts to Github Release
106186
command: |
107187
.circleci/push_sck_release.sh
188+
189+
check_version:
190+
docker:
191+
- image: circleci/ruby:2.6.1-node-browsers
192+
working_directory: ~/repo
193+
steps:
194+
- attach_workspace:
195+
at: /tmp
196+
- checkout
197+
- setup_remote_docker:
198+
reusable: true
108199
- run:
109-
name: Deploy k8s connector
110-
command: |
111-
.circleci/deploy_connector_release.sh
112-
- run:
113-
name: Run functional tests
200+
name: Check VERSION file for change
114201
command: |
115-
.circleci/run_functional_tests.sh
116-
117-
# Need to add teardown step
202+
.circleci/check_version_trigger_release.sh
118203
119204
workflows:
120205
version: 2
121-
build_perf-test:
206+
build_test:
122207
jobs:
123-
- build:
208+
- build_test:
124209
filters:
125210
branches:
126-
ignore: perf-testing
211+
ignore:
212+
- perf-testing
213+
- /^release\/.*/
214+
- master
215+
- check_version:
216+
requires:
217+
- build_test
218+
filters:
219+
branches:
220+
only: develop
221+
perf-test:
222+
jobs:
127223
- perf-test:
128224
filters:
129225
branches:
130226
only: perf-testing
131-
- release:
132-
requires:
133-
- build
227+
release:
228+
jobs:
229+
- build_test:
134230
filters:
135231
branches:
136-
only: release-testing
232+
only:
233+
- master
234+
- release:
235+
requires:
236+
- build_test

.circleci/deploy_connector.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#!/usr/bin/env bash
22
set -e
3-
echo "Setup kube client..."
4-
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
5-
chmod +x ./kubectl
6-
sudo mv ./kubectl /usr/local/bin/kubectl
7-
sudo apt-get -y install gnupg
8-
sudo mkdir ~/.kube
9-
echo $GPG_KEY | gpg --output config --passphrase-fd 0 --decrypt --batch .circleci/kubeconfig.gpg
10-
sudo mv config ~/.kube/config
113
#Update helm server version
12-
helm init --upgrade
4+
helm init --force-upgrade
5+
# Wait for helm to be ready
6+
until kubectl get pod --all-namespaces | grep tiller | grep -q "1\/1"; do
7+
sleep 1;
8+
done
139
#Make sure to check and clean previously failed deployment
1410
echo "Checking if previous deployment exist..."
1511
if [ "`helm ls`" == "" ]; then
@@ -19,6 +15,7 @@ else
1915
fi
2016
echo "Deploying k8s-connect with latest changes"
2117
helm install --name=ci-$CIRCLE_SHA1 -f .circleci/sck_values.yml helm-artifacts/splunk-connect-for-kubernetes*.tgz
22-
#Todo-need to add test cases and run them before cleaning the deployment
23-
#wait for deployment to finish, sleep longer for metrics-aggr to start sending metrics
24-
sleep 90
18+
#wait for deployment to finish
19+
until kubectl get pod | grep Running | [[ $(wc -l) == 4 ]]; do
20+
sleep 1;
21+
done

.circleci/lint.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# chart template linting
5+
wget https://github.com/helm/chart-testing/releases/download/v2.3.3/chart-testing_2.3.3_linux_amd64.tar.gz
6+
tar -xvf chart-testing_2.3.3_linux_amd64.tar.gz
7+
sudo chmod +x ct
8+
sudo mv ct /usr/local/bin/ct
9+
10+
# lint helm charts
11+
echo "Linting charts"
12+
helm lint helm-chart/*
13+
echo "Linting charts with CI values"
14+
helm lint --values .circleci/sck_values.yml helm-chart/*
15+
cd .circleci
16+
echo "Linting charts ct lint tool"
17+
ct lint helm-chart/*

0 commit comments

Comments
 (0)