dsk-dev kubespray 이동

This commit is contained in:
ByeonJungHun
2023-12-19 14:31:22 +09:00
parent a35325e16b
commit 5671a92148
2568 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
---
krew_enabled: false
krew_root_dir: "/usr/local/krew"
krew_default_index_uri: https://github.com/kubernetes-sigs/krew-index.git

View File

@@ -0,0 +1,38 @@
---
- name: Krew | Download krew
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.krew) }}"
- name: Krew | krew env
template:
src: krew.j2
dest: /etc/bash_completion.d/krew
mode: 0644
- name: Krew | Copy krew manifest
template:
src: krew.yml.j2
dest: "{{ local_release_dir }}/krew.yml"
mode: 0644
- name: Krew | Install krew # noqa 301 305
shell: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} install --archive={{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }}.tar.gz --manifest={{ local_release_dir }}/krew.yml"
environment:
KREW_ROOT: "{{ krew_root_dir }}"
KREW_DEFAULT_INDEX_URI: "{{ krew_default_index_uri | default('') }}"
- name: Krew | Get krew completion
command: "{{ local_release_dir }}/krew-{{ host_os }}_{{ image_arch }} completion bash"
changed_when: False
register: krew_completion
check_mode: False
ignore_errors: yes # noqa ignore-errors
- name: Krew | Install krew completion
copy:
dest: /etc/bash_completion.d/krew.sh
content: "{{ krew_completion.stdout }}"
mode: 0755
become: True
when: krew_completion.rc == 0

View File

@@ -0,0 +1,10 @@
---
- name: Krew | install krew on kube_control_plane
import_tasks: krew.yml
- name: Krew | install krew on localhost
import_tasks: krew.yml
delegate_to: localhost
connection: local
run_once: true
when: kubectl_localhost

View File

@@ -0,0 +1,6 @@
# krew bash env(kubespray)
export KREW_ROOT="{{ krew_root_dir }}"
{% if krew_default_index_uri is defined %}
export KREW_DEFAULT_INDEX_URI='{{ krew_default_index_uri }}'
{% endif %}
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

View File

@@ -0,0 +1,100 @@
apiVersion: krew.googlecontainertools.github.com/v1alpha2
kind: Plugin
metadata:
name: krew
spec:
version: "{{ krew_version }}"
homepage: https://krew.sigs.k8s.io/
shortDescription: Package manager for kubectl plugins.
caveats: |
krew is now installed! To start using kubectl plugins, you need to add
krew's installation directory to your PATH:
* macOS/Linux:
- Add the following to your ~/.bashrc or ~/.zshrc:
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
- Restart your shell.
* Windows: Add %USERPROFILE%\.krew\bin to your PATH environment variable
To list krew commands and to get help, run:
$ kubectl krew
For a full list of available plugins, run:
$ kubectl krew search
You can find documentation at
https://krew.sigs.k8s.io/docs/user-guide/quickstart/.
platforms:
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew
files:
- from: ./krew-darwin_amd64
to: krew
- from: ./LICENSE
to: .
selector:
matchLabels:
os: darwin
arch: amd64
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew
files:
- from: ./krew-darwin_arm64
to: krew
- from: ./LICENSE
to: .
selector:
matchLabels:
os: darwin
arch: arm64
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew
files:
- from: ./krew-linux_amd64
to: krew
- from: ./LICENSE
to: .
selector:
matchLabels:
os: linux
arch: amd64
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew
files:
- from: ./krew-linux_arm
to: krew
- from: ./LICENSE
to: .
selector:
matchLabels:
os: linux
arch: arm
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew
files:
- from: ./krew-linux_arm64
to: krew
- from: ./LICENSE
to: .
selector:
matchLabels:
os: linux
arch: arm64
- uri: {{ krew_download_url }}
sha256: {{ krew_archive_checksum }}
bin: krew.exe
files:
- from: ./krew-windows_amd64.exe
to: krew.exe
- from: ./LICENSE
to: .
selector:
matchLabels:
os: windows
arch: amd64