Skip to content

Commit

Permalink
CSPL-2444: Pipeline issues (#1220)
Browse files Browse the repository at this point in the history
* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixing docker image in workflows

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* adding ebs driver add on code

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixed .env file with latest version of k8s

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixed .env file with ekctl version

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixed .env file with ekctl version

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

* fixed aws ebs csi driver

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>

---------

Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>
  • Loading branch information
vivekr-splunk authored Aug 17, 2023
1 parent eac4722 commit 7384961
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ OPERATOR_SDK_VERSION=v1.28.1
REVIEWERS=pdhanoya-splunk,smohan-splunk,sgontla,gaurav-splunk,jryb,vivekr-splunk,kumarajeet
GO_VERSION=1.19.2
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
KUBECTL_VERSION=v1.25.3
KUBECTL_VERSION=v1.28.0
AZ_CLI_VERSION=2.30.0
EKSCTL_VERSION=v0.143.0
EKS_CLUSTER_K8_VERSION=1.22
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.0.5
EKS_CLUSTER_K8_VERSION=1.26
SPLUNK_ENTERPRISE_RELEASE_IMAGE=docker.io/splunk/splunk:9.0.5
1 change: 0 additions & 1 deletion .github/workflows/automated-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0

- name: Configure Docker Credentials
uses: docker/login-action@v1
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/bundle-push-post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Deep Fetch
- name: Deep Fetch
run: |
git fetch --prune --unshallow
Expand All @@ -31,7 +31,6 @@ jobs:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0

- name: Configure Docker Credentials
uses: docker/login-action@v1
with:
Expand All @@ -44,13 +43,13 @@ jobs:
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}
sudo curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
sudo chmod +x operator-sdk_${OS}_${ARCH}
sudo chmod +x operator-sdk_${OS}_${ARCH}
sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
- name: Pull RC Splunk Operator Image
run: |
docker pull splunk/splunk-operator:${{ github.event.inputs.operator_image_tag }}
- name: Run Bundle Push for the release
run: |
make bundle-build bundle-push catalog-build catalog-push IMAGE_TAG_BASE=docker.io/splunk/splunk-operator VERSION=${{ github.event.inputs.release_version }} IMG=docker.io/splunk/splunk-operator:${{ github.event.inputs.operator_image_tag }}
2 changes: 1 addition & 1 deletion .github/workflows/int-test-azure-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
# AZURE_MANAGED_ID_ENABLED: "${{ matrix.auth_method_managed_id }}"
AZURE_MANAGED_ID_ENABLED: "false"
steps:
# Need this because apps are downloaded from S3.
# Need this because apps are downloaded from S3.
- name: Set Test Cluster Name
run: |
echo "TEST_CLUSTER_NAME=az${{ github.run_id }}" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Install Ginkgo
- name: Install Ginkgo
run: |
make setup/ginkgo
- name: Install Helm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual-int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: >-
if grep -q "appframework" <<< "${{ matrix.test }}"; then
echo "CLUSTER_WORKERS=5" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -197,5 +197,5 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PUSH_TOKEN}}
- name: Push Splunk Operator Image to Docker Hub
- name: Push Splunk Operator Image to Docker Hub
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
5 changes: 2 additions & 3 deletions .github/workflows/namespace-scope-int-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: >-
if grep -q "appframework" <<< "${{ matrix.test }}"; then
echo "CLUSTER_WORKERS=5" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -80,7 +80,7 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Install Ginkgo
- name: Install Ginkgo
run: |
make setup/ginkgo
- name: Install EKS CTL
Expand Down Expand Up @@ -156,4 +156,3 @@ jobs:
if: ${{ always() }}
run: |
make cluster-down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-int-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}
sudo curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
sudo chmod +x operator-sdk_${OS}_${ARCH}
sudo chmod +x operator-sdk_${OS}_${ARCH}
sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -100,10 +100,10 @@ jobs:
run: >-
if grep -q "appframework" <<< "${{ matrix.test }}"; then
echo "CLUSTER_WORKERS=5" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
fi
- uses: actions/checkout@v2
with:
with:
ref: develop
- name: Dotenv Action
id: dotenv
Expand Down Expand Up @@ -234,5 +234,5 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PUSH_TOKEN}}
- name: Push Splunk Operator Image to Docker Hub
- name: Push Splunk Operator Image to Docker Hub
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
38 changes: 35 additions & 3 deletions test/deploy-eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ if [[ -z "${ECR_REPOSITORY}" ]]; then
fi

