diff --git a/.github/workflows/busybox.yaml b/.github/workflows/busybox.yaml
deleted file mode 100644
index ada1a3d74..000000000
--- a/.github/workflows/busybox.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
-# A special manual workflow to push a busybox image into our public ecr registry. This image is used for the init helper containers
-name: Push busybox image to ecr
-on: workflow_dispatch
-
-
-jobs:
- release:
- name: Push busybox image to ecr
- runs-on: ubuntu-latest
- environment:
- name: k8s-operator
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
-
- - name: Pull and Push docker image
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd opensearch-operator
- export IMG=public.ecr.aws/opsterio/busybox:1.27.2-buildx
- echo $IMG
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/opsterio
- docker buildx build -f Dockerfile-busybox --platform="linux/amd64,linux/arm,linux/arm64" . -t $IMG --push
- cd ..
diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml
deleted file mode 100644
index f9d791d24..000000000
--- a/.github/workflows/prepare-release.yaml
+++ /dev/null
@@ -1,88 +0,0 @@
-name: Prepare and publish release
-on:
- workflow_dispatch:
- inputs:
- version:
- description: 'Version for the release, semver, NO "v" prefix'
- required: true
- type: string
-
-jobs:
- release:
- name: Prepare and publish release
- runs-on: ubuntu-latest
- environment:
- name: k8s-operator
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
- - name: Setup go
- uses: actions/setup-go@v3
- with:
- go-version: "1.19"
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v2
- - name: Run tests
- run: |
- # Run test suite to make sure we have a functional commit
- cd opensearch-operator
- make manifests test
- cd ..
- - name: Prepare helm chart
- run: |
- # Copy CRDs to chart to make sure they are identical
- cp opensearch-operator/config/crd/bases/opensearch.opster.io_*.yaml charts/opensearch-operator/files/
- # Set versions in helm chart
- sed -i -e 's/^appVersion:.*/appVersion: '$RELEASE_VERSION'/' charts/opensearch-operator/Chart.yaml
- sed -i -e 's/^version:.*/version: '$RELEASE_VERSION'/' charts/opensearch-operator/Chart.yaml
- sed -i -e 's/^appVersion:.*/appVersion: '$RELEASE_VERSION'/' charts/opensearch-cluster/Chart.yaml
- sed -i -e 's/^version:.*/version: '$RELEASE_VERSION'/' charts/opensearch-cluster/Chart.yaml
- # Commit changes
- git config user.name "$GITHUB_ACTOR"
- git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- git add charts
- if git commit -m "Prepare for release $RELEASE_VERSION"; then
- git push origin main
- fi
- # Create tag, this will not trigger the other release pipeline
- git tag v$RELEASE_VERSION
- git push --tags
- env:
- RELEASE_VERSION: ${{ inputs.version }}
-
- - name: Build and Push docker image
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- RELEASE_VERSION: ${{ inputs.version }}
- run: |
- cd opensearch-operator
- export IMG=public.ecr.aws/opsterio/opensearch-operator:$RELEASE_VERSION
- echo $IMG
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/opsterio
- docker buildx build -t $IMG --platform="linux/amd64,linux/arm,linux/arm64" . -f Dockerfile --push
- cd ..
-
- - name: Install Helm
- uses: azure/setup-helm@v1
- with:
- version: v3.8.1
-
- - name: Publish helm chart
- uses: stefanprodan/helm-gh-pages@master
- with:
- charts_dir: charts/
- token: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Create Release
- id: create_release
- uses: actions/create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: v${{ inputs.version }}
- release_name: ${{ inputs.version }}
- draft: true
- prerelease: false
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 295cc77f6..5f0873d76 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -2,7 +2,7 @@ name: "Publish Release from tag"
on:
push:
tags:
- - 'v*'
+ - '*'
jobs:
release:
runs-on: ubuntu-latest
@@ -21,36 +21,7 @@ jobs:
- name: set Env
id: github-ver
run: |
- echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
-
- - name: Build and Push operator docker image
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd opensearch-operator
- make test
- export IMG=public.ecr.aws/opensearch-project/opensearch-operator:$RELEASE_VERSION
- echo $IMG
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/opsterio
- docker buildx build -t $IMG --platform="linux/amd64,linux/arm,linux/arm64" . -f Dockerfile --push
- cd ..
-
- - name: Pull and Push operator busybox docker image
- env:
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd opensearch-operator
- export IMG=public.ecr.aws/opensearch-project/opensearch-operator-busybox:$RELEASE_VERSION
- echo $IMG
- aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/opsterio
- docker buildx build -f Dockerfile-busybox --platform="linux/amd64,linux/arm,linux/arm64" . -t $IMG --push
- cd ..
+ echo "RELEASE_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Make sure helm chart has correct versions
run: |
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index b563ab3ec..75553194a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -93,7 +93,7 @@ You may type this line on your own when writing your commit messages. However, i
## Review Process
-We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/Opster/opensearch-k8s-operator) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction.
+We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/opensearch-k8s-operator) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction.
During the PR process, expect that there will be some back-and-forth. Please try to respond to comments in a timely fashion, and if you don't wish to continue with the PR, let us know. If a PR takes too many iterations for its complexity or size, we may reject it. Additionally, if you stop responding we may close the PR as abandoned. In either case, if you feel this was done in error, please add a comment on the PR.
diff --git a/README.md b/README.md
index a5e81614a..9b7386f72 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-![build](https://github.com/opster/opensearch-k8s-operator/actions/workflows/docker-build.yaml/badge.svg) ![test](https://github.com/opster/opensearch-k8s-operator/actions/workflows/testing.yaml/badge.svg) ![release](https://img.shields.io/github/v/release/opster/opensearch-k8s-operator) [![Golang Lint](https://github.com/Opster/opensearch-k8s-operator/actions/workflows/linting.yaml/badge.svg)](https://github.com/Opster/opensearch-k8s-operator/actions/workflows/linting.yaml) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/opensearch-operator)](https://artifacthub.io/packages/search?repo=opensearch-operator)
+![build](https://github.com/opensearch-project/opensearch-k8s-operator/actions/workflows/docker-build.yaml/badge.svg) ![test](https://github.com/opensearch-project/opensearch-k8s-operator/actions/workflows/testing.yaml/badge.svg) ![release](https://img.shields.io/github/v/release/opster/opensearch-k8s-operator) [![Golang Lint](https://github.com/Opster/opensearch-k8s-operator/actions/workflows/linting.yaml/badge.svg)](https://github.com/Opster/opensearch-k8s-operator/actions/workflows/linting.yaml) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/opensearch-operator)](https://artifacthub.io/packages/search?repo=opensearch-operator)
# OpenSearch Kubernetes Operator
diff --git a/charts/opensearch-operator/CHANGELOG.md b/charts/opensearch-operator/CHANGELOG.md
index a8595e269..1866ab55f 100644
--- a/charts/opensearch-operator/CHANGELOG.md
+++ b/charts/opensearch-operator/CHANGELOG.md
@@ -55,7 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
-[Unreleased]: https://github.com/Opster/opensearch-k8s-operator/compare/opensearch-operator-2.0.0...HEAD
-[2.0.0]: https://github.com/Opster/opensearch-k8s-operator/compare/opensearch-operator-1.0.3...opensearch-operator-2.0.0
-[1.0.3]: https://github.com/Opster/opensearch-k8s-operator/compare/opensearch-operator-1.0.2...opensearch-operator-1.0.3
-[1.0.2]: https://github.com/Opster/opensearch-k8s-operator/compare/opensearch-operator-1.0.1...opensearch-operator-1.0.2
+[Unreleased]: https://github.com/opensearch-project/opensearch-k8s-operator/compare/opensearch-operator-2.0.0...HEAD
+[2.0.0]: https://github.com/opensearch-project/opensearch-k8s-operator/compare/opensearch-operator-1.0.3...opensearch-operator-2.0.0
+[1.0.3]: https://github.com/opensearch-project/opensearch-k8s-operator/compare/opensearch-operator-1.0.2...opensearch-operator-1.0.3
+[1.0.2]: https://github.com/opensearch-project/opensearch-k8s-operator/compare/opensearch-operator-1.0.1...opensearch-operator-1.0.2
diff --git a/charts/opensearch-operator/README.md b/charts/opensearch-operator/README.md
index f29734ca6..dc63c2504 100644
--- a/charts/opensearch-operator/README.md
+++ b/charts/opensearch-operator/README.md
@@ -1,16 +1,16 @@
# OpenSearch-k8s-operator
-The Kubernetes [OpenSearch Operator](https://github.com/Opster/opensearch-k8s-operator) is used for automating the deployment, provisioning, management, and orchestration of OpenSearch clusters and OpenSearch dashboards.
+The Kubernetes [OpenSearch Operator](https://github.com/opensearch-project/opensearch-k8s-operator) is used for automating the deployment, provisioning, management, and orchestration of OpenSearch clusters and OpenSearch dashboards.
## Getting started
-The Operator can be easily installed using helm on any CNCF-certified Kubernetes cluster. Please refer to the [User Guide](https://github.com/Opster/opensearch-k8s-operator/blob/main/docs/userguide/main.md) for more information.
+The Operator can be easily installed using helm on any CNCF-certified Kubernetes cluster. Please refer to the [User Guide](https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/userguide/main.md) for more information.
### Installation Using Helm
#### Get Repo Info
```
-helm repo add opensearch-operator https://opster.github.io/opensearch-k8s-operator/
+helm repo add opensearch-operator https://opensearch-project.github.io/opensearch-k8s-operator/
helm repo update
```
#### Install Chart
@@ -27,7 +27,3 @@ helm repo update
helm upgrade [RELEASE_NAME] opensearch-operator/opensearch-operator
```
-## Installation Tutorial and Demo
-
-[![Watch the video](https://opster.com/wp-content/uploads/2022/05/Operator-Installation-Tutorial.png)](https://player.vimeo.com/video/708641527)
-
diff --git a/docs/userguide/main.md b/docs/userguide/main.md
index 2ec4e55ad..031efdede 100644
--- a/docs/userguide/main.md
+++ b/docs/userguide/main.md
@@ -767,7 +767,7 @@ manager:
### Custom init helper
-During cluster initialization the operator uses init containers as helpers. For these containers a busybox image is used ( specifically `public.ecr.aws/opsterio/busybox:1.27.2-buildx`). In case you are working in an offline environment and the cluster cannot access the registry or you want to customize the image, you can override the image used by specifying the `initHelper` image in your cluster spec:
+During cluster initialization the operator uses init containers as helpers. For these containers a busybox image is used ( specifically `public.ecr.aws/opensearch-project/busybox:latest`). In case you are working in an offline environment and the cluster cannot access the registry or you want to customize the image, you can override the image used by specifying the `initHelper` image in your cluster spec:
```yaml
spec:
diff --git a/jenkins/release.jenkinsfile b/jenkins/release.jenkinsfile
index e4b6edd16..29c6be359 100644
--- a/jenkins/release.jenkinsfile
+++ b/jenkins/release.jenkinsfile
@@ -42,7 +42,6 @@ pipeline {
causeString: 'A commit was pushed on opensearch-project/opensearch-k8s-operator repository main branch causing this workflow to run',
printContributedVariables: false,
printPostContent: false,
- regexpFilterText: '$isTag',
)
}
environment {
@@ -55,7 +54,6 @@ pipeline {
steps {
script {
def ref_final = "${GIT_REFERENCE}"
- println("the ref_final was : ${ref_final}")
def ref_url = "${REPO_URL}/commit/${GIT_REFERENCE}"
if (env.USER_BUILD_CAUSE.equals('[]') && env.TIMER_BUILD_CAUSE.equals('[]')) {
ref_final = "${ref}"
@@ -89,15 +87,14 @@ pipeline {
string(name: 'DOCKER_BUILD_GIT_REPOSITORY', value: "${REPO_URL}"),
string(name: 'DOCKER_BUILD_GIT_REPOSITORY_REFERENCE', value: "${ref_final}"),
string(name: 'DOCKER_BUILD_SCRIPT_WITH_COMMANDS', value: [
- 'id',
- 'pwd',
'ls -l',
+ 'cd opensearch-operator',
[
'bash',
- 'scripts/build-image-multi-arch.sh',
+ '../scripts/build-image-multi-arch.sh',
"-v ${OPERATOR_VERSION}",
"-a 'x64,arm,arm64'",
- "-f opensearch-operator/Dockerfile-busybox",
+ "-f Dockerfile-busybox",
"-p ${OPERATOR_PRODUCT}"
].join(' ')
].join(' && ')),
@@ -121,5 +118,73 @@ pipeline {
}
}
}
+ stage('OpenSearch Operator') {
+ steps {
+ script {
+ def ref_final = "${GIT_REFERENCE}"
+ def ref_url = "${REPO_URL}/commit/${GIT_REFERENCE}"
+ if (env.USER_BUILD_CAUSE.equals('[]') && env.TIMER_BUILD_CAUSE.equals('[]')) {
+ ref_final = "${ref}"
+ ref_url = "${REPO_URL}/releases/tag/${ref}"
+ println("Triggered by GitHub: ${ref_url}")
+
+ currentBuild.description = """GitHub: ${ref_url}"""
+ }
+ else {
+ println("Triggered by User/Timer: ${ref_url}")
+ currentBuild.description = """User/Timer: ${ref_url}"""
+ }
+
+ if (ref_final == null || ref_final == '') {
+ currentBuild.result = 'ABORTED'
+ error("Missing git tag reference.")
+ }
+
+ echo("Git checkout ${REPO_URL} on ${ref_final} for opensearch-operator-busybox release")
+ checkout scm
+ sh("git checkout ${ref_final}")
+
+ def OPERATOR_PRODUCT = "opensearch-operator"
+ def OPERATOR_VERSION = "$ref_final"
+
+ echo("${OPERATOR_PRODUCT}: ${OPERATOR_VERSION}")
+
+ dockerBuild: {
+ build job: 'docker-build',
+ parameters: [
+ string(name: 'DOCKER_BUILD_GIT_REPOSITORY', value: "${REPO_URL}"),
+ string(name: 'DOCKER_BUILD_GIT_REPOSITORY_REFERENCE', value: "${ref_final}"),
+ string(name: 'DOCKER_BUILD_SCRIPT_WITH_COMMANDS', value: [
+ 'ls -l',
+ 'cd opensearch-operator',
+ [
+ 'bash',
+ '../scripts/build-image-multi-arch.sh',
+ "-v ${OPERATOR_VERSION}",
+ "-a 'x64,arm,arm64'",
+ "-f Dockerfile",
+ "-p ${OPERATOR_PRODUCT}"
+ ].join(' ')
+ ].join(' && ')),
+ ]
+ }
+ dockerPromotion: {
+ build job: 'docker-promotion',
+ parameters: [
+ string(name: 'SOURCE_IMAGES', value: '${OPERATOR_PRODUCT}:${OPERATOR_VERSION}'),
+ string(name: 'RELEASE_VERSION', value: "${OPERATOR_VERSION}"),
+ string(name: 'DOCKER_HUB_PROMOTE', value: true),
+ string(name: 'ECR_PROMOTE', value: true),
+ string(name: 'TAG_LATEST', value: true)
+ ]
+ }
+ }
+ }
+ post {
+ always {
+ cleanWs disableDeferredWipeout: true, deleteDirs: true
+ }
+ }
+ }
}
}
diff --git a/opensearch-operator/pkg/builders/cluster_test.go b/opensearch-operator/pkg/builders/cluster_test.go
index ae65e96d9..b1beaa64a 100644
--- a/opensearch-operator/pkg/builders/cluster_test.go
+++ b/opensearch-operator/pkg/builders/cluster_test.go
@@ -162,7 +162,7 @@ var _ = Describe("Builders", func() {
customRepository := "mycustomrepo.cr"
clusterObject.Spec.General.DefaultRepo = &customRepository
result := NewSTSForNodePool("foobar", &clusterObject, opsterv1.NodePool{}, "foobar", nil, nil, nil)
- Expect(result.Spec.Template.Spec.InitContainers[0].Image).To(Equal("mycustomrepo.cr/busybox:1.27.2"))
+ Expect(result.Spec.Template.Spec.InitContainers[0].Image).To(Equal("mycustomrepo.cr/opensearch-operator-busybox:latest"))
})
It("should use InitHelper.Image as InitHelper image if configured", func() {
clusterObject := ClusterDescWithVersion("2.2.1")
@@ -412,7 +412,7 @@ var _ = Describe("Builders", func() {
customRepository := "mycustomrepo.cr"
clusterObject.Spec.General.DefaultRepo = &customRepository
result := NewBootstrapPod(&clusterObject, nil, nil)
- Expect(result.Spec.InitContainers[0].Image).To(Equal("mycustomrepo.cr/busybox:1.27.2"))
+ Expect(result.Spec.InitContainers[0].Image).To(Equal("mycustomrepo.cr/opensearch-operator-busybox:latest"))
})
It("should apply the BootstrapNodeConfig to the env variables", func() {
diff --git a/scripts/build-image-multi-arch.sh b/scripts/build-image-multi-arch.sh
index 389f12772..a38338306 100644
--- a/scripts/build-image-multi-arch.sh
+++ b/scripts/build-image-multi-arch.sh
@@ -135,4 +135,4 @@ docker ps | grep $BUILDER_NAME
# Build multi-arch images
PLATFORMS=`echo "${ARCHITECTURE_ARRAY[@]/#/linux/}" | sed 's/x64/amd64/g;s/ /,/g'` && echo PLATFORMS $PLATFORMS
-docker buildx build --platform $PLATFORMS --build-arg VERSION=$VERSION --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` --build-arg NOTES=$NOTES -t pgodithi/opensearchproject/$PRODUCT:${VERSION} -f $DOCKERFILE . --push
+docker buildx build --platform $PLATFORMS --build-arg VERSION=$VERSION --build-arg BUILD_DATE=`date -u +%Y-%m-%dT%H:%M:%SZ` --build-arg NOTES=$NOTES -t opensearchstaging/$PRODUCT:${VERSION} -f $DOCKERFILE . --push