Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
14b554ce
Commit
14b554ce
authored
Aug 19, 2015
by
Muhammed Uluyol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a persistent volume for the docker registry.
parent
7129d477
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
61 additions
and
21 deletions
+61
-21
registry-pv.yaml.in
cluster/addons/registry/registry-pv.yaml.in
+16
-0
registry-pvc.yaml.in
cluster/addons/registry/registry-pvc.yaml.in
+13
-0
registry-rc.yaml
cluster/addons/registry/registry-rc.yaml
+2
-10
config-default.sh
cluster/gce/config-default.sh
+1
-1
config-test.sh
cluster/gce/config-test.sh
+1
-1
configure-vm.sh
cluster/gce/configure-vm.sh
+3
-4
helper.sh
cluster/gce/debian/helper.sh
+1
-0
util.sh
cluster/gce/util.sh
+1
-1
init.sls
cluster/saltbase/salt/kube-addons/init.sls
+18
-1
kube-addon-update.sh
cluster/saltbase/salt/kube-addons/kube-addon-update.sh
+5
-3
No files found.
cluster/addons/registry/registry-pv.yaml.in
0 → 100644
View file @
14b554ce
kind: PersistentVolume
apiVersion: v1
metadata:
name: kube-system-kube-registry-pv
labels:
kubernetes.io/cluster-service: "true"
spec:
{% if pillar.get('cluster_registry_disk_type', '') == 'gce' %}
capacity:
storage: {{ pillar['cluster_registry_disk_size'] }}
accessModes:
- ReadWriteOnce
gcePersistentDisk:
pdName: "{{ pillar['cluster_registry_disk_name'] }}"
fsType: "ext4"
{% endif %}
cluster/addons/registry/registry-pvc.yaml.in
0 → 100644
View file @
14b554ce
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: kube-registry-pvc
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ pillar['cluster_registry_disk_size'] }}
cluster/addons/registry/registry-rc.yaml
.in
→
cluster/addons/registry/registry-rc.yaml
View file @
14b554ce
...
...
@@ -41,13 +41,5 @@ spec:
# TODO: use a persistent volume claim
volumes
:
-
name
:
image-store
{%- if pillar.get('cluster_registry_disk', '') != '' -%}
{%- for disk in pillar['cluster_registry_disk'].keys() %}
{{ disk }}:
{%- for k, v in pillar['cluster_registry_disk'][disk].items() %}
{{k}}: {{v}}
{%- endfor -%}
{%- endfor -%}
{%- else %}
emptyDir: {}
{%- endif -%}
persistentVolumeClaim
:
claimName
:
kube-registry-pvc
cluster/gce/config-default.sh
View file @
14b554ce
...
...
@@ -81,7 +81,7 @@ DNS_REPLICAS=1
ENABLE_CLUSTER_REGISTRY
=
"
${
KUBE_ENABLE_CLUSTER_REGISTRY
:-
true
}
"
CLUSTER_REGISTRY_DISK
=
"
${
CLUSTER_REGISTRY_PD
:-${
INSTANCE_PREFIX
}
-kube-system-kube-registry
}
"
CLUSTER_REGISTRY_DISK_SIZE
=
"
${
CLUSTER_REGISTRY_DISK_SIZE
:-
200GB
}
"
CLUSTER_REGISTRY_DISK_TYPE
=
"
${
CLUSTER_REGISTRY_DISK_TYP
E
:-
pd
-standard
}
"
CLUSTER_REGISTRY_DISK_TYPE
_GCE
=
"
${
CLUSTER_REGISTRY_DISK_TYPE_GC
E
:-
pd
-standard
}
"
# Optional: Install Kubernetes UI
ENABLE_CLUSTER_UI
=
"
${
KUBE_ENABLE_CLUSTER_UI
:-
true
}
"
...
...
cluster/gce/config-test.sh
View file @
14b554ce
...
...
@@ -86,7 +86,7 @@ DNS_REPLICAS=1
ENABLE_CLUSTER_REGISTRY
=
"
${
KUBE_ENABLE_CLUSTER_REGISTRY
:-
true
}
"
CLUSTER_REGISTRY_DISK
=
"
${
CLUSTER_REGISTRY_DISK
:-${
INSTANCE_PREFIX
}
-kube-system-kube-registry
}
"
CLUSTER_REGISTRY_DISK_SIZE
=
"
${
CLUSTER_REGISTRY_DISK_SIZE
:-
200GB
}
"
CLUSTER_REGISTRY_DISK_TYPE
=
"
${
CLUSTER_REGISTRY_DISK_TYP
E
:-
pd
-standard
}
"
CLUSTER_REGISTRY_DISK_TYPE
_GCE
=
"
${
CLUSTER_REGISTRY_DISK_TYPE_GC
E
:-
pd
-standard
}
"
# Optional: Install Kubernetes UI
ENABLE_CLUSTER_UI
=
"
${
KUBE_ENABLE_CLUSTER_UI
:-
true
}
"
...
...
cluster/gce/configure-vm.sh
View file @
14b554ce
...
...
@@ -307,10 +307,9 @@ EOF
# TODO: Replace this with a persistent volume (and create it).
if
[[
"
${
ENABLE_CLUSTER_REGISTRY
}
"
==
true
&&
-n
"
${
CLUSTER_REGISTRY_DISK
}
"
]]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
cluster_registry_disk:
gcePersistentDisk:
pdName:
${
CLUSTER_REGISTRY_DISK
}
fsType: ext4
cluster_registry_disk_type: gce
cluster_registry_disk_size:
${
CLUSTER_REGISTRY_DISK_SIZE
//GB/Gi
}
cluster_registry_disk_name:
${
CLUSTER_REGISTRY_DISK
}
EOF
fi
}
...
...
cluster/gce/debian/helper.sh
View file @
14b554ce
...
...
@@ -43,6 +43,7 @@ ELASTICSEARCH_LOGGING_REPLICAS: $(yaml-quote ${ELASTICSEARCH_LOGGING_REPLICAS:-}
ENABLE_CLUSTER_DNS:
$(
yaml-quote
${
ENABLE_CLUSTER_DNS
:-
false
})
ENABLE_CLUSTER_REGISTRY:
$(
yaml-quote
${
ENABLE_CLUSTER_REGISTRY
:-
false
})
CLUSTER_REGISTRY_DISK:
$(
yaml-quote
${
CLUSTER_REGISTRY_DISK
})
CLUSTER_REGISTRY_DISK_SIZE:
$(
yaml-quote
${
CLUSTER_REGISTRY_DISK_SIZE
})
DNS_REPLICAS:
$(
yaml-quote
${
DNS_REPLICAS
:-})
DNS_SERVER_IP:
$(
yaml-quote
${
DNS_SERVER_IP
:-})
DNS_DOMAIN:
$(
yaml-quote
${
DNS_DOMAIN
:-})
...
...
cluster/gce/util.sh
View file @
14b554ce
...
...
@@ -648,7 +648,7 @@ function kube-up {
gcloud compute disks create
"
${
CLUSTER_REGISTRY_DISK
}
"
\
--project
"
${
PROJECT
}
"
\
--zone
"
${
ZONE
}
"
\
--type
"
${
CLUSTER_REGISTRY_DISK_TYPE
}
"
\
--type
"
${
CLUSTER_REGISTRY_DISK_TYPE
_GCE
}
"
\
--size
"
${
CLUSTER_REGISTRY_DISK_SIZE
}
"
&
fi
...
...
cluster/saltbase/salt/kube-addons/init.sls
View file @
14b554ce
...
...
@@ -92,7 +92,24 @@ addon-dir-create:
/etc/kubernetes/addons/registry/registry-rc.yaml:
file.managed:
- source: salt://kube-addons/registry/registry-rc.yaml.in
- source: salt://kube-addons/registry/registry-rc.yaml
- user: root
- group: root
- file_mode: 644
- makedirs: True
/etc/kubernetes/addons/registry/registry-pv.yaml:
file.managed:
- source: salt://kube-addons/registry/registry-pv.yaml.in
- template: jinja
- user: root
- group: root
- file_mode: 644
- makedirs: True
/etc/kubernetes/addons/registry/registry-pvc.yaml:
file.managed:
- source: salt://kube-addons/registry/registry-pvc.yaml.in
- template: jinja
- user: root
- group: root
...
...
cluster/saltbase/salt/kube-addons/kube-addon-update.sh
View file @
14b554ce
...
...
@@ -470,12 +470,14 @@ function update-addons() {
# be careful, reconcile-objects uses global variables
reconcile-objects
${
addon_path
}
ReplicationController
"-"
&
# We don't expect
service names to be versioned
, so
# we match entire name, ignoring version suffix.
# We don't expect
names to be versioned for the following kinds
, so
# we match
the
entire name, ignoring version suffix.
# That's why we pass an empty string as the version separator.
# If the
service description differs on disk, the service
should be recreated.
# If the
description differs on disk, the object
should be recreated.
# This is not implemented in this version.
reconcile-objects
${
addon_path
}
Service
""
&
reconcile-objects
${
addon_path
}
PersistentVolume
""
&
reconcile-objects
${
addon_path
}
PersistentVolumeClaim
""
&
wait-for-jobs
if
[[
$?
-eq
0
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment