Skip to content

Commit

Permalink
Merge branch 'main' into kots-upgrader
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Jul 11, 2024
2 parents f591401 + 9c4f5d5 commit 691e025
Show file tree
Hide file tree
Showing 32 changed files with 279 additions and 211 deletions.
1 change: 1 addition & 0 deletions .github/actions/kots-e2e/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ runs:
KOTS_DOCKERHUB_PASSWORD=${{ inputs.kots-dockerhub-password }} \
AIRGAP=${{ inputs.kots-airgap }} \
IS_OPENSHIFT=${{ inputs.k8s-distribution == 'openshift' && 'true' || 'false' }} \
IS_EKS=${{ inputs.k8s-distribution == 'eks' && 'true' || 'false' }} \
SKIP_TEARDOWN=1
shell: bash

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,8 @@ jobs:
--shared-password password \
--kotsadm-registry ttl.sh \
--kotsadm-namespace automated-${{ github.run_id }} \
--kotsadm-tag 24h
--kotsadm-tag 24h \
--storage-class=${{ matrix.cluster.distribution == 'eks' && 'gp2' || '' }}
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main

permissions:
contents: write

jobs:
generate-tag:
runs-on: ubuntu-20.04
Expand Down
8 changes: 4 additions & 4 deletions .image.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated file, do not modify. This file is generated from a text file containing a list of images. The
# most recent tag is interpolated from the source repository and used to generate a fully qualified image
# name.
MINIO_TAG='0.20240626.010618-r0'
RQLITE_TAG='8.26.2-r0'
DEX_TAG='2.40.0-r1'
MINIO_TAG='0.20240710.184149-r0'
RQLITE_TAG='8.26.6-r1'
DEX_TAG='2.40.0-r3'
SCHEMAHERO_TAG='0.17.9'
LVP_TAG='v0.6.6'
LVP_TAG='v0.6.7'
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include Makefile.build.mk
CURRENT_USER := $(if $(GITHUB_USER),$(GITHUB_USER),$(shell id -u -n))
MINIO_TAG ?= 0.20240626.010618-r0
RQLITE_TAG ?= 8.26.2-r0
DEX_TAG ?= 2.40.0-r1
LVP_TAG ?= v0.6.6
MINIO_TAG ?= 0.20240710.184149-r0
RQLITE_TAG ?= 8.26.6-r1
DEX_TAG ?= 2.40.0-r3
LVP_TAG ?= v0.6.7

