-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working towards applying packages from a repository (#2686)
First steps (with lots of hard-coding and hacks) towards applying from a repository to a cluster.
- Loading branch information
Showing
8 changed files
with
1,064 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -ex | ||
|
||
kubectl apply -f - <<EOF | ||
apiVersion: porch.kpt.dev/v1alpha1 | ||
kind: PackageRevision | ||
metadata: | ||
namespace: default | ||
name: "deployment:myfirstnginx:v1" | ||
spec: | ||
packageName: myfirstnginx | ||
revision: v1 | ||
repository: deployment | ||
tasks: | ||
- type: clone | ||
clone: | ||
upstreamRef: | ||
type: git | ||
git: | ||
repo: https://github.com/GoogleContainerTools/kpt | ||
ref: v0.7 | ||
directory: package-examples/nginx | ||
EOF | ||
|
||
kubectl get packagerevision -n default deployment:myfirstnginx:v1 -oyaml | ||
|
||
kubectl get packagerevisionresources -n default deployment:myfirstnginx:v1 -oyaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: Repository | ||
metadata: | ||
name: deployment | ||
namespace: default | ||
spec: | ||
title: Deployment | ||
description: Deployment Repository for testing Porch. | ||
content: PackageRevision # TODO: Deployment or similar? | ||
type: oci | ||
oci: | ||
# Replace with your OCI repository. | ||
registry: us-west1-docker.pkg.dev/example-google-project-id/deployment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# GCP project to use for development | ||
GCP_PROJECT_ID ?= $(shell gcloud config get-value project) | ||
|
||
.PHONY: run-local | ||
run-local: | ||
GCP_PROJECT_ID=${GCP_PROJECT_ID} HACK_ENABLE_LOOPBACK=1 go run . |
26 changes: 26 additions & 0 deletions
26
porch/controllers/remoterootsync/config/samples/hack-self-apply.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
apiVersion: config.cloud.google.com/v1alpha1 | ||
kind: RemoteRootSyncSet | ||
metadata: | ||
name: loopback-apply | ||
namespace: default | ||
spec: | ||
clusterRefs: | ||
- apiVersion: container.cnrm.cloud.google.com/v1beta1 | ||
kind: ContainerCluster | ||
name: loopback! # TODO: This is a hack used during development, remove once we are more end-to-end enabled. | ||
template: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.