Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Revert "VZ-1104: Remove helm chart from verrazzano-operator repo (#98)…
Browse files Browse the repository at this point in the history
…" (#101)

This reverts commit 2e12526.
  • Loading branch information
kminder authored Aug 24, 2020
1 parent 2e12526 commit 69c02b0
Show file tree
Hide file tree
Showing 14 changed files with 1,589 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ pipeline {
sh """
cd ${GO_REPO_PATH}/verrazzano-operator
make push DOCKER_REPO=${env.DOCKER_REPO} DOCKER_NAMESPACE=${env.DOCKER_NAMESPACE} DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME} CREATE_LATEST_TAG=${CREATE_LATEST_TAG}
make chart-build DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME}
make chart-publish
"""
}
}
Expand Down
77 changes: 77 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,83 @@ k8s-deploy:
kubectl delete -f ${DIST_DIR}/manifests
kubectl apply -f ${DIST_DIR}/manifests

.PHONY chart-build:
chart-build: go-mod
echo "Creating helm chart archive."
rm -rf ${DIST_DIR}
mkdir ${DIST_DIR}
mkdir ${DIST_DIR}/charts
mkdir ${DIST_DIR}/crds
cp -r chart/Chart.yaml $(DIST_DIR)/
cp -r chart/templates $(DIST_DIR)/
cp -r vendor/${CRDGEN_PATH}/${CRD_PATH}/verrazzano.io_verrazzanobindings_crd.yaml ${DIST_DIR}/crds/verrazzano.io_verrazzanobindings_crd.yaml
cp -r vendor/${CRDGEN_PATH}/${CRD_PATH}/verrazzano.io_verrazzanomodels_crd.yaml ${DIST_DIR}/crds/verrazzano.io_verrazzanomodels_crd.yaml
cp -r vendor/${CRDGEN_PATH}/${CRD_PATH}/verrazzano.io_verrazzanomanagedclusters_crd.yaml ${DIST_DIR}/crds/verrazzano.io_verrazzanomanagedclusters_crd.yaml
cp -r chart/NOTES.txt $(DIST_DIR)/
cp -r chart/values.yaml $(DIST_DIR)/
# Fill in tag version that's being built
sed -i.bak -e "s/latest/${HELM_CHART_VERSION}/g" $(DIST_DIR)/Chart.yaml
sed -i.bak -e "s/OPERATOR_VERSION/${OPERATOR_VERSION}/g" -e "s/OPERATOR_IMAGE_NAME/${DOCKER_IMAGE_NAME}/g" $(DIST_DIR)/values.yaml

rm -rf archive
mkdir archive
tar cvzf archive/${HELM_CHART_ARCHIVE_NAME} -C ${DIST_DIR}/ .
mv archive/${HELM_CHART_ARCHIVE_NAME} ${DIST_DIR}/
rm -rf archive
echo "Helm chart archive created - ${HELM_CHART_ARCHIVE_NAME}."

.PHONY chart-publish:
chart-publish:
echo "Publishing Helm chart to OCI object storage"
export OCI_CLI_SUPPRESS_FILE_PERMISSIONS_WARNING=True
echo ${HELM_CHART_VERSION} > latest
helm repo index --url https://objectstorage.us-phoenix-1.oraclecloud.com/n/${DIST_OBJECT_STORE_NAMESPACE}/b/${DIST_OBJECT_STORE_BUCKET}/o/${HELM_CHART_VERSION}/ ${DIST_DIR}/
oci os object put --force --namespace ${DIST_OBJECT_STORE_NAMESPACE} -bn ${DIST_OBJECT_STORE_BUCKET} --name ${HELM_CHART_VERSION}/index.yaml --file ${DIST_DIR}/index.yaml
oci os object put --force --namespace ${DIST_OBJECT_STORE_NAMESPACE} -bn ${DIST_OBJECT_STORE_BUCKET} --name ${HELM_CHART_VERSION}/${HELM_CHART_ARCHIVE_NAME} --file ${DIST_DIR}/${HELM_CHART_ARCHIVE_NAME}
oci os object put --force --namespace ${DIST_OBJECT_STORE_NAMESPACE} -bn ${DIST_OBJECT_STORE_BUCKET} --name latest --file latest
echo "Published Helm chart to https://objectstorage.us-phoenix-1.oraclecloud.com/n/${DIST_OBJECT_STORE_NAMESPACE}/b/${DIST_OBJECT_STORE_BUCKET}/o/${HELM_CHART_VERSION}/${HELM_CHART_ARCHIVE_NAME}"

