Deployment

Now we have all our code changes and manifests in place, so let’s deploy it tothe cluster and test it out.

Ensure that you have installed cert-manager 0.9.0+ version in your cluster. We havetested the instructions in this tutorial with 0.9.0-alpha.0 release.

Running make deploy will deploy the controller-manager in the cluster.

Testing

Now that we have deployed the controller-manager with conversion webhook enabled, let’s test out the version conversion feature.We will do the following to perform a simple version conversion test:

  • Create disk object named disk-sample using v1 specification
  • Get disk object disk-sample using v2 version
  • Get disk object disk-sample using v3 version

1. Create v1 disk object

  1. apiVersion: infra.kubebuilder.io/v1
  2. kind: Disk
  3. metadata:
  4. name: disk-sample
  5. spec:
  6. price: 10 USD
  1. kubectl apply -f config/samples/infra_v1_disk.yaml

2. Get disk object using v2 version

  1. kubectl get disks.v2.infra.kubebuilder.io/disk-sample -o yaml
  1. apiVersion: infra.kubebuilder.io/v2 <-- note the v2 version
  2. kind: Disk
  3. metadata:
  4. name: disk-sample
  5. selfLink: /apis/infra.kubebuilder.io/v2/namespaces/default/disks/disk-sample
  6. uid: 0e9be0fd-a284-11e9-bbbe-42010a8001af
  7. spec:
  8. price: <-- note the structured price object
  9. amount: 10
  10. currency: USD
  11. status: {}

3. Get disk object using v3 version

  1. kubectl get disks.v3.infra.kubebuilder.io/disk-sample -o yaml
  1. apiVersion: infra.kubebuilder.io/v3 <-- note the v3 version
  2. kind: Disk
  3. metadata:
  4. name: disk-sample
  5. selfLink: /apis/infra.kubebuilder.io/v3/namespaces/default/disks/disk-sample
  6. uid: 0e9be0fd-a284-11e9-bbbe-42010a8001af <-- note the same uid as v2
  7. ....
  8. spec:
  9. pricePerGB: <-- note the pricePerGB name of the field
  10. amount: 10
  11. currency: USD
  12. status: {}

Troubleshooting

TODO(../TODO.md) steps for troubleshoting