Code Monkey home page Code Monkey logo

14.4-clokub-homeworks's Introduction

Задача 1: Работа с сервис-аккаунтами через утилиту kubectl в установленном minikube

Создадим новый сервис аккаунт и посмотрим на него:

desema@control1:~$ kubectl create serviceaccount netology
serviceaccount/netology created

desema@control1:~$ kubectl get serviceaccounts
NAME                                SECRETS   AGE
default                             1         59d
netology                            1         6s
nfs-server-nfs-server-provisioner   1         46d

desema@control1:~$ kubectl get serviceaccount
NAME                                SECRETS   AGE
default                             1         59d
netology                            1         10s
nfs-server-nfs-server-provisioner   1         46d
desema@control1:~$

Поиграемся с выводом в разные форматы:

desema@control1:~$ kubectl get serviceaccount netology -o yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  creationTimestamp: "2021-12-16T17:32:00Z"
  name: netology
  namespace: default
  resourceVersion: "487095"
  uid: a3344aae-20ac-4c3b-bcfe-f93cb703e925
secrets:
- name: netology-token-txcwf

desema@control1:~$ kubectl get serviceaccount default -o json
{
    "apiVersion": "v1",
    "kind": "ServiceAccount",
    "metadata": {
        "creationTimestamp": "2021-10-17T20:18:38Z",
        "name": "default",
        "namespace": "default",
        "resourceVersion": "432",
        "uid": "3452ae23-44e0-42ea-befa-3ff5a1904d77"
    },
    "secrets": [
        {
            "name": "default-token-mnhwx"
        }
    ]
}

После этого выгрузим сервис-аккаунты в файл, удалим наш тестовый и вернём его обратно импортом из файла:

desema@control1:~$ kubectl get serviceaccounts -o json > serviceaccounts.json
desema@control1:~$ kubectl get serviceaccount netology -o yaml > netology.yml
desema@control1:~$ kubectl delete serviceaccount netology
serviceaccount "netology" deleted
desema@control1:~$ kubectl apply -f netology.yml
serviceaccount/netology created

14.4-clokub-homeworks's People

Contributors

desemas7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.