echo "Check and upload release assets to github."
@rm -rf response.txt
@curl -ksH "Authorization: token ${GITHUB_API_TOKEN}" "https://api.github.com/repos/verrazzano/verrazzano-operator/releases/tags/${HELM_CHART_VERSION}" -o response.txt
@while [ ! -f response.txt ]; do sleep 1; done;
@cat response.txt
@set -e; \
msg=$$(jq -r .message response.txt); \
if [ "$$msg" == "Not Found" ]; then \
echo "No release found associated with version ${HELM_CHART_VERSION}, skipping uploading release assets."; \
else \
id=$$(jq -r .id response.txt); \
if [ -z "$$id" ]; then \
echo "Error: Failed to get release id for tag: ${HELM_CHART_VERSION}."; \
exit 1; \
else \
existingAssetId=$$(jq -r '.assets[] | select(.name == ("${HELM_CHART_ARCHIVE_NAME}")) | .id' response.txt); \
if [ ! -z "$$existingAssetId" ]; then \
echo "Release asset with name ${HELM_CHART_ARCHIVE_NAME} already exists with ID $$existingAssetId for release ${HELM_CHART_VERSION}. Deleting..."; \
status=$$(curl -w '%{http_code}' -s -k -X DELETE -H "Authorization: token ${GITHUB_API_TOKEN}" "https://api.github.com/repos/verrazzano/verrazzano-operator/releases/assets/$$existingAssetId"); \
if [ "$$status" != "204" ]; then \
echo "Unable to delete existing asset with name ${HELM_CHART_ARCHIVE_NAME} for release ${HELM_CHART_VERSION}, invalid status ${status}, aborting.."; \
echo "$$status"; \
exit 1; \
fi; \
echo "Deleted asset with name ${HELM_CHART_ARCHIVE_NAME} for release ${HELM_CHART_VERSION}."; \
fi; \
echo "Uploading ${HELM_CHART_ARCHIVE_NAME} to release ${HELM_CHART_VERSION}."; \
status=$$(curl -s -o /dev/null -w '%{http_code}' --data-binary @"${DIST_DIR}/${HELM_CHART_ARCHIVE_NAME}" -H "Authorization: token ${GITHUB_API_TOKEN}" -H "Content-Type: application/octet-stream" "https://uploads.github.com/repos/verrazzano/verrazzano-operator/releases/$$id/assets?name=${HELM_CHART_ARCHIVE_NAME}"); \
if [ "$$status" != "201" ]; then \
echo "Unable to upload asset with name ${HELM_CHART_ARCHIVE_NAME} for release ${HELM_CHART_VERSION}, invalid status ${status}, aborting.."; \
echo "$$status"; \
exit 1; \
fi; \
echo "Uploaded ${HELM_CHART_ARCHIVE_NAME} to release ${HELM_CHART_VERSION}."; \
fi; \
fi; \
set +e

rm -rf response.txt
rm -rf ${DIST_DIR}

.PHONY release-version:
release-version:
@set -e; \
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,25 @@ should be installed on which VerrazzanoManagedCluster.
triggers a reprocessing of the owning VerrazzanoBinding. This causes any drift in expecting state to immediately
be fixed by the Verrazzano Operator.

## Verrazzano Helm Chart

The `chart` directory contains helm chart for Verrazzano that packages together the core elements that will be installed into the Verrazzano Management Cluster - micro operators,
verrazzano-operator, verrazzano-monitoring-operator, etc - into a single Helm chart.

### Chart Parameters

See `./chart/values.yaml` for the full list of configurable parameters that can be set using
`--set parameter=value` when installing the Helm chart.

### Chart helm repo