if [[ -z "${EKS_CLUSTER_K8_VERSION}" ]]; then
echo "EKS_CLUSTER_K8_VERSION not set. Changing to 1.22"
export EKS_CLUSTER_K8_VERSION="1.22"
echo "EKS_CLUSTER_K8_VERSION not set. Changing to 1.26"
export EKS_CLUSTER_K8_VERSION="1.26"
fi

function deleteCluster() {
Expand All @@ -35,6 +35,8 @@ function deleteCluster() {
echo "Unable to delete cluster - ${TEST_CLUSTER_NAME}"
return 1
fi
rolename= echo ${TEST_CLUSTER_NAME} | awk -F- '{print "EBS_" $(NF-1) "_" $(NF)}'
aws iam delete-role --role-name ${rolename}

return 0
}
Expand All @@ -54,6 +56,36 @@ function createCluster() {
echo "Unable to create cluster - ${TEST_CLUSTER_NAME}"
return 1
fi
eksctl utils associate-iam-oidc-provider --cluster=${TEST_CLUSTER_NAME} --approve
oidc_id=$(aws eks describe-cluster --name ${TEST_CLUSTER_NAME} --query "cluster.identity.oidc.issuer" --output text | cut -d '/' -f 5)
account_id=$(aws sts get-caller-identity --query "Account" --output text)
oidc_provider=$(aws eks describe-cluster --name ${TEST_CLUSTER_NAME} --region "us-west-2" --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///")
namespace=kube-system
service_account=ebs-csi-controller-sa
kubectl create serviceaccount ${service_account} --namespace ${namespace}
echo "{
\"Version\": \"2012-10-17\",
\"Statement\": [
{
\"Effect\": \"Allow\",
\"Principal\": {
\"Federated\": \"arn:aws:iam::$account_id:oidc-provider/$oidc_provider\"
},
\"Action\": \"sts:AssumeRoleWithWebIdentity\",
\"Condition\": {
\"StringEquals\": {
\"$oidc_provider:aud\": \"sts.amazonaws.com\",
\"$oidc_provider:sub\": \"system:serviceaccount:$namespace:$service_account\"
}
}
}
]
}" >aws-ebs-csi-driver-trust-policy.json
rolename=$(echo ${TEST_CLUSTER_NAME} | awk -F- '{print "EBS_" $(NF-1) "_" $(NF)}')
aws iam create-role --role-name ${rolename} --assume-role-policy-document file://aws-ebs-csi-driver-trust-policy.json --description "irsa role for ${TEST_CLUSTER_NAME}"
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy --role-name ${rolename}
kubectl annotate serviceaccount -n $namespace $service_account eks.amazonaws.com/role-arn=arn:aws:iam::$account_id:role/${rolename}
eksctl create addon --name aws-ebs-csi-driver --cluster ${TEST_CLUSTER_NAME} --service-account-role-arn arn:aws:iam::$account_id:role/${rolename} --force
else
echo "Retrieving kubeconfig for ${TEST_CLUSTER_NAME}"
# Cluster exists but kubeconfig may not
Expand All @@ -72,4 +104,4 @@ function createCluster() {
# Output
echo "EKS cluster nodes:"
eksctl get cluster --name=${TEST_CLUSTER_NAME}
}
}
2 changes: 1 addition & 1 deletion test/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
: "${ECR_REGISTRY:=}"
: "${VPC_PUBLIC_SUBNET_STRING:=}"
: "${VPC_PRIVATE_SUBNET_STRING:=}"
: "${EKS_CLUSTER_K8_VERSION:=1.22}"
: "${EKS_CLUSTER_K8_VERSION:=1.26}"
# Below env variables required to run license master test cases
: "${ENTERPRISE_LICENSE_S3_PATH:=}"
: "${TEST_S3_BUCKET:=}"
Expand Down

0 comments on commit 7384961

Please sign in to comment.