Skip to content

Commit

Permalink
volumes and imagepullpolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
AdminTurnedDevOps committed May 24, 2022
1 parent ce6b3e8 commit a745015
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 15 deletions.
35 changes: 20 additions & 15 deletions .vscode/targets.log
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ make all --print-data-base --no-builtin-variables --no-builtin-rules --question
make: *** No rule to make target `all'. Stop.


# Make data base, printed on Wed May 18 07:12:02 2022
# Make data base, printed on Tue May 24 06:45:23 2022

# Variables

Expand All @@ -24,6 +24,7 @@ VSCODE_LOG_NATIVE = false
?D = $(patsubst %/,%,$(dir $?))
# automatic
@D = $(patsubst %/,%,$(dir $@))

# automatic
@F = $(notdir $@)
# makefile
Expand All @@ -39,22 +40,25 @@ sonobuoy = /Users/michael/sonobuoyapp/sonobuoy
# makefile
MAKEFILE_LIST :=
# environment
VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
# environment
VSCODE_VERBOSE_LOGGING = true
# environment
__CFBundleIdentifier = com.microsoft.VSCode
# environment
INFOPATH = /opt/homebrew/share/info:
# environment

VSCODE_IPC_HOOK_EXTHOST = /var/folders/c7/m_mq7b7d6t37zt5fg7gg4hb80000gn/T/vscode-ipc-01d20a0b-b500-4591-be29-1b41ec2c9ded.sock
VSCODE_IPC_HOOK_EXTHOST = /var/folders/c7/m_mq7b7d6t37zt5fg7gg4hb80000gn/T/vscode-ipc-2b24a662-a7f5-4ebc-a999-c6c736076545.sock
# environment
VSCODE_CWD = /
# environment
GOPROXY = https://proxy.golang.org,direct
# environment
PATH = /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands
# environment
LSCOLORS = Gxfxcxdxbxegedabagacad
# environment
LaunchInstanceID = 633A6698-4F4C-432B-9A55-CEDFA07869EA
GOPATH = /Users/michael/go
# environment
VSCODE_LOG_STACK = false
# environment
Expand All @@ -76,13 +80,13 @@ ORIGINAL_XDG_CURRENT_DESKTOP = undefined
# environment
MANPATH = /opt/homebrew/share/man::
# environment
VSCODE_AMD_ENTRYPOINT = vs/workbench/api/node/extensionHostProcess
GOMODCACHE = /Users/michael/go/pkg/mod
# environment
HOME = /Users/michael
# default
MAKEFILEPATH = $(shell /usr/bin/xcode-select -print-path 2>/dev/null || echo /Developer)/Makefiles
# environment
VSCODE_CODE_CACHE_PATH = /Users/michael/Library/Application Support/Code/CachedData/da15b6fd3ef856477bf6f4fb29ba1b7af717770d
VSCODE_CODE_CACHE_PATH = /Users/michael/Library/Application Support/Code/CachedData/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
# environment
LOGNAME = michael
# environment
Expand Down Expand Up @@ -120,15 +124,15 @@ TMPDIR = /var/folders/c7/m_mq7b7d6t37zt5fg7gg4hb80000gn/T/
# automatic
*F = $(notdir $*)
# environment
VSCODE_IPC_HOOK = /Users/michael/Library/Application Support/Code/1.67.1-main.sock
VSCODE_IPC_HOOK = /Users/michael/Library/Application Support/Code/1.67.2-main.sock
# makefile
MAKEFLAGS = Rrqp
# environment
MFLAGS = -Rrqp
# automatic
*D = $(patsubst %/,%,$(dir $*))
# environment
XPC_SERVICE_NAME = application.com.microsoft.VSCode.16705875.16705881
XPC_SERVICE_NAME = application.com.microsoft.VSCode.17264903.17264909
# environment
HOMEBREW_PREFIX = /opt/homebrew
# automatic
Expand All @@ -149,32 +153,33 @@ MAKEFILES :=
PAGER = less
# environment
LC_ALL = C
# environment
SECURITYSESSIONID = 186b1
# automatic
^F = $(notdir $^)
# default

SUFFIXES :=
# default
.INCLUDE_DIRS = /usr/local/include
# environment
MAKELEVEL := 0
# environment
LANG = C

# environment
VSCODE_PID = 712
VSCODE_PID = 84337
# variable set hash-table stats:
# Load=74/1024=7%, Rehash=0, Collisions=1/95=1%
# Load=75/1024=7%, Rehash=0, Collisions=2/96=2%

# Pattern-specific Variable Values

# No pattern-specific variable values.

# Directories

# . (device 16777232, inode 14779675): 15 files, no impossibilities.
# . (device 16777232, inode 14779675): 18 files, no impossibilities.

# 15 files, no impossibilities in 1 directories.

# 18 files, no impossibilities in 1 directories.

# Implicit Rules

Expand Down Expand Up @@ -246,6 +251,6 @@ GNUmakefile:
# strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
# strcache free: total = 0 / max = 0 / min = 4096 / avg = 0

# Finished Make data base on Wed May 18 07:12:02 2022
# Finished Make data base on Tue May 24 06:45:23 2022


20 changes: 20 additions & 0 deletions imagePullPolicy/nginx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginxdeployment
replicas: 2
template:
metadata:
labels:
app: nginxdeployment
spec:
containers:
- name: nginxdeployment
image: nginx:latest
imagePullPolicy: IfNotPresent # other options include: Always and Never
ports:
- containerPort: 80
55 changes: 55 additions & 0 deletions volumes/azurevolume-csi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# kind: StorageClass
# apiVersion: storage.k8s.io/v1
# metadata:
# name: azurefile-csi
# provisioner: file.csi.azure.com # replace with "kubernetes.io/azure-file" if aks version is less than 1.21
# allowVolumeExpansion: true
# mountOptions:
# - dir_mode=0777
# - file_mode=0777
# - uid=0
# - gid=0
# - mfsymlinks
# - cache=strict
# - actimeo=30
# parameters:
# skuName: Premium_LRS
# ---
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: azurefile
# spec:
# accessModes:
# - ReadWriteMany
# storageClassName: azurefile-csi
# resources:
# requests:
# storage: 5Gi
# ---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginxdeployment
spec:
selector:
matchLabels:
app: nginxdeployment
replicas: 2
template:
metadata:
labels:
app: nginxdeployment
spec:
containers:
- image: nginx:latest
name: nginx
volumeMounts:
- mountPath: /youtube
name: azure
volumes:
- name: azure
azureFile:
secretName: azure-secret
shareName: youtube
readOnly: false
53 changes: 53 additions & 0 deletions volumes/azurevolume-pvc-and-sc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# kind: StorageClass
# apiVersion: storage.k8s.io/v1
# metadata:
# name: azurefile-csi
# provisioner: file.csi.azure.com
# allowVolumeExpansion: true
# mountOptions:
# - dir_mode=0777
# - file_mode=0777
# - uid=0
# - gid=0
# - mfsymlinks
# - cache=strict
# - actimeo=30
# parameters:
# skuName: Premium_LRS
# ---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: azurefile
spec:
accessModes:
- ReadWriteMany
storageClassName: azurefile-csi
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginxdeployment
spec:
selector:
matchLabels:
app: nginxdeployment
replicas: 2
template:
metadata:
labels:
app: nginxdeployment
spec:
containers:
- image: nginx:latest
name: nginx
volumeMounts:
- mountPath: /mnt/azure
name: azure
volumes:
- name: azure
persistentVolumeClaim:
claimName: azurefile
8 changes: 8 additions & 0 deletions volumes/commands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
storageAccountName='test92'
resourceGroup='devrelasaservice'

storageKey=$(az storage account keys list --resource-group $resourceGroup --account-name $storageAccountName --query "[0].value" -o tsv)
echo $storageKey

# Azure Secret
kubectl create secret generic azure-secret --from-literal=azurestorageaccountname=$storageAccountName --from-literal=azurestorageaccountkey=$storageKey
18 changes: 18 additions & 0 deletions volumes/localvolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Pod
metadata:
name: configmap-pod
spec:
containers:
- name: nginx
image: nginx:latest
volumeMounts:
- name: configvolume
mountPath: /etc/config
volumes:
- name: config-vol
configMap:
name: log-config
items:
- key: log_level
path: log_level

0 comments on commit a745015

Please sign in to comment.