Helm charts for Verrazzano are published as release assets - see https://github.com/verrazzano/verrazzano-operator/releases for available releases.

## Release

A github release is created on every successful build on the master branch. The release version is obtained by incrementing the minor version of last release by 1. On a successful release, this repo
- publises a Docker image: `container-registry.oracle.com/verrazzano/verrazzano-operator:<release-version>`
- publishes a new version of verrazzano-helm-chart at `https://github.com/verrazzano/verrazzano-operator/releases/download/<release-version>/verrazzano-<release-version>.tgz`

## Building

Expand All @@ -51,6 +66,15 @@ Docker push:
make push
```

## Updating the CRDs

The CRDs are auto generated by the Verrazzano project `verrazzano-crd-generator`. The steps to include changes made to the yaml files that create the CRDs are:

* Make the API changes in the `verrazzano-crd-generator` project
* Tag the master branch of `verrazzano-crd-generator` (e.g. 0.n)
* Edit `go.mod` to use the newly tagged API changes. For example `github.com/verrazzano/verrazzano-coh-cluster-operator v1.2.0`
* make go-install

## Running

First, as a one-time operation, create relevant CRDs in the cluster where you'll be running the Verrazzano Operator:
Expand Down
7 changes: 7 additions & 0 deletions chart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
test
*.txt
.gitignore
.idea
.git
6 changes: 6 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
apiVersion: v1
description: A Helm chart for Verrazzano
name: verrazzano-helm-chart
version: "latest"
1 change: 1 addition & 0 deletions chart/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Verrazzano Helm chart has been installed!
164 changes: 164 additions & 0 deletions chart/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
apiVersion: v1
entries:
verrazzano-helm-chart:
- apiVersion: v1
created: "2020-08-21T18:35:33.54064907Z"
description: A Helm chart for Verrazzano
digest: 11bdeb447de2134955e70a56a20c0b40829da5b1ed20c7d7221315f952f49c2a
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.83/verrazzano-v0.0.83.tgz
version: v0.0.83
- apiVersion: v1
created: "2020-08-20T17:24:08.988723726Z"
description: A Helm chart for Verrazzano
digest: bf27e5a0bffb036c14a0e781c30cc6cfff1d2cbee88cb7871237023aa18d0b6e
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.82/verrazzano-v0.0.82.tgz
version: v0.0.82
- apiVersion: v1
created: "2020-08-19T14:22:00.619651918Z"
description: A Helm chart for Verrazzano
digest: 38e44341ce2212aed91e1223ff929ff6045953b3008d5544d14dd789e206385e
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.81/verrazzano-v0.0.81.tgz
version: v0.0.81
- apiVersion: v1
created: "2020-08-19T13:16:47.194880096Z"
description: A Helm chart for Verrazzano
digest: dd3735f9de49e532d7dff38f0541edcdc0a64edb37816ff4a8a801b250eec605
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.80/verrazzano-v0.0.80.tgz
version: v0.0.80
- apiVersion: v1
created: "2020-08-18T02:37:58.666358547Z"
description: A Helm chart for Verrazzano
digest: 9d4b69caf26a1cd84e3e958d43b81b750f438f4d9b62b2db2a7672c1e694628d
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.79/verrazzano-v0.0.79.tgz
version: v0.0.79
- apiVersion: v1
created: "2020-08-14T16:25:44.575779564Z"
description: A Helm chart for Verrazzano
digest: a8ff6487d7cb86849fbc8d97f5635c182ed9396cbeae7e14906986a0775c609f
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.78/verrazzano-v0.0.78.tgz
version: v0.0.78
- apiVersion: v1
created: "2020-08-14T13:52:12.940935482Z"
description: A Helm chart for Verrazzano
digest: 94360955068e58403020670389074d0fe61561cec1353f47ebf3f6f29b8508ad
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.77/verrazzano-v0.0.77.tgz
version: v0.0.77
- apiVersion: v1
created: "2020-08-14T01:36:51.769943586Z"
description: A Helm chart for Verrazzano
digest: 732d90659279e8836961913d9d185e68d2503479dd291a4d9b0eeb054d58650d
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.76/verrazzano-v0.0.76.tgz
version: v0.0.76
- apiVersion: v1
created: "2020-08-13T01:35:38.089123332Z"
description: A Helm chart for Verrazzano
digest: 2977ce8ed42f9816867f345d4faea980e78f0e9604e81e1aa15cf6fdb92b69f1
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.75/verrazzano-v0.0.75.tgz
version: v0.0.75
- apiVersion: v1
created: "2020-08-12T20:12:56.117452546Z"
description: A Helm chart for Verrazzano
digest: 34c4a43acd7561ceaa2b1f2577ed239eb0830a3a9ddacfd3eea2e2def7f3714a
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.74/verrazzano-v0.0.74.tgz
version: v0.0.74
- apiVersion: v1
created: "2020-08-11T11:20:27.389029215Z"
description: A Helm chart for Verrazzano
digest: 94e2b6fec4900e3167ab330488589a808acea3dfa05f0beb1ad1c4da306a9d93
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.73/verrazzano-v0.0.73.tgz
version: v0.0.73
- apiVersion: v1
created: "2020-08-10T18:13:46.604508291Z"
description: A Helm chart for Verrazzano
digest: d6b696d43cd0f93c45696d498746c1bb2bf214b3b9323af692f837d05ee5b0a9
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.72/verrazzano-v0.0.72.tgz
version: v0.0.72
- apiVersion: v1
created: "2020-08-10T15:23:37.678311946Z"
description: A Helm chart for Verrazzano
digest: 4efc19e6f932f8e94531d49ead0d8825f49e64c53ebf46a3dbe90b2f98c4b88c
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.71/verrazzano-v0.0.71.tgz
version: v0.0.71
- apiVersion: v1
created: "2020-08-10T14:37:40.414777082Z"
description: A Helm chart for Verrazzano
digest: e1678ba43fdf2505a21230c43282ee9a82882198bdfa717982e0dbc62a9a8c3d
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.70/verrazzano-v0.0.70.tgz
version: v0.0.70
- apiVersion: v1
created: "2020-08-07T14:58:37.374188262Z"
description: A Helm chart for Verrazzano
digest: bf7ddcf957a031abaa993668051a1a446584fe8de91fe30efb8ee1edc142c663
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.69/verrazzano-v0.0.69.tgz
version: v0.0.69
- apiVersion: v1
created: "2020-08-06T19:18:17.410348731Z"
description: A Helm chart for Verrazzano
digest: 3d7f8429c7d03a07cd5970462ae7ba93cd029e1b598a0c328791ff8ee4fdc730
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.68/verrazzano-v0.0.68.tgz
version: v0.0.68
- apiVersion: v1
created: "2020-07-31T23:19:55.692572993Z"
description: A Helm chart for Verrazzano
digest: 95839a39712bcb9898b760161ed77942d439a379bdd4c2de7c0723b1555cb72f
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.67/verrazzano-v0.0.67.tgz
version: v0.0.67
- apiVersion: v1
created: "2020-07-31T11:46:20.197312383Z"
description: A Helm chart for Verrazzano
digest: 491401305a06094f3a23acb743806dc2f068c9c2f70455792377f636442c84a8
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.66/verrazzano-v0.0.66.tgz
version: v0.0.66
- apiVersion: v1
created: "2020-07-31T11:32:38.215218533Z"
description: A Helm chart for Verrazzano
digest: 2413a5962100b865303d057c581101d394d3edce79e8e9dfd3e1b0a47d6d4253
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.65/verrazzano-v0.0.65.tgz
version: v0.0.65
- apiVersion: v1
created: "2020-07-30T14:14:34.43783853Z"
description: A Helm chart for Verrazzano
digest: f94278ead57ed302f82ab809e2ee16d3488783682331d06e7d620525f593bca8
name: verrazzano-helm-chart
urls:
- https://github.com/verrazzano/verrazzano-operator/releases/download/v0.0.64/verrazzano-v0.0.64.tgz
version: v0.0.64
generated: "2020-08-21T18:35:33.533804782Z"
1 change: 1 addition & 0 deletions chart/latest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.0.83
Loading

0 comments on commit 69c02b0

Please sign in to comment.