Skip to content

Commit dbc38bb

Browse files
sbueringerpierreprinetti
authored andcommitted
finalize doc & examples for v0.2.0 (kubernetes-sigs#488)
* finalize doc & examples for v0.2.0 * review fixes
1 parent bde00ee commit dbc38bb

File tree

14 files changed

+61
-29
lines changed

14 files changed

+61
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tmp
1313

1414
# Output of the go coverage tool, specifically when used with LiteIDE
1515
*.out
16+
out
1617

1718
# Kubernetes Generated files - skip generated files, except for vendored files
1819

Makefile

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ generate-go: $(CONTROLLER_GEN) $(MOCKGEN) ## Runs Go related generate targets
177177
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
178178
$(CONTROLLER_GEN) \
179179
paths=./api/... \
180-
crd:trivialVersions=true \
180+
crd \
181181
output:crd:dir=$(CRD_ROOT) \
182182
output:webhook:dir=$(WEBHOOK_ROOT) \
183183
webhook
@@ -226,6 +226,17 @@ docker-push-manifest: ## Push the fat manifest docker image.
226226
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${CONTROLLER_IMG}:${TAG} ${CONTROLLER_IMG}-$${arch}:${TAG}; done
227227
docker manifest push --purge $(CONTROLLER_IMG):$(TAG)
228228

229+
.PHONY: set-manifest-image
230+
set-manifest-image:
231+
$(info Updating kustomize image patch file for manager resource)
232+
sed -i'' -e 's@image: .*@image: '"${MANIFEST_IMG}:$(MANIFEST_TAG)"'@' ./config/default/manager_image_patch.yaml
233+
234+
235+
.PHONY: set-manifest-pull-policy
236+
set-manifest-pull-policy:
237+
$(info Updating kustomize pull policy file for manager resource)
238+
sed -i'' -e 's@imagePullPolicy: .*@imagePullPolicy: '"$(PULL_POLICY)"'@' ./config/default/manager_pull_policy.yaml
239+
229240
## --------------------------------------
230241
## Release
231242
## --------------------------------------
@@ -239,26 +250,28 @@ $(RELEASE_DIR):
239250
.PHONY: release
240251
release: clean-release ## Builds and push container images using the latest git tag for the commit.
241252
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
242-
@if ! [ -z "$$(git status --porcelain)" ]; then echo "Your local git repository contains uncommitted changes, use git clean before proceeding."; exit 1; fi
243-
git checkout "${RELEASE_TAG}"
244253
# Push the release image to the staging bucket first.
245254
REGISTRY=$(STAGING_REGISTRY) TAG=$(RELEASE_TAG) \
246255
$(MAKE) docker-build-all docker-push-all
247256
# Set the manifest image to the production bucket.
248-
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG)
249257
$(MAKE) release-manifests
250258

251259
.PHONY: release-manifests
252260
release-manifests: $(RELEASE_DIR) ## Builds the manifests to publish with a release
261+
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG) \
262+
$(MAKE) set-manifest-image
263+
PULL_POLICY=IfNotPresent $(MAKE) set-manifest-pull-policy
253264
kustomize build config/default > $(RELEASE_DIR)/infrastructure-components.yaml
254265

255266
.PHONY: release-staging
256267
release-staging: ## Builds and push container images to the staging bucket.
257-
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all docker-push-all release-tag-latest
268+
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all docker-push-all release-alias-tag
269+
270+
RELEASE_ALIAS_TAG=$(shell if [ "$(PULL_BASE_REF)" = "master" ]; then echo "latest"; else echo "$(PULL_BASE_REF)"; fi)
258271

259-
.PHONY: release-tag-latest
260-
release-tag-latest: ## Adds the latest tag to the last build tag.
261-
gcloud container images add-tag $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):latest
272+
.PHONY: release-alias-tag
273+
release-alias-tag: # Adds the tag to the last build tag.
274+
gcloud container images add-tag $(CONTROLLER_IMG):$(TAG) $(CONTROLLER_IMG):$(RELEASE_ALIAS_TAG)
262275

263276
## --------------------------------------
264277
## Development

