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

WIP: Instructions for developing with kind #3569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions porch/README.kind.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
```
kind create cluster
kind export kubeconfig
```


```
IMAGE_TAG=$(date +%Y%m%dT%H%M%S)
IMAGE_REPO=localkind IMAGE_TAG=${IMAGE_TAG} make build-images

# TODO: Do we need to load on Linux?
kind load docker-image localkind/porch-function-runner:${IMAGE_TAG}
kind load docker-image localkind/porch-controllers:${IMAGE_TAG}
kind load docker-image localkind/porch-wrapper-server:${IMAGE_TAG}
kind load docker-image localkind/porch-server:${IMAGE_TAG}
kind load docker-image localkind/test-git-server:${IMAGE_TAG}

IMAGE_REPO=localkind IMAGE_TAG=${IMAGE_TAG} make deploy-no-sa
```

```
cat ../e2e/testdata/porch/git-server.yaml | \
sed -e s/test-git-namespace/git-system/g |
sed -e s~GIT_SERVER_IMAGE~localkind/test-git-server:${IMAGE_TAG}~g |
kubectl apply -f -
```



```

kubectl apply -f - <<EOF
apiVersion: config.porch.kpt.dev/v1alpha1
kind: Repository
metadata:
name: blueprints
namespace: default
spec:
description: Blueprints Git Repository
content: Package
type: git
git:
repo: https://github.com/justinsb/kpt-samples
branch: packages
directory: ""
EOF

```


```

kubectl apply -f - <<EOF
apiVersion: config.porch.kpt.dev/v1alpha1
kind: Repository
metadata:
name: deployment
namespace: default
spec:
content: Package
deployment: true
description: 'Deployment Repository'
type: git
git:
branch: main-branch
createBranch: true
#directory: /
repo: http://git-server.git-system.svc.cluster.local:8080/deployment
EOF

```

```
kubectl config set-context $(kubectl config current-context) --namespace default
kubectl get packagerevision
kubectl get packagerevision --field-selector spec.packageName=echo
kubectl get packagerevision --field-selector spec.packageName=echo -oyaml

kubectl get packagerevisionresources
kubectl get packagerevisionresources --field-selector spec.packageName=echo
kubectl get packagerevisionresources --field-selector spec.packageName=echo -oyaml

```

```
kubectl apply -f - <<EOF
apiVersion: porch.kpt.dev/v1alpha1
kind: PackageRevision
metadata:
namespace: default
name: "deployment:external-secrets:v1"
spec:
packageName: external-secrets
revision: v1
repository: deployment
tasks:
- type: clone
clone:
upstreamRef:
type: git
git:
repo: https://github.com/justinsb/kpt-samples
ref: packages
directory: external-secrets
EOF

```

```

kubectl get packagerevision -n default --field-selector spec.packageName=external-secrets
kubectl get packagerevision -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment
kubectl get packagerevision -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment -oyaml

kubectl get packagerevisionresources -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment
kubectl get packagerevisionresources -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment -oyaml | less


```

kubectl apply -f - <<EOF
apiVersion: porch.kpt.dev/v1alpha1
kind: PackageRevision
metadata:
namespace: default
name: "deployment:external-secrets:v1"
spec:
packageName: external-secrets
revision: v1
repository: deployment
tasks:
- type: clone
clone:
upstreamRef:
type: git
git:
repo: https://github.com/justinsb/kpt-samples
ref: packages
directory: external-secrets
- type: eval
eval:
image: gcr.io/kpt-fn/set-labels:v0.1.5
configMap:
first-label: label-value
another-label: another-label-value
EOF

```

```
kubectl get packagerevision -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment
kubectl get packagerevision -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment -oyaml

kubectl get packagerevisionresources -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment
kubectl get packagerevisionresources -n default --field-selector spec.packageName=external-secrets --field-selector spec.repository=deployment -oyaml | less
```

# Reset procedure

```

k delete repository --all
k delete pod -n porch-system --all
k delete pod -n git-system --all

```