forked from kubernetes/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix podpreset task (kubernetes#5705)
- Loading branch information
Showing
13 changed files
with
300 additions
and
390 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
docs/tasks/inject-data-application/podpreset-allow-db-merged.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: website | ||
labels: | ||
app: website | ||
role: frontend | ||
annotations: | ||
podpreset.admission.kubernetes.io/podpreset-allow-database: "resource version" | ||
spec: | ||
containers: | ||
- name: website | ||
image: ecorp/website | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
- mountPath: /etc/app/config.json | ||
readOnly: true | ||
name: secret-volume | ||
ports: | ||
- containerPort: 80 | ||
env: | ||
- name: DB_PORT | ||
value: "6379" | ||
- name: duplicate_key | ||
value: FROM_ENV | ||
- name: expansion | ||
value: $(REPLACE_ME) | ||
envFrom: | ||
- configMapRef: | ||
name: etcd-env-config | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
- name: secret-volume | ||
secret: | ||
secretName: config-details |
31 changes: 31 additions & 0 deletions
31
docs/tasks/inject-data-application/podpreset-allow-db.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: settings.k8s.io/v1alpha1 | ||
kind: PodPreset | ||
metadata: | ||
name: allow-database | ||
namespace: myns | ||
spec: | ||
selector: | ||
matchLabels: | ||
role: frontend | ||
env: | ||
- name: DB_PORT | ||
value: 6379 | ||
- name: duplicate_key | ||
value: FROM_ENV | ||
- name: expansion | ||
value: $(REPLACE_ME) | ||
envFrom: | ||
- configMapRef: | ||
name: etcd-env-config | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
- mountPath: /etc/app/config.json | ||
readOnly: true | ||
name: secret-volume | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
- name: secret-volume | ||
secret: | ||
secretName: config-details |
14 changes: 14 additions & 0 deletions
14
docs/tasks/inject-data-application/podpreset-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: etcd-env-config | ||
data: | ||
number_of_members: "1" | ||
initial_cluster_state: new | ||
initial_cluster_token: DUMMY_ETCD_INITIAL_CLUSTER_TOKEN | ||
discovery_token: DUMMY_ETCD_DISCOVERY_TOKEN | ||
discovery_url: http://etcd_discovery:2379 | ||
etcdctl_peers: http://etcd:2379 | ||
duplicate_key: FROM_CONFIG_MAP | ||
REPLACE_ME: "a value" | ||
|
19 changes: 19 additions & 0 deletions
19
docs/tasks/inject-data-application/podpreset-conflict-pod.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: website | ||
labels: | ||
app: website | ||
role: frontend | ||
spec: | ||
containers: | ||
- name: website | ||
image: ecorp/website | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
ports: | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
- containerPort: 80 |
19 changes: 19 additions & 0 deletions
19
docs/tasks/inject-data-application/podpreset-conflict-preset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: settings.k8s.io/v1alpha1 | ||
kind: PodPreset | ||
metadata: | ||
name: allow-database | ||
namespace: myns | ||
spec: | ||
selector: | ||
matchLabels: | ||
role: frontend | ||
env: | ||
- name: DB_PORT | ||
value: "6379" | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: other-volume | ||
volumes: | ||
- name: other-volume | ||
emptyDir: {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: website | ||
labels: | ||
app: website | ||
role: frontend | ||
annotations: | ||
podpreset.admission.kubernetes.io/podpreset-allow-database: "resource version" | ||
spec: | ||
containers: | ||
- name: website | ||
image: ecorp/website | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
ports: | ||
- containerPort: 80 | ||
env: | ||
- name: DB_PORT | ||
value: "6379" | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
|
29 changes: 29 additions & 0 deletions
29
docs/tasks/inject-data-application/podpreset-multi-merged.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: website | ||
labels: | ||
app: website | ||
role: frontend | ||
annotations: | ||
podpreset.admission.kubernetes.io/podpreset-allow-database: "resource version" | ||
podpreset.admission.kubernetes.io/podpreset-proxy: "resource version" | ||
spec: | ||
containers: | ||
- name: website | ||
image: ecorp/website | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
- mountPath: /etc/proxy/configs | ||
name: proxy-volume | ||
ports: | ||
- containerPort: 80 | ||
env: | ||
- name: DB_PORT | ||
value: "6379" | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
- name: proxy-volume | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: website | ||
labels: | ||
app: website | ||
role: frontend | ||
spec: | ||
containers: | ||
- name: website | ||
image: ecorp/website | ||
ports: | ||
- containerPort: 80 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: settings.k8s.io/v1alpha1 | ||
kind: PodPreset | ||
metadata: | ||
name: allow-database | ||
namespace: myns | ||
spec: | ||
selector: | ||
matchLabels: | ||
role: frontend | ||
env: | ||
- name: DB_PORT | ||
value: "6379" | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: settings.k8s.io/v1alpha1 | ||
kind: PodPreset | ||
metadata: | ||
name: proxy | ||
namespace: myns | ||
spec: | ||
selector: | ||
matchLabels: | ||
role: frontend | ||
volumeMounts: | ||
- mountPath: /etc/proxy/configs | ||
name: proxy-volume | ||
volumes: | ||
- name: proxy-volume | ||
emptyDir: {} |
30 changes: 30 additions & 0 deletions
30
docs/tasks/inject-data-application/podpreset-replicaset-merged.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
labels: | ||
app: guestbook | ||
tier: frontend | ||
annotations: | ||
podpreset.admission.kubernetes.io/podpreset-allow-database: "resource version" | ||
spec: | ||
containers: | ||
- name: php-redis | ||
image: gcr.io/google_samples/gb-frontend:v3 | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
volumeMounts: | ||
- mountPath: /cache | ||
name: cache-volume | ||
env: | ||
- name: GET_HOSTS_FROM | ||
value: dns | ||
- name: DB_PORT | ||
value: "6379" | ||
ports: | ||
- containerPort: 80 | ||
volumes: | ||
- name: cache-volume | ||
emptyDir: {} | ||
|
29 changes: 29 additions & 0 deletions
29
docs/tasks/inject-data-application/podpreset-replicaset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: apps/v1beta2 | ||
kind: ReplicaSet | ||
metadata: | ||
name: frontend | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
tier: frontend | ||
matchExpressions: | ||
- {key: tier, operator: In, values: [frontend]} | ||
template: | ||
metadata: | ||
labels: | ||
app: guestbook | ||
tier: frontend | ||
spec: | ||
containers: | ||
- name: php-redis | ||
image: gcr.io/google_samples/gb-frontend:v3 | ||
resources: | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
env: | ||
- name: GET_HOSTS_FROM | ||
value: dns | ||
ports: | ||
- containerPort: 80 |
Oops, something went wrong.