Skip to content

Commit

Permalink
feat: Env var from fieldRef/resource support (#263) (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriscbr committed Jan 19, 2022
1 parent 53d8fcd commit 80045cf
Show file tree
Hide file tree
Showing 5 changed files with 972 additions and 2 deletions.
244 changes: 244 additions & 0 deletions docs/java.md
Expand Up @@ -2933,6 +2933,45 @@ Specify whether the ConfigMap or its key must be defined.

---

### EnvValueFromFieldRefOptions <a name="org.cdk8s.plus21.EnvValueFromFieldRefOptions"></a>

Options to specify an environment variable value from a field reference.

#### Initializer <a name="[object Object].Initializer"></a>

```java
import org.cdk8s.plus21.EnvValueFromFieldRefOptions;

EnvValueFromFieldRefOptions.builder()
// .apiVersion(java.lang.String)
// .key(java.lang.String)
.build();
```

##### `apiVersion`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValueFromFieldRefOptions.property.apiVersion"></a>

```java
public java.lang.String getApiVersion();
```

- *Type:* `java.lang.String`

Version of the schema the FieldPath is written in terms of.

---

##### `key`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValueFromFieldRefOptions.property.key"></a>

```java
public java.lang.String getKey();
```

- *Type:* `java.lang.String`

The key to select the pod label or annotation.

---

### EnvValueFromProcessOptions <a name="org.cdk8s.plus21.EnvValueFromProcessOptions"></a>

Options to specify an environment variable value from the process environment.
Expand Down Expand Up @@ -2962,6 +3001,45 @@ If this is set to true, and the key does not exist, an error will thrown.

---

### EnvValueFromResourceOptions <a name="org.cdk8s.plus21.EnvValueFromResourceOptions"></a>

Options to specify an environment variable value from a resource.

#### Initializer <a name="[object Object].Initializer"></a>

```java
import org.cdk8s.plus21.EnvValueFromResourceOptions;

EnvValueFromResourceOptions.builder()
// .container(Container)
// .divisor(java.lang.String)
.build();
```

##### `container`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValueFromResourceOptions.property.container"></a>

```java
public Container getContainer();
```

- *Type:* [`org.cdk8s.plus21.Container`](#org.cdk8s.plus21.Container)

The container to select the value from.

---

##### `divisor`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValueFromResourceOptions.property.divisor"></a>

```java
public java.lang.String getDivisor();
```

- *Type:* `java.lang.String`

The output format of the exposed resource.

---

### EnvValueFromSecretOptions <a name="org.cdk8s.plus21.EnvValueFromSecretOptions"></a>

Options to specify an environment variable value from a Secret.
Expand Down Expand Up @@ -5438,6 +5516,31 @@ Additional options.

---

##### `fromFieldRef` <a name="org.cdk8s.plus21.EnvValue.fromFieldRef"></a>

```java
import org.cdk8s.plus21.EnvValue;

EnvValue.fromFieldRef(EnvFieldPaths fieldPath)
EnvValue.fromFieldRef(EnvFieldPaths fieldPath, EnvValueFromFieldRefOptions options)
```

###### `fieldPath`<sup>Required</sup> <a name="org.cdk8s.plus21.EnvValue.parameter.fieldPath"></a>

- *Type:* [`org.cdk8s.plus21.EnvFieldPaths`](#org.cdk8s.plus21.EnvFieldPaths)

: The field reference.

---

###### `options`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValue.parameter.options"></a>

- *Type:* [`org.cdk8s.plus21.EnvValueFromFieldRefOptions`](#org.cdk8s.plus21.EnvValueFromFieldRefOptions)

: Additional options.

---

##### `fromProcess` <a name="org.cdk8s.plus21.EnvValue.fromProcess"></a>

```java
Expand All @@ -5463,6 +5566,31 @@ Additional options.

---

##### `fromResource` <a name="org.cdk8s.plus21.EnvValue.fromResource"></a>

```java
import org.cdk8s.plus21.EnvValue;

EnvValue.fromResource(ResourceFieldPaths resource)
EnvValue.fromResource(ResourceFieldPaths resource, EnvValueFromResourceOptions options)
```

###### `resource`<sup>Required</sup> <a name="org.cdk8s.plus21.EnvValue.parameter.resource"></a>

- *Type:* [`org.cdk8s.plus21.ResourceFieldPaths`](#org.cdk8s.plus21.ResourceFieldPaths)

: Resource to select the value from.

---

###### `options`<sup>Optional</sup> <a name="org.cdk8s.plus21.EnvValue.parameter.options"></a>

- *Type:* [`org.cdk8s.plus21.EnvValueFromResourceOptions`](#org.cdk8s.plus21.EnvValueFromResourceOptions)

: Additional options.

---

##### `fromSecretValue` <a name="org.cdk8s.plus21.EnvValue.fromSecretValue"></a>

```java
Expand Down Expand Up @@ -6307,6 +6435,78 @@ files you write will count against your Container's memory limit.
---


### EnvFieldPaths <a name="EnvFieldPaths"></a>

#### `POD_NAME` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_NAME"></a>

The name of the pod.

---


#### `POD_NAMESPACE` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_NAMESPACE"></a>

The namespace of the pod.

---


#### `POD_UID` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_UID"></a>

The uid of the pod.

---


#### `POD_LABEL` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_LABEL"></a>

The labels of the pod.

---


#### `POD_ANNOTATION` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_ANNOTATION"></a>

The annotations of the pod.

---


#### `POD_IP` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_IP"></a>

The ipAddress of the pod.

---


#### `SERVICE_ACCOUNT_NAME` <a name="org.cdk8s.plus21.EnvFieldPaths.SERVICE_ACCOUNT_NAME"></a>

The service account name of the pod.

---


#### `NODE_NAME` <a name="org.cdk8s.plus21.EnvFieldPaths.NODE_NAME"></a>

The name of the node.

---


#### `NODE_IP` <a name="org.cdk8s.plus21.EnvFieldPaths.NODE_IP"></a>

The ipAddress of the node.

---


#### `POD_IPS` <a name="org.cdk8s.plus21.EnvFieldPaths.POD_IPS"></a>

The ipAddresess of the pod.

---


### ImagePullPolicy <a name="ImagePullPolicy"></a>

#### `ALWAYS` <a name="org.cdk8s.plus21.ImagePullPolicy.ALWAYS"></a>
Expand Down Expand Up @@ -6437,6 +6637,50 @@ desired scale without waiting, and on scale down will delete all pods at once.
---


### ResourceFieldPaths <a name="ResourceFieldPaths"></a>

#### `CPU_LIMIT` <a name="org.cdk8s.plus21.ResourceFieldPaths.CPU_LIMIT"></a>

CPU limit of the container.

---


#### `MEMORY_LIMIT` <a name="org.cdk8s.plus21.ResourceFieldPaths.MEMORY_LIMIT"></a>

Memory limit of the container.

---


#### `CPU_REQUEST` <a name="org.cdk8s.plus21.ResourceFieldPaths.CPU_REQUEST"></a>

CPU request of the container.

---


#### `MEMORY_REQUEST` <a name="org.cdk8s.plus21.ResourceFieldPaths.MEMORY_REQUEST"></a>

Memory request of the container.

---


#### `STORAGE_LIMIT` <a name="org.cdk8s.plus21.ResourceFieldPaths.STORAGE_LIMIT"></a>

Ephemeral storage limit of the container.

---


#### `STORAGE_REQUEST` <a name="org.cdk8s.plus21.ResourceFieldPaths.STORAGE_REQUEST"></a>

Ephemeral storage request of the container.

---


### RestartPolicy <a name="RestartPolicy"></a>

Restart policy for all containers within the pod.
Expand Down

0 comments on commit 80045cf

Please sign in to comment.