Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
feat: Upgrade dependencies to Keptn 0.16 (#295)
Browse files Browse the repository at this point in the history
* feat: Upgrade dependencies to Keptn 0.16

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* tests: Update integration tests to be compatible with Keptn 0.16

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* deps: update go-utils

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* go mod tidy

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* added goproxy for faster execution of integration tests

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* Move to new install action and new git provisioenr

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>

* review comments

Signed-off-by: Christian Kreuzberger <christian.kreuzberger@dynatrace.com>
  • Loading branch information
christian-kreuzberger-dtx authored Jun 30, 2022
1 parent 5eb2fdb commit 7f71c62
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 70 deletions.
56 changes: 55 additions & 1 deletion .github/workflows/integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ jobs:
strategy:
fail-fast: false
matrix:
keptn-version: ["0.12.7", "0.13.5", "0.14.2", "0.15.0"] # https://github.com/keptn/keptn/releases
keptn-version: ["0.13.5", "0.14.2", "0.15.1", "0.16.0"] # https://github.com/keptn/keptn/releases
network-policy: [true, false]
job-network-policy: [true, false]
env:
GO_VERSION: 1.17
GOPROXY: "https://proxy.golang.org"
GO111MODULE: "on"
BRANCH: ${{ github.head_ref || github.ref_name }}
JES_E2E_TEST: true
JES_NAMESPACE: keptn-jes-e2e
GITEA_ADMIN_USERNAME: GiteaAdmin
GITEA_NAMESPACE: gitea
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
TEST_REPORT_FILENAME: test-report-${{ github.run_id }}-${{ matrix.keptn-version }}-netpolicy-${{matrix.network-policy}}-jobnetpolicy-${{matrix.job-network-policy}}.json
steps:
Expand Down Expand Up @@ -71,12 +74,60 @@ jobs:
done;
echo "K3s ready!!!"
- name: Generate Gitea credentials
id: gitea_credentials
run: |
password=$(date +%s | sha256sum | base64 | head -c 32)
echo "::add-mask::$password"
echo "::set-output name=GITEA_ADMIN_PASSWORD::$password"
- name: Install Gitea
id: gitea
env:
GITEA_ADMIN_PASSWORD: ${{ steps.gitea_credentials.outputs.GITEA_ADMIN_PASSWORD }}
run: |
export GITEA_ENDPOINT="http://gitea-http.${GITEA_NAMESPACE}:3000"
helm repo add gitea-charts https://dl.gitea.io/charts/
helm repo update
helm install -n ${GITEA_NAMESPACE} gitea gitea-charts/gitea \
--create-namespace \
--set memcached.enabled=false \
--set postgresql.enabled=false \
--set gitea.config.database.DB_TYPE=sqlite3 \
--set gitea.admin.username=${GITEA_ADMIN_USERNAME} \
--set gitea.admin.password=${GITEA_ADMIN_PASSWORD} \
--set gitea.config.server.OFFLINE_MODE=true \
--set gitea.config.server.ROOT_URL=${GITEA_ENDPOINT}/ \
--wait
# Export Gitea connection details
echo "::set-output name=GITEA_ENDPOINT::${GITEA_ENDPOINT}"
- name: Install gitea provisioner-service
env:
GITEA_ADMIN_PASSWORD: ${{ steps.gitea_credentials.outputs.GITEA_ADMIN_PASSWORD }}
GITEA_ENDPOINT: ${{ steps.gitea.outputs.GITEA_ENDPOINT }}
run: |
helm install keptn-gitea-provisioner-service https://github.com/keptn-sandbox/keptn-gitea-provisioner-service/releases/download/0.1.0/keptn-gitea-provisioner-service-0.1.0.tgz \
--set gitea.endpoint=${GITEA_ENDPOINT} \
--set gitea.admin.create=true \
--set gitea.admin.username=${GITEA_ADMIN_USERNAME} \
--set gitea.admin.password=${GITEA_ADMIN_PASSWORD} \
--wait
- name: Install Keptn
id: install_keptn
uses: keptn-sandbox/action-install-keptn@v2.0.0
timeout-minutes: 5
with:
KEPTN_VERSION: ${{ matrix.keptn-version }}
HELM_VALUES: |
control-plane:
apiGatewayNginx:
type: LoadBalancer
features:
automaticProvisioningURL: http://keptn-gitea-provisioner-service.default
KUBECONFIG: ${{ env.KUBECONFIG }}

- name: Test connection to keptn
Expand Down Expand Up @@ -131,6 +182,9 @@ jobs:
kubectl get configmaps,deployments,pods,networkpolicy,serviceaccounts,role,rolebindings,events -n ${JES_NAMESPACE} -o json > k8s_debug/k8s_jes_objects.json
kubectl logs -n keptn -l app.kubernetes.io/instance=keptn --prefix=true --previous=false --all-containers > k8s_debug/k8s_keptn_logs.txt || true
kubectl logs -n ${JES_NAMESPACE} deployment/job-executor-service --prefix=true --previous=false --all-containers > k8s_debug/k8s_jes_logs.txt || true
kubectl logs deployment/keptn-gitea-provisioner-service --prefix=true --previous=false --all-containers > k8s_debug/k8s_gitea_provisioner_logs.txt || true
kubectl get statefulsets,configmaps,pods,networkpolicy,serviceaccounts,role,rolebindings,events,services -n ${GITEA_NAMESPACE} -o json > k8s_debug/k8s_objects_gitea.json
kubectl logs statefulsets/gitea --prefix=true --previous=false --all-containers -n ${GITEA_NAMESPACE} > k8s_debug/k8s_logs_gitea.txt || true
# Upload the k8s debug archive, so we can use it for investigating
- name: Upload k8s debug archive
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ running in the Keptn ecosystem:
| 0.13.x | keptncontrib/job-executor-service:0.2.0 | v2 |
| 0.14.x | keptncontrib/job-executor-service:0.2.1 | v2 |
| 0.15.x | keptncontrib/job-executor-service:0.2.2 | v2 |
| 0.16.x | keptncontrib/job-executor-service:0.2.3 | v2 |

**Please Note**:
- Newer Keptn versions might be compatible, but compatibility has not been verified at the time of the release.
- If you are installing JES in the same namespace as Keptn, versions compatible with Keptn 0.14.x and newer will not be backward compatible due to a change in NATS cluster name
(see https://github.com/keptn/keptn/releases/tag/0.14.1 for more info about the breaking change).
- The JES version 0.2.2 is currently not compatible with Keptn 0.16.0
- Job-Executor-Service version 0.2.2 and older are currently not compatible with Keptn 0.16.0 (caused by [keptn/keptn#8160](https://github.com/keptn/keptn/issues/8160))

**Warning**: We are aware that there might be a problem when trying to install Job-Executor-Service in the same namespace as Keptn 0.14.x.
For now, we advise to install Job-Executor-Service in a separate namespace, and set `remoteControlPlane.api.hostname`, `remoteControlPlane.api.token`, ... as detailed in the
Expand Down
4 changes: 2 additions & 2 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ distributor:
image:
repository: docker.io/keptn/distributor # Container Image Name
pullPolicy: IfNotPresent # Kubernetes Image Pull Policy
tag: "0.15.1" # Container Tag
tag: "0.16.0" # Container Tag
config:
queueGroup:
enabled: true # Enable connection via Nats queue group to support exactly-once message processing
Expand Down Expand Up @@ -143,4 +143,4 @@ networkPolicy:
egress:
enabled: false
k8sMasterCIDR: ""
k8sMasterPort: 0
k8sMasterPort: 0
26 changes: 10 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/gobwas/glob v0.2.3
github.com/golang/mock v1.6.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/keptn/go-utils v0.15.1
github.com/keptn/go-utils v0.16.1-0.20220624075633-4d49101f88b4
github.com/keptn/kubernetes-utils v0.14.0
github.com/mitchellh/mapstructure v1.5.0
github.com/spf13/afero v1.8.2
Expand All @@ -18,9 +18,9 @@ require (
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1 // indirect; pin v3.0.1 >= because of CVE-2022-28948
k8s.io/api v0.24.1
k8s.io/apimachinery v0.24.1
k8s.io/client-go v0.24.1
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
)

require (
Expand All @@ -44,18 +44,18 @@ require (
github.com/emicklei/go-restful v2.9.5+incompatible // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/huandu/xstrings v1.3.1 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
Expand All @@ -77,24 +77,18 @@ require (
go.opentelemetry.io/otel/internal/metric v0.25.0 // indirect
go.opentelemetry.io/otel/metric v0.25.0 // indirect
go.opentelemetry.io/otel/trace v1.2.0 // indirect
go.uber.org/atomic v1.5.0 // indirect
go.uber.org/multierr v1.3.0 // indirect
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee // indirect
go.uber.org/zap v1.13.0 // indirect
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
golang.org/x/mod v0.4.2 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
helm.sh/helm/v3 v3.6.1 // indirect
honnef.co/go/tools v0.0.1-2020.1.4 // indirect
k8s.io/apiextensions-apiserver v0.21.0 // indirect
k8s.io/klog/v2 v2.60.1 // indirect
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect
Expand Down
Loading

0 comments on commit 7f71c62

Please sign in to comment.