Skip to content

Commit

Permalink
CLIP-1587: Fix the Invalid apiVersion problem (#240)
Browse files Browse the repository at this point in the history
* CLIP-1587: Changed client.authentication.k8s.io/v1alpha1 to client.authentication.k8s.io/v1beta1

* CLIP-1587: Updated the prequisites documentation.

* CLIP-1587: Upgraded kubectl version to 1.24.0

* CLIP-1587: replaced apiVersion in context file used by e2e tests.

* Updated the changelog

* CLIP-1587: fixed the nfs connectivity test for bitbucket.

* CLIP-1590: Upgraded helm chart versions to 1.4.0 (#239)

Co-authored-by: nghazalibeiklar <[email protected]>

Co-authored-by: nghazalibeiklar <[email protected]>
  • Loading branch information
nghazali and nghazali authored Jun 30, 2022
1 parent 0bd5b5f commit b16ecd5
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-no-domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Pin Kubectl version
uses: azure/[email protected]
with:
version: 'v1.23.6'
version: 'v1.24.0'

- name: Setup Go environment
uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-with-domain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Pin Kubectl version
uses: azure/[email protected]
with:
version: 'v1.23.6'
version: 'v1.24.0'

- name: Setup Go environment
uses: actions/[email protected]
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 2.0.2

**Release date:** 2022-06-30

* Upgraded Helm chart version to 1.4.0
* Using v1beta1 apiVersion for client.authentication.k8s.io


## 2.0.1

**Release date:** 2022-05-18
Expand Down
10 changes: 5 additions & 5 deletions config.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ max_cluster_capacity = 5
################################################################################

# Helm chart version of Jira
jira_helm_chart_version = "1.3.0"
jira_helm_chart_version = "1.4.0"

# Number of Jira application nodes
# Note: For initial installation this value needs to be set to 1 and it can be changed only after Jira is fully
Expand Down Expand Up @@ -125,7 +125,7 @@ jira_db_name = "jira"
################################################################################

# Helm chart version of Confluence
confluence_helm_chart_version = "1.3.0"
confluence_helm_chart_version = "1.4.0"

# Number of Confluence application nodes
# Note: For initial installation this value needs to be set to 1 and it can be changed only after Confluence is fully
Expand Down Expand Up @@ -205,7 +205,7 @@ confluence_collaborative_editing_enabled = true
################################################################################

# Helm chart version of Bitbucket
bitbucket_helm_chart_version = "1.3.0"
bitbucket_helm_chart_version = "1.4.0"

# Number of Bitbucket application nodes
bitbucket_replica_count = 1
Expand Down Expand Up @@ -304,8 +304,8 @@ bitbucket_db_name = "bitbucket"
################################################################################

# Helm chart version of Bamboo and Bamboo agent instances
bamboo_helm_chart_version = "1.3.0"
bamboo_agent_helm_chart_version = "1.3.0"
bamboo_helm_chart_version = "1.4.0"
bamboo_agent_helm_chart_version = "1.4.0"

# By default, Bamboo and the Bamboo Agent will use the versions defined in their respective Helm charts:
# https://github.com/atlassian/data-center-helm-charts/blob/main/src/main/charts/bamboo/Chart.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/userguide/PREREQUISITES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Its advised that the tooling below is installed to your development environment.

1. [Terraform](#terraform)
2. [Helm v3.3 or later](#helm)
3. [AWS CLI](#aws-cli)
3. [AWS CLI v2.7 or later](#aws-cli)
4. [Kubectl](#kubectl) (optional)
5. [Kubernetes cluster monitoring tools](#kubernetes-cluster-monitoring-tools) (optional)

Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ set_current_context_k8s() {
if [ -z "${FORCE_FLAG}" ]; then
aws --region "${REGION}" eks update-kubeconfig --name "${EKS_CLUSTER}"
fi
# e2e test uses context file to connect to k8s and since aws-iam-authenticator 0.5.5 is using v1beta1 api version
# for authentication, then we need to switch to v1beta1
sed 's/client.authentication.k8s.io\/v1alpha1/client.authentication.k8s.io\/v1beta1/g' "${CONTEXT_FILE}" > tmp && mv tmp "${CONTEXT_FILE}"
else
log "Kubernetes context file '${CONTEXT_FILE}' could not be found."
fi
Expand Down
4 changes: 2 additions & 2 deletions providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provider "kubernetes" {
host = module.base-infrastructure.eks.kubernetes_provider_config.host
cluster_ca_certificate = module.base-infrastructure.eks.kubernetes_provider_config.cluster_ca_certificate
exec {
api_version = "client.authentication.k8s.io/v1alpha1"
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", local.cluster_name]
command = "aws"
}
Expand All @@ -23,7 +23,7 @@ provider "helm" {
host = module.base-infrastructure.eks.kubernetes_provider_config.host
cluster_ca_certificate = module.base-infrastructure.eks.kubernetes_provider_config.cluster_ca_certificate
exec {
api_version = "client.authentication.k8s.io/v1alpha1"
api_version = "client.authentication.k8s.io/v1beta1"
args = ["eks", "get-token", "--cluster-name", local.cluster_name]
command = "aws"
}
Expand Down
14 changes: 3 additions & 11 deletions test/e2etest/bitbucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
"github.com/gruntwork-io/terratest/modules/k8s"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -44,11 +44,7 @@ func assertBitbucketNfsConnectivity(t *testing.T, testConfig TestConfig) {
"-c", "echo \"Greetings from an NFS\" >> $(find /srv/nfs/ | head -1)/nfs-file-share-test.txt; echo $?")

assert.Nil(t, kubectlError)
// Due to the deprecation of v1alpha1, there will be an extra line added to kubectl output:
// Kubeconfig user entry is using deprecated API version client.authentication.k8s.io/v1alpha1. Run 'aws eks update-kubeconfig' to update.\n0
outputSlice := strings.Split(output, "\n")
returnCode := outputSlice[1]
assert.Equal(t, "0", returnCode)
assert.Equal(t, "0", output)

// Read the file from the Bitbucket pod
output, kubectlError = k8s.RunKubectlAndGetOutputE(t, kubectlOptions,
Expand All @@ -58,11 +54,7 @@ func assertBitbucketNfsConnectivity(t *testing.T, testConfig TestConfig) {
"-c", "cat /var/atlassian/application-data/shared-home/nfs-file-share-test.txt")

assert.Nil(t, kubectlError)
// Due to the deprecation of v1alpha1, there will be an extra line added to kubectl output:
// Kubeconfig user entry is using deprecated API version client.authentication.k8s.io/v1alpha1. Run 'aws eks update-kubeconfig' to update.\nGreetings from an NFS
outputSlice = strings.Split(output, "\n")
fileContents := outputSlice[1]
assert.Equal(t, "Greetings from an NFS", fileContents)
assert.Equal(t, "Greetings from an NFS", output)
}

func assertBitbucketSshConnectivity(t *testing.T, testConfig TestConfig, productUrl string) {
Expand Down
2 changes: 1 addition & 1 deletion test/unittest/test_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ var BitbucketInvalidVariables = map[string]interface{}{
"replica_count": 1,
"installation_timeout": invalidTestTimeout,
"bitbucket_configuration": map[string]interface{}{
"helm_version": "1.3.0",
"helm_version": "1.4.0",
"cpu": "1",
"mem": "1Gi",
"min_heap": "256m",
Expand Down
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ variable "logging_bucket" {
variable "jira_helm_chart_version" {
description = "Version of Jira Helm chart"
type = string
default = "1.3.0"
default = "1.4.0"
}

variable "jira_image_repository" {
Expand Down Expand Up @@ -293,7 +293,7 @@ variable "confluence_license" {
variable "confluence_helm_chart_version" {
description = "Version of confluence Helm chart"
type = string
default = "1.3.0"
default = "1.4.0"
}

variable "confluence_version_tag" {
Expand Down Expand Up @@ -457,7 +457,7 @@ variable "confluence_shared_home_snapshot_id" {
variable "bitbucket_helm_chart_version" {
description = "Version of Bitbucket Helm chart"
type = string
default = "1.3.0"
default = "1.4.0"
}

variable "bitbucket_version_tag" {
Expand Down Expand Up @@ -726,14 +726,14 @@ variable "number_of_bamboo_agents" {

variable "bamboo_helm_chart_version" {
description = "Version of Bamboo Helm chart"
default = "1.3.0"
default = "1.4.0"
type = string
}

variable "bamboo_agent_helm_chart_version" {
description = "Version of Bamboo agent Helm chart"
type = string
default = "1.3.0"
default = "1.4.0"
}

variable "bamboo_version_tag" {
Expand Down

0 comments on commit b16ecd5

Please sign in to comment.