RELEASE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ For version v0.x.y:
2626
1. Note: `origin` should be the name of the remote pointing to `github.com/kubernetes-sigs/cluster-api-provider-openstack`
2727
1. Run `make release` to build artifacts and push the images to the staging bucket
2828
1. Follow the [Image Promotion process](https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io#image-promoter) to promote the image from the staging repo to `us.gcr.io/k8s-artifacts-prod/capi-openstack`
29-
1. Create a release (with the above mentioned release notes) in GitHub based on the tag created above
29+
1. Create a release in GitHub based on the tag created above
30+
1. add the above mentioned release notes
31+
1. upload `out/infrastructure-components.yaml`
3032
1. The release issue is closed
3133
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] cluster-api-provider-openstack $VERSION is released`
3234

config/default/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resources:
2626

2727
patchesStrategicMerge:
2828
- manager_image_patch.yaml
29+
- manager_pull_policy.yaml
2930
# Protect the /metrics endpoint by putting it behind auth.
3031
# Only one of manager_auth_proxy_patch.yaml and
3132
# manager_prometheus_metrics_patch.yaml should be enabled.

config/default/manager_image_patch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ spec:
88
spec:
99
containers:
1010
# Change the value of image field below to your controller image URL
11-
- image: gcr.io/k8s-staging-capi-openstack/capi-openstack-controller:latest
11+
- image: us.gcr.io/k8s-artifacts-prod/capi-openstack/capi-openstack-controller:v0.2.0
1212
name: manager
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: controller-manager
5+
namespace: system
6+
spec:
7+
template:
8+
spec:
9+
containers:
10+
- name: manager
11+
imagePullPolicy: IfNotPresent

config/manager/manager.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ spec:
2929
imagePullPolicy: Always
3030
name: manager
3131
terminationGracePeriodSeconds: 10
32+
tolerations:
33+
- effect: NoSchedule
34+
key: node-role.kubernetes.io/master

docs/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- If you want to use VM, install [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/), version 0.30.0 or greater. Also install a [driver](https://github.com/kubernetes/minikube/blob/master/docs/drivers.md). For Linux, we recommend `kvm2`. For MacOS, we recommend `VirtualBox`.
1010
- If you want to use a container, install [Kind](https://github.com/kubernetes-sigs/kind#installation-and-usage).
1111
- If you want to use an existing Kubernetes cluster, prepare a kubeconfig which for this cluster.
12+
1. The CAPO provider requires an OS image (available in OpenStack), which is build like the ones in [image-builder](https://github.com/kubernetes-sigs/image-builder/tree/master/images/capi)
1213

1314
## Cluster Creation
1415

examples/cluster/multi-node/cluster.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
services:
1010
cidrBlocks: ["10.96.0.0/12"]
1111
pods:
12-
cidrBlocks: ["192.168.0.0/16"]
12+
cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico.
1313
serviceDomain: "cluster.local"
1414
infrastructureRef:
1515
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
@@ -40,7 +40,6 @@ spec:
4040
# * creating floating ips
4141
# * creating load balancer
4242
externalNetworkId: <external-network-id>
43-
managedSecurityGroups: false
4443
disablePortSecurity: true
4544
disableServerTags: true
4645
useOctavia: true

examples/cluster/single-node/cluster.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ spec:
99
services:
1010
cidrBlocks: ["10.96.0.0/12"]
1111
pods:
12-
cidrBlocks: ["192.168.0.0/16"]
12+
cidrBlocks: ["192.168.0.0/16"] # CIDR block used by Calico.
1313
serviceDomain: "cluster.local"
14-
apiServerPort: 6443
1514
infrastructureRef:
1615
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
1716
kind: OpenStackCluster
@@ -29,14 +28,12 @@ spec:
2928
name: cloud-config
3029
namespace: ${CLUSTER_NAME}
3130
nodeCidr: <node-cidr>
32-
managedAPIServerLoadBalancer: false
3331
dnsNameservers: []
3432
# multi-node control-plane:
3533
# * externalNetworkId is required for:
3634
# * creating routers
3735
# * creating floating ips
3836
# * creating load balancer
3937
externalNetworkId: <external-network-id>
40-
managedSecurityGroups: false
4138
disablePortSecurity: true
4239
disableServerTags: true

0 commit comments

Comments
 (0)