forked from wardviaene/kubernetes-course
-
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.
- Loading branch information
1 parent
8154dfd
commit 6b00448
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
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,36 @@ | ||
# PodPresets | ||
|
||
# Alpha status | ||
As long as the PodPresets is in alpha status, the following changes need to be made in kops: | ||
|
||
``` | ||
spec: | ||
kubeAPIServer: | ||
enableAdmissionPlugins: | ||
- Initializers | ||
- NamespaceLifecycle | ||
- LimitRanger | ||
- ServiceAccount | ||
- PersistentVolumeLabel | ||
- DefaultStorageClass | ||
- DefaultTolerationSeconds | ||
- MutatingAdmissionWebhook | ||
- ValidatingAdmissionWebhook | ||
- NodeRestriction | ||
- ResourceQuota | ||
- PodPreset | ||
runtimeConfig: | ||
settings.k8s.io/v1alpha1: "true" | ||
``` | ||
|
||
# running the demo | ||
First apply the PodPresets: | ||
``` | ||
kubectl create -f pod-presets.yaml | ||
``` | ||
|
||
Then run the deployments | ||
``` | ||
kubectl create -f deployments.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,35 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment-1 | ||
spec: | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: myapp | ||
spec: | ||
containers: | ||
- name: k8s-demo | ||
image: wardviaene/k8s-demo | ||
ports: | ||
- name: nodejs-port | ||
containerPort: 3000 | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment-2 | ||
spec: | ||
replicas: 3 | ||
template: | ||
metadata: | ||
labels: | ||
app: myapp | ||
spec: | ||
containers: | ||
- name: k8s-demo | ||
image: wardviaene/k8s-demo | ||
ports: | ||
- name: nodejs-port | ||
containerPort: 3000 |
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,17 @@ | ||
apiVersion: settings.k8s.io/v1alpha1 # you might have to change this after PodPresets become stable | ||
kind: PodPreset | ||
metadata: | ||
name: share-credential | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: myapp | ||
env: | ||
- name: MY_SECRET | ||
value: "123456" | ||
volumeMounts: | ||
- mountPath: /share | ||
name: share-volume | ||
volumes: | ||
- name: share-volume | ||
emptyDir: {} |