define sendMetrics
@if [ -z "${PROJECT_NAME}" ]; then \
Expand Down
2 changes: 2 additions & 0 deletions cmd/kots/cli/admin-console-generate-manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func AdminGenerateManifestsCmd() *cobra.Command {
options := upstreamtypes.WriteOptions{
Namespace: namespace,
SharedPassword: v.GetString("shared-password"),
StorageClassName: v.GetString("storage-class"),
HTTPProxyEnvValue: v.GetString("http-proxy"),
HTTPSProxyEnvValue: v.GetString("https-proxy"),
NoProxyEnvValue: v.GetString("no-proxy"),
Expand Down Expand Up @@ -98,6 +99,7 @@ func AdminGenerateManifestsCmd() *cobra.Command {
}

cmd.Flags().String("rootdir", ".", "root directory that will be used to write the yaml to")
cmd.Flags().String("storage-class", "", "sets the storage class to use for the KOTS Admin Console components (if unset, the default storage class will be used)")
cmd.Flags().String("http-proxy", "", "sets HTTP_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("https-proxy", "", "sets HTTPS_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("no-proxy", "", "sets NO_PROXY environment variable in all KOTS Admin Console components")
Expand Down
4 changes: 2 additions & 2 deletions cmd/kots/cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func InstallCmd() *cobra.Command {
Airgap: isAirgap,
ProgressWriter: os.Stdout,
Timeout: time.Minute * 2,
StorageClassName: v.GetString("storage-class"),
HTTPProxyEnvValue: v.GetString("http-proxy"),
HTTPSProxyEnvValue: v.GetString("https-proxy"),
NoProxyEnvValue: v.GetString("no-proxy"),
Expand Down Expand Up @@ -504,6 +505,7 @@ func InstallCmd() *cobra.Command {
cmd.Flags().Int("port", 8800, "local port to listen on when port forwarding is enabled")
cmd.Flags().String("wait-duration", "2m", "timeout to be used while waiting for individual components to be ready. must be in Go duration format (eg: 10s, 2m)")
cmd.Flags().String("preflights-wait-duration", "15m", "timeout to be used while waiting for preflights to complete. must be in Go duration format (eg: 10s, 2m)")
cmd.Flags().String("storage-class", "", "sets the storage class to use for the KOTS Admin Console components (if unset, the default storage class will be used)")
cmd.Flags().String("http-proxy", "", "sets HTTP_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("https-proxy", "", "sets HTTPS_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("no-proxy", "", "sets NO_PROXY environment variable in all KOTS Admin Console components")
Expand All @@ -518,8 +520,6 @@ func InstallCmd() *cobra.Command {
cmd.Flags().String("app-version-label", "", "the application version label to install. if not specified, the latest version will be installed")
cmd.Flags().Bool("exclude-admin-console", false, "set to true to exclude the admin console and only install the application")

cmd.Flags().String("repo", "", "repo uri to use when installing a helm chart")

registryFlags(cmd.Flags())

// the following group of flags are experiemental and can be used to pull and push images during install time
Expand Down
2 changes: 2 additions & 0 deletions cmd/kots/cli/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func PullCmd() *cobra.Command {
Username: v.GetString("registry-username"),
Password: v.GetString("registry-password"),
},
StorageClassName: v.GetString("storage-class"),
HTTPProxyEnvValue: v.GetString("http-proxy"),
HTTPSProxyEnvValue: v.GetString("https-proxy"),
NoProxyEnvValue: v.GetString("no-proxy"),
Expand Down Expand Up @@ -127,6 +128,7 @@ func PullCmd() *cobra.Command {
cmd.Flags().Bool("exclude-kots-kinds", true, "set to true to exclude rendering kots custom objects to the base directory")
cmd.Flags().Bool("exclude-admin-console", false, "set to true to exclude the admin console (replicated apps only)")
cmd.Flags().String("shared-password", "", "shared password to use when deploying the admin console")
cmd.Flags().String("storage-class", "", "sets the storage class to use for the KOTS Admin Console components (if unset, the default storage class will be used)")
cmd.Flags().String("http-proxy", "", "sets HTTP_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("https-proxy", "", "sets HTTPS_PROXY environment variable in all KOTS Admin Console components")
cmd.Flags().String("no-proxy", "", "sets NO_PROXY environment variable in all KOTS Admin Console components")
Expand Down
2 changes: 2 additions & 0 deletions e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test: KOTSADM_IMAGE_TAG ?= alpha
test: TESTIM_BRANCH ?= master
test: AIRGAP ?= 0
test: IS_OPENSHIFT ?= 0
test: IS_EKS ?= 0
test: SKIP_TEARDOWN ?= 0
ifneq ($(EXISTING_KUBECONFIG),)
test: EXISTING_KUBECONFIG_VOLUME_MOUNT := "-v=$(EXISTING_KUBECONFIG):$(EXISTING_KUBECONFIG)"
Expand All @@ -48,6 +49,7 @@ test:
--kotsadm-image-tag=$(KOTSADM_IMAGE_TAG) \
--airgap=$(AIRGAP) \
--is-openshift=$(IS_OPENSHIFT) \
--is-eks=$(IS_EKS) \
--kots-helm-chart-url=$(KOTS_HELM_CHART_URL) \
--kots-helm-chart-version=$(KOTS_HELM_CHART_VERSION) \
--kots-dockerhub-username=$(KOTS_DOCKERHUB_USERNAME) \
Expand Down
4 changes: 3 additions & 1 deletion e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var (
kotsadmImageTag string
airgap bool
isOpenShift bool
isEKS bool
kotsadmForwardPort string
kotsHelmChartURL string
kotsHelmChartVersion string
Expand All @@ -61,6 +62,7 @@ func init() {
flag.StringVar(&kotsadmImageTag, "kotsadm-image-tag", "alpha", "override the kotsadm images tag")
flag.BoolVar(&airgap, "airgap", false, "run install in airgapped mode")
flag.BoolVar(&isOpenShift, "is-openshift", false, "the cluster is an openshift cluster")
flag.BoolVar(&isEKS, "is-eks", false, "the cluster is an eks cluster")
flag.StringVar(&kotsadmForwardPort, "kotsadm-forward-port", "", "sets the port that the admin console will be exposed on instead of generating a random one")
flag.StringVar(&kotsHelmChartURL, "kots-helm-chart-url", "", "kots helm chart url")
flag.StringVar(&kotsHelmChartVersion, "kots-helm-chart-version", "", "kots helm chart version")
Expand Down Expand Up @@ -96,7 +98,7 @@ var _ = BeforeSuite(func() {

veleroCLI = velero.NewCLI(w.GetDir(), isOpenShift)

kotsInstaller = kots.NewInstaller(kotsadmImageRegistry, kotsadmImageNamespace, kotsadmImageTag, airgap, kotsDockerhubUsername, kotsDockerhubPassword)
kotsInstaller = kots.NewInstaller(kotsadmImageRegistry, kotsadmImageNamespace, kotsadmImageTag, airgap, kotsDockerhubUsername, kotsDockerhubPassword, isEKS)
})

var _ = AfterSuite(func() {
Expand Down
7 changes: 6 additions & 1 deletion e2e/kots/kots.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ type Installer struct {
airgap bool
dockerhubUsername string
dockerhubPassword string
isEKS bool
}

func NewInstaller(imageRegistry, imageNamespace, imageTag string, airgap bool, dockerhubUsername string, dockerhubPassword string) *Installer {
func NewInstaller(imageRegistry, imageNamespace, imageTag string, airgap bool, dockerhubUsername string, dockerhubPassword string, isEKS bool) *Installer {
return &Installer{
imageRegistry: imageRegistry,
imageNamespace: imageNamespace,
imageTag: imageTag,
airgap: airgap,
dockerhubUsername: dockerhubUsername,
dockerhubPassword: dockerhubPassword,
isEKS: isEKS,
}
}

Expand Down Expand Up @@ -100,6 +102,9 @@ func (i *Installer) install(kubeconfig string, test inventory.Test) (*gexec.Sess
fmt.Sprintf("--use-minimal-rbac=%t", test.UseMinimalRBAC),
fmt.Sprintf("--skip-compatibility-check=%t", test.SkipCompatibilityCheck),
}
if i.isEKS {
args = append(args, "--storage-class=gp2")
}

return util.RunCommand(exec.Command("kots", args...))
}
Expand Down
30 changes: 15 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/Masterminds/sprig/v3 v3.2.3
github.com/ahmetalpbalkan/go-cursor v0.0.0-20131010032410-8136607ea412
github.com/aws/aws-sdk-go v1.54.6
github.com/bitnami-labs/sealed-secrets v0.24.5
github.com/aws/aws-sdk-go v1.54.15
github.com/bitnami-labs/sealed-secrets v0.27.0
github.com/blang/semver v3.5.1+incompatible
github.com/containers/image/v5 v5.31.0
github.com/containers/image/v5 v5.31.1
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/distribution/distribution/v3 v3.0.0-alpha.1
github.com/distribution/reference v0.6.0
Expand All @@ -40,7 +40,7 @@ require (
github.com/mholt/archiver/v3 v3.5.1
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
github.com/mitchellh/hashstructure v1.1.0
github.com/onsi/ginkgo/v2 v2.17.3
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/open-policy-agent/opa v0.65.0
github.com/opencontainers/image-spec v1.1.0
Expand All @@ -49,7 +49,7 @@ require (
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/replicatedhq/embedded-cluster-kinds v1.3.10
github.com/replicatedhq/embedded-cluster-kinds v1.4.4
github.com/replicatedhq/kotskinds v0.0.0-20240621084729-1eb1e3eac6f2
github.com/replicatedhq/kurlkinds v1.5.0
github.com/replicatedhq/troubleshoot v0.93.2
Expand Down Expand Up @@ -85,7 +85,7 @@ require (
k8s.io/helm v2.17.0+incompatible
k8s.io/kubelet v0.30.2
k8s.io/metrics v0.30.2
k8s.io/utils v0.0.0-20230726121419-3b25d923346b
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0
oras.land/oras-go/v2 v2.5.0
sigs.k8s.io/application v0.8.3
sigs.k8s.io/controller-runtime v0.18.4
Expand Down Expand Up @@ -143,7 +143,7 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/bshuster-repo/logrus-logstash-hook v1.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
Expand All @@ -169,7 +169,7 @@ require (
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
Expand Down Expand Up @@ -274,7 +274,7 @@ require (
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mkmik/multierror v0.3.0 // indirect
github.com/mkmik/multierror v0.4.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/moby/sys/mountinfo v0.7.1 // indirect
Expand Down Expand Up @@ -302,8 +302,8 @@ require (
github.com/proglottis/gpgme v0.1.3 // indirect
github.com/prometheus/client_golang v1.19.1 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.51.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.15.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect
Expand Down Expand Up @@ -376,8 +376,8 @@ require (
google.golang.org/genproto v0.0.0-20240311173647-c811ad7063a7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240415180920-8c6c420018be // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/evanphx/json-patch.v5 v5.6.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
Expand All @@ -386,8 +386,8 @@ require (
k8s.io/apiextensions-apiserver v0.30.1 // indirect
k8s.io/apiserver v0.30.2 // indirect
k8s.io/component-base v0.30.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/klog/v2 v2.130.0 // indirect
k8s.io/kube-openapi v0.0.0-20240521193020-835d969ad83a // indirect
k8s.io/kubectl v0.30.0 // indirect
oras.land/oras-go v1.2.5 // indirect
periph.io/x/host/v3 v3.8.2 // indirect
Expand Down
Loading

0 comments on commit 691e025

Please sign in to comment.