Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(init): space init fits for v1.7.0 with registry change and different pre-reqs #610

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

haarchri
Copy link
Member

Description of your changes

  • change default registry to xpkg.upbound.io/spaces-artifacts
  • use robot token for registry login
  • implement different prerequisits based on spaces version < v1.7.0-0

Fixes #

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

create kind cluster:

cat <<EOF | kind create cluster --wait 5m --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  kubeadmConfigPatches:
  - |
    kind: InitConfiguration
    nodeRegistration:
      kubeletExtraArgs:
        node-labels: "ingress-ready=true"
  extraPortMappings:
  - containerPort: 443
    hostPort: 443
    protocol: TCP
EOF

with v1.6.1 spaces version:

export UPBOUND_ACCOUNT=lbop
export SPACES_TOKEN_PATH="/Users/haarchri/Documents/xpkg-spaces/token.json"
export SPACES_VERSION="1.6.1"
up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
  --set "account=${UPBOUND_ACCOUNT}" --set "registry=xpkg.upbound.io/spaces-artifacts"
 INFO  Setting defaults for vanilla Kubernetes (type kind)
 WARNING  One or more required prerequisites are not installed:

❌ universal-crossplane
❌ provider-kubernetes
❌ provider-helm
❌ cert-manager
❌ ingress-nginx

Would you like to install them now? [y/N]: Yes

  ✓   [1/5]: Installing universal-crossplane                                                                                                                                                       
  ✓   [2/5]: Installing provider-kubernetes                                                                                                                                                        
  ✓   [3/5]: Installing provider-helm                                                                                                                                                              
  ✓   [4/5]: Installing cert-manager                                                                                                                                                               
  ✓   [5/5]: Installing ingress-nginx                                                                                                                                                              
 INFO  Required prerequisites met!
 INFO  Proceeding with Upbound Spaces installation...
  ✓   [1/3]: Creating pull secret upbound-pull-secret                                                                                                                                              
  ✓   [2/3]: Initializing Space components                                                                                                                                                         
  ✓   [3/3]: Starting Space Components                                                                                                                                                             
  🙌  Your Upbound Space is Ready!

  👀  Next Steps 👇

👉 Check out Upbound Spaces docs @ https://docs.upbound.io/concepts/upbound-spaces

with with v1.7.0-rc.0.221.gd1b9198d spaces version:

export UPBOUND_ACCOUNT=lbop
export SPACES_TOKEN_PATH="/Users/haarchri/Documents/xpkg-spaces/token.json"
export SPACES_VERSION="1.7.0-rc.0.221.gd1b9198d"
up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
  --set "account=${UPBOUND_ACCOUNT}" --set "registry=xpkg.upbound.io/spaces-artifacts"
 INFO  Setting defaults for vanilla Kubernetes (type kind)
 WARNING  One or more required prerequisites are not installed:

❌ cert-manager
❌ ingress-nginx

Would you like to install them now? [y/N]: Yes

  ✓   [1/2]: Installing cert-manager                                                                                                                                                               
  ✓   [2/2]: Installing ingress-nginx                                                                                                                                                              
 INFO  Required prerequisites met!
 INFO  Proceeding with Upbound Spaces installation...
  ✓   [1/3]: Creating pull secret upbound-pull-secret                                                                                                                                              
  ✓   [2/3]: Initializing Space components                                                                                                                                                         
  ✓   [3/3]: Starting Space Components                                                                                                                                                             
  🙌  Your Upbound Space is Ready!

  👀  Next Steps 👇

👉 Check out Upbound Spaces docs @ https://docs.upbound.io/concepts/upbound-spaces

few more tests:

export SPACES_VERSION="1.7.0"
up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
  --set "account=${UPBOUND_ACCOUNT}" --set "registry=xpkg.upbound.io/spaces-artifacts"
 INFO  Setting defaults for vanilla Kubernetes (type kind)
 WARNING  One or more required prerequisites are not installed:

❌ cert-manager
❌ ingress-nginx
export SPACES_VERSION="1.7.0-rc.1"
up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
  --set "account=${UPBOUND_ACCOUNT}" --set "registry=xpkg.upbound.io/spaces-artifacts"
 INFO  Setting defaults for vanilla Kubernetes (type kind)
 WARNING  One or more required prerequisites are not installed:

❌ cert-manager
❌ ingress-nginx

Would you like to install them now? [y/N]:

Would you like to install them now? [y/N]:

cmd/up/space/flags.go Outdated Show resolved Hide resolved
cmd/up/space/flags.go Outdated Show resolved Hide resolved
cmd/up/space/flags.go Show resolved Hide resolved
cmd/up/space/prerequisites/manager.go Outdated Show resolved Hide resolved
cmd/up/space/prerequisites/manager_test.go Outdated Show resolved Hide resolved
cmd/up/space/prerequisites/manager.go Show resolved Hide resolved
@haarchri
Copy link
Member Author

did a small check after review changes

export UPBOUND_ACCOUNT=lbop
export SPACES_TOKEN_PATH="/Users/haarchri/Documents/xpkg-spaces/xpkg-token.json"
export SPACES_VERSION="1.7.0-rc.0.223.gfdcfb1e7"

up space init --token-file="${SPACES_TOKEN_PATH}" "v${SPACES_VERSION}" \
  --set "account=${UPBOUND_ACCOUNT}"
 INFO  Setting defaults for vanilla Kubernetes (type kind)
 WARNING  One or more required prerequisites are not installed:

❌ cert-manager
❌ ingress-nginx

Would you like to install them now? [y/N]: Yes

  ✓   [1/2]: Installing cert-manager                                                                                                                                                    
  ✓   [2/2]: Installing ingress-nginx                                                                                                                                                   
 INFO  Required prerequisites met!
 INFO  Proceeding with Upbound Spaces installation...
  ✓   [1/3]: Creating pull secret upbound-pull-secret                                                                                                                                   
  ✓   [2/3]: Initializing Space components                                                                                                                                              
  ✓   [3/3]: Starting Space Componentss)                                                                                                                                                
  🙌  Your Upbound Space is Ready!

  👀  Next Steps 👇

👉 Check out Upbound Spaces docs @ https://docs.upbound.io/concepts/upbound-spaces

@haarchri haarchri merged commit 80b5274 into main Aug 26, 2024
7 checks passed
@haarchri haarchri deleted the feature/init-v170 branch August 26, 2024 11:48
sttts pushed a commit to sttts/upbound-up that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants