99 <a href="https://swiftpackageindex.com/swiftkube/client">
1010 <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fswiftkube%2Fclient%2Fbadge%3Ftype%3Dplatforms"/>
1111 </a>
12- <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32 /">
13- <img src="https://img.shields.io/badge/Kubernetes-1.32.2 -blue.svg" alt="Kubernetes 1.32.2 "/>
12+ <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.33 /">
13+ <img src="https://img.shields.io/badge/Kubernetes-1.33.3 -blue.svg" alt="Kubernetes 1.33.3 "/>
1414 </a>
1515 <a href="https://swift.org/package-manager">
1616 <img src="https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat" alt="Swift Package Manager" />
1717 </a>
1818 <a href="https://github.com/swiftkube/client/actions">
19- <img src="https://github.com/swiftkube/client/workflows/swiftkube-client- ci/badge.svg" alt="CI Status">
19+ <img src="https://github.com/swiftkube/client/workflows/ci/badge.svg" alt="CI Status">
2020 </a>
2121</p >
2222
4242Swift client for talking to a [ Kubernetes] ( http://kubernetes.io/ ) cluster via a fluent DSL based
4343on [ SwiftNIO] ( https://github.com/apple/swift-nio ) and the [ AysncHTTPClient] ( https://github.com/swift-server/async-http-client ) .
4444
45- - [x] Covers all Kubernetes API Groups in v1.32.0
45+ - [x] Covers all Kubernetes API Groups in v1.33.3
4646- [x] Automatic configuration discovery
4747- [x] DSL style API
4848 - [x] For all API Groups/Versions
@@ -68,14 +68,14 @@ on [SwiftNIO](https://github.com/apple/swift-nio) and the [AysncHTTPClient](http
6868
6969## Compatibility Matrix
7070
71- | | 1.24.10 | 1.26.4 | 1. 28.0 | 1.28.3 | 1.29.6 | 1.32.0 | 1.32.2 |
72- | -------------------| --------- | -------- | --------| --------| --------| --------| --------|
73- | ` 0.14 .x ` | ✓ | - | - | - | - | - | - |
74- | ` 0.15 .x ` | - | ✓ | - | - | - | - | - |
75- | ` 0.16 .x ` | - | - | ✓ | - | - | - | - |
76- | ` 0.17 .x ` | - | - | - | ✓ | - | - | - |
77- | ` 0.18.x ` | - | - | - | - | ✓ | - | - |
78- | ` 0.19.x ` - ` 0.23.0 ` | - | - | - | - | - | ✓ | ✓ |
71+ | | 1.28.0 | 1.28.3 | 1.29.6 | 1.32.0 | 1.32.2 | 1.33.3 |
72+ | -------------------| --------| --------| --------| --------| --------| --------|
73+ | ` 0.16 .x ` | ✓ | - | - | - | - | - |
74+ | ` 0.17 .x ` | - | ✓ | - | - | - | - |
75+ | ` 0.18 .x ` | - | - | ✓ | - | - | - |
76+ | ` 0.19 .x ` - ` 0.23.0 ` | - | - | - | ✓ | - | - |
77+ | ` 0.24.0 ` | - | - | - | - | ✓ | - |
78+ | ` 0.25.0 ` | - | - | - | - | - | ✓ |
7979
8080- ` ✓ ` Exact match of API objects in both client and the Kubernetes version.
8181- ` - ` API objects mismatches either due to the removal of old API or the addition of new API. However, everything the
@@ -120,12 +120,31 @@ client.shutdown(queue: queue) { (error: Error?) in
120120
121121The client tries to resolve a ` kube config ` automatically from different sources in the following order:
122122
123- - If set, kube config file at path of environment variable ` KUBECONFIG `
123+ - Kube config file at path of environment variable ` KUBECONFIG ` , if defined
124124- Kube config file in the user's ` $HOME/.kube/config ` directory
125- - ` ServiceAccount ` token located at ` /var/run/secrets/kubernetes.io/serviceaccount/token ` and a mounted CA certificate,
126- - if it's running in Kubernetes.
125+ - ` ServiceAccount ` token located at ` /var/run/secrets/kubernetes.io/serviceaccount/token ` and a mounted CA certificate, if it's running in Kubernetes.
127126
128- Alternatively it can be configured manually, for example:
127+ However, ` KubeConfig ` can also be loaded manually:
128+
129+ ``` swift
130+ let kubeConfig = try KubeConfig.from (config : " <config as a YAML string>" )
131+ let kubeConfig = try KubeConfig.from (url : " <some URL>" )
132+ let kubeConfig = try KubeConfig.fromEnvironment (envVar : " KUBECONFIG" )
133+ let kubeConfig = try KubeConfig.fromDefaultLocalConfig ()
134+ let kubeConfig = try KubeConfig.fromServiceAccount ()
135+ ```
136+
137+ and then used to initialize the ` KubernetesClientConfig ` like this:
138+
139+ ``` swift
140+ let kubeConfig = KubeConfig.fromDefaultLocalConfig ()
141+ let config = KubernetesClientConfig.from (
142+ kubeConfig : kubeConfig,
143+ contextName : " some-context" // if not provided, then "current-context" is used
144+ )
145+ ```
146+
147+ Alternatively, the ` KubernetesClientConfig ` can be configured completely manually, for example:
129148
130149``` swift
131150let caCert = try NIOSSLCertificate.fromPEMFile (caFile)
0 commit comments