|
1 | | -# oke-credential-provider-for-ocir |
| 1 | +# Image Credential Provider for OKE |
2 | 2 |
|
3 | | -[](https://img.shields.io/badge/license-UPL-green) [](https://sonarcloud.io/dashboard?id=oracle-devrel_oke-credential-provider-for-ocir) |
| 3 | +<b>Image Credential Provider</b> (Provider) for [Container Engine for Kubernetes (OKE)](https://www.oracle.com/cloud/cloud-native/container-engine-kubernetes/) is the implementation of [Kubelet CredentialProvider (v1) APIs](https://kubernetes.io/docs/reference/config-api/kubelet-credentialprovider.v1/) for passwordless pulls from the [Container Registry (OCIR)](https://www.oracle.com/cloud/cloud-native/container-registry/) (OCIR). It's useful since OKE typically [requires](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengpullingimagesfromocir.htm) a stored Secret to pull private OCIR images, referenced with `imagePullSecrets` in a manifest. With the provider in place, Kubelet will pull images using instance principal authentication, giving you a seamless image-pulling experience without hosting static Docker credentials. |
4 | 4 |
|
5 | | -## THIS IS A NEW, BLANK REPO THAT IS NOT READY FOR USE YET. PLEASE CHECK BACK SOON! |
| 5 | +## Table of Contents |
| 6 | +- [Prerequisites](#prerequisites) |
| 7 | +- [Installation](#installation) |
| 8 | +- [Contributing](#contributing) |
| 9 | +- [License](#license) |
6 | 10 |
|
7 | | -## Introduction |
8 | | -MISSING |
| 11 | +## Prerequisites |
| 12 | +Your OKE Kubelet and API Server versions must be at least v1.26. To check the version, execute `kubectl version`. |
9 | 13 |
|
10 | | -## Getting Started |
11 | | -MISSING |
12 | 14 |
|
13 | | -### Prerequisites |
14 | | -MISSING |
| 15 | +## Installation |
| 16 | +To install and run the Provider on a worker nodes, follow the steps described [here](/examples/run-on-worker-instance-principal/). |
15 | 17 |
|
16 | | -## Notes/Issues |
17 | | -MISSING |
| 18 | +It's crucial to (1) [create](#1-create-dynamic-group-for-oke-worker-nodes) a dynamic group to represent worker nodes, (2) [create](#2-create-policy-to-pull-images) a Policy to authorize pulling from OCIR, and (3) [configure](#3-configure-cloud-init-for-oke-node-pool) a cloud-init script to do the heavy lifting. |
18 | 19 |
|
19 | | -## URLs |
20 | | -* Nothing at this time |
| 20 | +## How the Provider Works |
| 21 | +The plugin implementation leverages the Kubelet capability introduced in v1.26. Kubelet uses [CredentialProvider](https://kubernetes.io/docs/reference/config-api/kubelet-credentialprovider.v1/) APIs to fetch authentication credentials against Docker comaptible image registry and caches it on the worker node level. The plugin translates instance principal authentication into the JWT token that is used by Kubelet when pulling images from OCIR at runtime. In that case, you don't need to specify `imagePullSecrets` in a manifest, since Kubelet has JWT token based on instance principal auth locally. |
| 22 | + |
| 23 | +The provider is injected into Kubelet via the extra `kubelet-extra-args`: |
| 24 | +- `--image-credential-provider-config` sets the path to the Image Credential Provider for OKE config file. |
| 25 | +- `--image-credential-provider-bin-dir` sets the path to the directory where the Image Credential Provider for OKE binary is located. |
| 26 | + |
| 27 | +The cloud-init script act as glue, downloading the provider with the configuration file and passing it to the Kubelet. |
| 28 | + |
| 29 | +The current [cloud-init.sh](examples/run-on-worker-instance-principal/cloud-init.sh) example implementation uses the `wget` utility to download binaries on the worker nodes. Suppose you don't have access to the Internet (through NAT gateway) or your OS does not have a `wget`. In that case, you need to place binaries and configuration in the appropriate folders manually: |
| 30 | +- The [provider binary (amd64)](https://github.com/oracle-devrel/oke-credential-provider-for-ocir/releases/latest/download/oke-credential-provider-for-ocir-linux-amd64) with the name `oke-credential-provider` must be in the following path: `/usr/local/bin`. Make sure the binary has permission mode to execute. You can enable it by executing `sudo chmod 755 /usr/local/bin/oke-credential-provider`. |
| 31 | +- The kubelet configuration file [credential-provider-config.yaml](https://github.com/oracle-devrel/oke-credential-provider-for-ocir/releases/latest/download/credential-provider-config.yaml) must be placed in the path `/etc/kubernetes`. |
| 32 | + |
| 33 | +Plugin binaries are avaialble both for OCI [arm64](https://github.com/oracle-devrel/oke-credential-provider-for-ocir/releases/latest/download/oke-credential-provider-for-ocir-linux-arm64) and [amd64](https://github.com/oracle-devrel/oke-credential-provider-for-ocir/releases/latest/download/oke-credential-provider-for-ocir-linux-amd64) architectures. |
21 | 34 |
|
22 | 35 | ## Contributing |
23 | | -This project is open source. Please submit your contributions by forking this repository and submitting a pull request! Oracle appreciates any contributions that are made by the open source community. |
| 36 | + |
| 37 | +If you find a bug or want to suggest an enhancement, please raise the Issue. |
24 | 38 |
|
25 | 39 | ## License |
26 | | -Copyright (c) 2022 Oracle and/or its affiliates. |
| 40 | +Copyright (c) 2024 Oracle and/or its affiliates. |
27 | 41 |
|
28 | 42 | Licensed under the Universal Permissive License (UPL), Version 1.0. |
29 | 43 |
|
30 | | -See [LICENSE](LICENSE) for more details. |
31 | | - |
32 | | -ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK. |
| 44 | +See [LICENSE](LICENSE) for more details. |
0 commit comments